207 |
private void render(VobScene vs) { |
private void render(VobScene vs) { |
208 |
buoys.clear(); |
buoys.clear(); |
209 |
curVs = vs; |
curVs = vs; |
210 |
|
realLinks = new ArrayList(); |
211 |
vs.map.put(new SolidBackdropVob(Color.lightGray)); |
vs.map.put(new SolidBackdropVob(Color.lightGray)); |
212 |
|
|
213 |
float width = (float)vs.size.getWidth() * focusSizeFactor; |
float width = (float)vs.size.getWidth() * focusSizeFactor; |
216 |
ctrX = ((float)vs.size.width)/2; |
ctrX = ((float)vs.size.width)/2; |
217 |
ctrY = ((float)vs.size.height)/2; |
ctrY = ((float)vs.size.height)/2; |
218 |
|
|
219 |
|
/* |
220 |
int focusCtr = vs.translateCS(0, "FocusCtr", ctrX,ctrY); |
int focusCtr = vs.translateCS(0, "FocusCtr", ctrX,ctrY); |
221 |
int frameCS = vs.orthoBoxCS(focusCtr, "FocusFrame", 200, |
int frameCS = vs.orthoBoxCS(focusCtr, "FocusFrame", 200, |
222 |
-width/2, -height/2, 1, 1, |
-width/2, -height/2, 1, 1, |
223 |
width, height); |
width, height); |
224 |
|
*/ |
225 |
//int frameCS = vs.orthoBoxCS(0, "FocusFrame", 200, |
int frameCS = vs.orthoBoxCS(0, "FocusFrame", 200, |
226 |
// ctrX - width/2, ctrY - height/2, 1, 1, |
ctrX - width/2, ctrY - height/2, 1, 1, |
227 |
// width, height); |
width, height); |
228 |
vs.activate(frameCS); |
vs.activate(frameCS); |
229 |
|
|
230 |
if (focus == null) |
if (focus == null) |
231 |
focus = adaptor.createMainNode(null, accursed, this); |
focus = adaptor.createMainNode(null, accursed, this); |
232 |
focus.renderMain(vs, frameCS); |
focus.renderMain(vs, frameCS); |
233 |
|
|
234 |
|
// render links! |
235 |
|
for (int i=0; i<realLinks.size(); i++) { |
236 |
|
Object[] args = (Object[])realLinks.get(i); |
237 |
|
int dir = ((Integer)args[0]).intValue(); |
238 |
|
int anchorCS = ((Integer)args[1]).intValue(); |
239 |
|
linkReally(dir, anchorCS, (BuoyViewNodeType)args[2], args[3], args[4]); |
240 |
|
} |
241 |
} |
} |
242 |
|
|
243 |
// ------------------------------------------------------------ |
// ------------------------------------------------------------ |
244 |
// BuoyLinkListener |
// BuoyLinkListener |
245 |
|
|
246 |
|
ArrayList realLinks = new ArrayList(); |
247 |
public void link(int dir, int anchorCS, BuoyViewNodeType otherNode, |
public void link(int dir, int anchorCS, BuoyViewNodeType otherNode, |
248 |
Object linkId, Object otherAnchor) { |
Object linkId, Object otherAnchor) { |
249 |
p("link!"); |
p("link!"); |
250 |
|
realLinks.add(new Object[] { new Integer(dir), new Integer(anchorCS), |
251 |
|
otherNode, linkId, otherAnchor }); |
252 |
|
} |
253 |
|
|
254 |
|
/** Because of gl clipping with stencil buoy nodes |
255 |
|
* must be rendered after the linking. |
256 |
|
*/ |
257 |
|
private void linkReally(int dir, int anchorCS, BuoyViewNodeType otherNode, |
258 |
|
Object linkId, Object otherAnchor) { |
259 |
|
p("linkReally!"); |
260 |
int anchorUnit = curVs.unitSqCS(anchorCS, "UN"); |
int anchorUnit = curVs.unitSqCS(anchorCS, "UN"); |
261 |
int anchorCenter = curVs.translateCS(anchorUnit, "TR55", 0.5f, 0.5f); |
int anchorCenter = curVs.translateCS(anchorUnit, "TR55", 0.5f, 0.5f); |
262 |
float r = ctrY * 0.9f; |
float r = ctrY * 0.9f; |