99 |
vanishing.render(this, context, d.width / 2, d.height / 2); |
vanishing.render(this, context, d.width / 2, d.height / 2); |
100 |
} |
} |
101 |
|
|
|
/* |
|
|
public void render(VobScene into, Cell window) { |
|
|
Dimension d = into.getSize(); |
|
|
render(into, window, d.width / 2, d.height / 2); |
|
|
} |
|
|
|
|
|
public void render(VobScene into, Cell window, int x, int y) { |
|
|
render(into, window, Cursor.get(window), x, y); |
|
|
} |
|
|
*/ |
|
|
|
|
102 |
ViewContext context; |
ViewContext context; |
103 |
CellView cvf; |
CellView cvf; |
|
|
|
|
/* |
|
|
|
|
|
public void render(VobScene into, Cell window, Cell cursor, int px, int py) { |
|
|
|
|
|
this.into = into; |
|
|
cvf.setCenter(cursor); |
|
|
dims = UnifiedBinder.readDims(window); |
|
|
|
|
|
vanishing.render(this, cursor, px, py, dims); |
|
|
|
|
|
int w = 60; int h = 20; |
|
|
|
|
|
|
|
|
// XXXX SpanView (uses multiple PlainVanishings) draws extra lines |
|
|
// if decorate is called here... :-/ |
|
|
// decorate(into); |
|
|
|
|
|
// Place the dimension cells |
|
|
// XXX This must be abstracted out to somewhere! |
|
|
|
|
|
Dimension d = cvf.getDefaultSize(); |
|
|
int dw = d.width; |
|
|
int dh = d.height; |
|
|
|
|
|
Cell dimc = Params.getParam(window, Client.c_dims); |
|
|
|
|
|
int cs = into.coords.coordsys(null, 1, 0, 0, dw, dh); |
|
|
cvf.addCellVobs(dimc, into, cs, null); |
|
|
|
|
|
dimc = dimc.s(Client.d1); |
|
|
int y = dh; |
|
|
while (dimc != null) { |
|
|
int x = 0; |
|
|
Cell c = dimc; |
|
|
while (c != null) { |
|
|
cs = into.coords.coordsys(null, 1, x, y, dw, dh); |
|
|
cvf.addCellVobs(c, into, cs, null); |
|
|
x += dw; |
|
|
c = c.s(Client.d2); |
|
|
} |
|
|
y += dh; |
|
|
dimc = dimc.s(Client.d1); |
|
|
} |
|
|
} |
|
|
*/ |
|
104 |
|
|
105 |
public Object getVobSize(Cell c, float fract, int flags, Dimension outDim) { |
public Object getVobSize(Cell c, float fract, int flags, Dimension outDim) { |
106 |
cvf.getDefaultSize(fract, outDim); |
cvf.getDefaultSize(fract, outDim); |
107 |
return null; |
return null; |
108 |
} |
} |
109 |
|
|
110 |
|
Map cell2Box = new HashMap(); |
111 |
|
|
112 |
public void place(Cell c, Object o, float fract, int x0, int y0, int x1, int y1, |
public void place(Cell c, Object o, float fract, int x0, int y0, int x1, int y1, |
113 |
int depth, float rot) { |
int depth, float rot) { |
114 |
Vob v = (Vob)o; |
Vob v = (Vob)o; |
115 |
int cs = into.coordsys(intoCS, c, depth, x0, y0, fract, fract); |
int cs = into.coordsys(intoCS, c, depth, x0, y0, fract, fract); |
116 |
cvf.place(c, into, cs, (x1-x0)/fract, (y1-y0)/fract, context); |
Box b = new Box(); |
117 |
|
b.set(into, cs, (x1-x0)/fract, (y1-y0)/fract); |
118 |
|
cell2Box.put(c, b); |
119 |
|
cvf.place(c, into, b, context); |
120 |
} |
} |
121 |
|
|
122 |
public void connect(Cell cell1, Cell cell2, int dx, int dy) { |
public void connect(Cell cell1, Cell cell2, int dx, int dy) { |
123 |
int cs1 = into.matcher.getCS(cell1); |
Box b1 = (Box)cell2Box.get(cell1); |
124 |
int cs2 = into.matcher.getCS(cell2); |
Box b2 = (Box)cell2Box.get(cell2); |
125 |
|
|
126 |
if(cs1 < 0 && cs2 < 0) |
if(b1 == null && b2 == null) |
127 |
throw new Error("Neither cell seems to have been put, yet"); |
throw new Error("Neither cell seems to have been put, yet"); |
128 |
else if(cs2 < 0) |
else if(b2 == null) |
129 |
into.map.put(pstubs[dx], cs1); |
into.map.put(pstubs[dx], b1.getUnitCoordsys()); |
130 |
else if(cs1 < 0) |
else if(b1 == null) |
131 |
into.map.put(nstubs[dx], cs2); |
into.map.put(nstubs[dx], b2.getUnitCoordsys()); |
132 |
else |
else |
133 |
into.map.put(connections[dx][dy], cs1, cs2); |
into.map.put(connections[dx][dy], b1.getUnitCoordsys(), b2.getUnitCoordsys()); |
134 |
} |
} |
135 |
|
|
136 |
} |
} |