135 |
public boolean useStencil = true; |
public boolean useStencil = true; |
136 |
|
|
137 |
/* jython publics */ |
/* jython publics */ |
138 |
|
public boolean test_U=false; |
139 |
|
public boolean test_Y=false; |
140 |
|
public int OLD_Y = -1; |
141 |
|
public int OLD_U = -1; |
142 |
|
|
143 |
public PPMouseEvents pp_events; |
public PPMouseEvents pp_events; |
144 |
public boolean replaceNewScene = false; |
public boolean replaceNewScene = false; |
145 |
public PPActions ppactions; |
public PPActions ppactions; |
268 |
VobScene vs; |
VobScene vs; |
269 |
Buoy4Floater floater; |
Buoy4Floater floater; |
270 |
|
|
|
// Nadir CS |
|
|
final int nadir_point_cs; |
|
|
|
|
271 |
BFloater(int dir, VobScene vs) { |
BFloater(int dir, VobScene vs) { |
272 |
this.dir = dir; |
this.dir = dir; |
273 |
this.vs = vs; |
this.vs = vs; |
274 |
floater = new CircleFloater4(vs, 0, |
floater = new CircleFloater4(vs, 0, |
275 |
centerX(vs), buoyCenterY, buoyRadius, |
centerX(vs), buoyCenterY, buoyRadius, |
276 |
centerX(vs) - dir * buoyRadius, buoyCenterY); |
centerX(vs) - dir * buoyRadius, buoyCenterY); |
|
|
|
|
nadir_point_cs = vs.orthoBoxCS(0, "nadir_frame"+dir, 0, |
|
|
leftPanelRealWidth + 0.5f*mainWidth, |
|
|
mainHeight*2.0f, |
|
|
1, 1, 2, 2); |
|
277 |
} |
} |
278 |
public void buoy(final int anchor, final Cell c, Cell connectedFrom) { |
public void buoy(final int anchor, final Cell c, Cell connectedFrom) { |
279 |
Object key ; |
Object key ; |
285 |
int actr = vs.translateCS(anchorUnit, "TR12", .5f, .5f); |
int actr = vs.translateCS(anchorUnit, "TR12", .5f, .5f); |
286 |
int buoycs = floater.buoyCoordsys(actr, key); |
int buoycs = floater.buoyCoordsys(actr, key); |
287 |
|
|
288 |
|
|
289 |
|
// Nadir CS |
290 |
|
final int nadir_point_cs; |
291 |
|
nadir_point_cs = vs.orthoBoxCS(0, "nadir_point"+c, 0, |
292 |
|
leftPanelRealWidth + 0.5f*mainWidth, |
293 |
|
mainHeight*2.0f, |
294 |
|
1, 1, 2, 2); |
295 |
final int nadir_buoy = |
final int nadir_buoy = |
296 |
((GLVobCoorder)vs.coords).nadirOrigin(buoycs, nadir_point_cs); |
((GLVobCoorder)vs.coords).nadirOrigin(buoycs, nadir_point_cs); |
297 |
vs.matcher.add(nadir_buoy, "NADIR"+c.toString() ); |
vs.matcher.add(nadir_buoy, "NADIR"+c.toString() ); |
301 |
-buoyVPWidth/2, -buoyVPHeight/2, 1, 1, |
-buoyVPWidth/2, -buoyVPHeight/2, 1, 1, |
302 |
buoyVPWidth, buoyVPHeight); |
buoyVPWidth, buoyVPHeight); |
303 |
vs.activate(frameCS); |
vs.activate(frameCS); |
304 |
|
// XXX Pan |
305 |
|
int[] pan = getCoords(c); |
306 |
|
final int c2fCS = vs.coords.ortho(0, 0, |
307 |
|
-pan[0]*buoyZoom, -pan[1]*buoyZoom, buoyZoom, buoyZoom); |
308 |
|
vs.matcher.add(frameCS, c2fCS, "C2F"); |
309 |
|
|
310 |
ev_handler.onClick(frameCS, "Link CLICK", |
ev_handler.onClick(frameCS, "Link CLICK", |
311 |
new Object[]{ c, connectedFrom, new Integer(MAIN_CS), |
new Object[]{ c, connectedFrom, new Integer(MAIN_CS), |
312 |
new Integer(frameCS), new Integer(anchor)}); |
new Integer(frameCS), new Integer(anchor), |
313 |
|
new Integer(buoycs)}); |
314 |
ev_handler.onDrag(frameCS, "Drag buoy"); |
ev_handler.onDrag(frameCS, "Drag buoy"); |
315 |
|
|
|
|
|
|
// XXX hehheh... remember that new accursed have already been set! |
|
|
/* |
|
|
if (pp_events.context != null && |
|
|
interps.get("link"+pp_events.context.getAccursed().toString()) != null) { |
|
|
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(frameCS, |
|
|
((Integer)interps.get("link"+pp_events.context.getAccursed().toString())).intValue() |
|
|
); |
|
|
} |
|
|
*/ |
|
|
|
|
|
|
|
316 |
if (interps.get("link"+c.toString()) != null) { |
if (interps.get("link"+c.toString()) != null) { |
317 |
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(frameCS, |
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(nadir_buoy, |
318 |
((Integer)interps.get("link"+c.toString())).intValue()); |
((Integer)interps.get("link"+c.toString())).intValue()); |
319 |
} |
} |
320 |
|
|
|
|
|
|
// XXX Pan |
|
|
int[] pan = getCoords(c); |
|
|
final int c2fCS = vs.coords.ortho(0, 0, |
|
|
-pan[0]*buoyZoom, -pan[1]*buoyZoom, buoyZoom, buoyZoom); |
|
|
vs.matcher.add(frameCS, c2fCS, "C2F"); |
|
|
|
|
321 |
buoyqueue.add(new Runnable() { |
buoyqueue.add(new Runnable() { |
322 |
public void run() { |
public void run() { |
323 |
buoy_vc.setAccursed(c); |
buoy_vc.setAccursed(c); |
356 |
public void render(VobScene vs, int intoCS, ViewContext context) { |
public void render(VobScene vs, int intoCS, ViewContext context) { |
357 |
ev_handler.cleanCallers(); |
ev_handler.cleanCallers(); |
358 |
|
|
|
|
|
359 |
buoy_vc.setCellView(cellview); |
buoy_vc.setCellView(cellview); |
360 |
|
|
361 |
buoy_singlePlane = new SinglePlane(); |
buoy_singlePlane = new SinglePlane(); |
388 |
(-mainWidth)/2, -mainHeight/2, 1, 1, |
(-mainWidth)/2, -mainHeight/2, 1, 1, |
389 |
mainWidth, mainHeight); |
mainWidth, mainHeight); |
390 |
vs.activate(frameCS); |
vs.activate(frameCS); |
391 |
MAIN_CS = frameCS; |
|
392 |
|
// cell to frame CS |
393 |
|
int c2fCS = vs.coords.ortho(0, 0, 0, 0, 10, 10); |
394 |
|
vs.matcher.add(frameCS, c2fCS, "C2F"); |
395 |
|
|
396 |
|
MAIN_CS = mainctr; |
397 |
|
|
398 |
ev_handler.onClick(frameCS, "Click MAINVP", |
ev_handler.onClick(frameCS, "Click MAINVP", |
399 |
new Object[]{ new Integer(mainctr), new Integer(frameCS)} |
new Object[]{ new Integer(mainctr), new Integer(frameCS)} |
400 |
); |
); |
403 |
); |
); |
404 |
pp_events.setKingCS(frameCS); |
pp_events.setKingCS(frameCS); |
405 |
|
|
406 |
if (interps.get("main") != null) { |
if (interps.get("link") != null) { |
407 |
|
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(MAIN_CS, |
408 |
|
((Integer)interps.get("link")).intValue()); |
409 |
|
} |
410 |
|
if (interps.get("shortcut") != null) { |
411 |
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(MAIN_CS, |
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(MAIN_CS, |
412 |
((Integer)interps.get("main")).intValue()); |
((Integer)interps.get("shortcut")).intValue()); |
413 |
} |
} |
414 |
|
|
415 |
|
|
416 |
|
|
|
// cell to frame CS |
|
|
int c2fCS = vs.coords.ortho(0, 0, 0, 0, 10, 10); |
|
|
vs.matcher.add(frameCS, c2fCS, "C2F"); |
|
|
|
|
417 |
|
|
418 |
int[] coords = getCoords(context.getAccursed()); |
int[] coords = getCoords(context.getAccursed()); |
419 |
if(coords != null) { |
if(coords != null) { |
453 |
|
|
454 |
float scale = style.getScaleByHeight(40); |
float scale = style.getScaleByHeight(40); |
455 |
|
|
456 |
|
|
457 |
|
|
458 |
// put the "New paper" -text |
// put the "New paper" -text |
459 |
TextVob new_paper_button = new TextVob(style, "Uusi paperi"); |
TextVob new_paper_button = new TextVob(style, "Uusi paperi"); |
460 |
float width = new_paper_button.getWidth(scale); |
float width = new_paper_button.getWidth(scale); |
473 |
ev_handler.onClick(new_paper_button_frame, "Add new paper"); |
ev_handler.onClick(new_paper_button_frame, "Add new paper"); |
474 |
|
|
475 |
|
|
476 |
|
// testing |
477 |
|
int barY = -1; |
478 |
|
if (test_Y) { |
479 |
|
barY = vs.translateCS(0, "Y", 1000, 100, 0); |
480 |
|
pa("***foobar*** "+barY); |
481 |
|
test_Y = false; |
482 |
|
} |
483 |
|
if (OLD_Y > 0 && barY >0) |
484 |
|
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(new_paper_button_cs, OLD_Y); |
485 |
|
OLD_Y = barY; |
486 |
|
|
487 |
|
|
488 |
// put the "Add photo" -text |
// put the "Add photo" -text |
489 |
TextVob add_photo_button = new TextVob(style, "Liita kuva"); |
TextVob add_photo_button = new TextVob(style, "Liita kuva"); |
490 |
width = add_photo_button.getWidth(scale); |
width = add_photo_button.getWidth(scale); |
550 |
int i=0; |
int i=0; |
551 |
for(float y = 1.5f*leftPanelObjectHeight; p != null; |
for(float y = 1.5f*leftPanelObjectHeight; p != null; |
552 |
y += leftPanelObjectHeight) { |
y += leftPanelObjectHeight) { |
553 |
int fr; |
int fr, ctr=-1; |
554 |
if (i==0) { |
if (i==0) { |
555 |
int ctr = ((GLVobCoorder)vs.coords).affineCoordsys(0, 100, |
ctr = ((GLVobCoorder)vs.coords).affineCoordsys(0, 100, |
556 |
x, y, 1, 0, 0, 1); |
x, y, 1, 0, 0, 1); |
557 |
fr = vs.orthoBoxCS(ctr, "frame", 100, |
fr = vs.orthoBoxCS(ctr, "frame", 100, |
558 |
-leftPanelRealWidth/2, -leftPanelRealHeight/2, |
-leftPanelRealWidth/2, -leftPanelRealHeight/2, |
559 |
1, 1, leftPanelRealWidth, leftPanelRealHeight); |
1, 1, leftPanelRealWidth, leftPanelRealHeight); |
560 |
vs.matcher.add(ctr, "ctrl_home"); |
vs.matcher.add(ctr, "ctr"); |
561 |
|
|
562 |
|
//((DefaultVobMatcher)vs.matcher).dumpByParent(fr); |
563 |
|
|
564 |
} |
} |
565 |
else { |
else { |
566 |
fr = cs_gen.getNextCS(); |
fr = cs_gen.getNextCS(); |
567 |
|
//ctrl = vs.map. |
568 |
|
ctr = ((GLVobCoorder)vs.coords).getParent(fr); |
569 |
} |
} |
570 |
|
|
571 |
vs.activate(fr); |
vs.activate(fr); |
|
ev_handler.onClick(fr, "Shortcut link", new Object[]{p, new Integer(MAIN_CS), new Integer(fr)}); |
|
|
if (interps.get("shortcut"+p.toString()) != null) { |
|
|
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(MAIN_CS, |
|
|
((Integer)interps.get("shortcut"+p.toString())).intValue()); |
|
|
} |
|
|
|
|
572 |
int c2f = vs.coords.ortho(0, 11, 0, 0, |
int c2f = vs.coords.ortho(0, 11, 0, 0, |
573 |
leftPanelZoom, leftPanelZoom); |
leftPanelZoom, leftPanelZoom); |
574 |
vs.matcher.add(fr, c2f, "C2F"); |
vs.matcher.add(fr, c2f, "C2F"); |
575 |
|
|
576 |
|
ev_handler.onClick(fr, "Shortcut link", new Object[]{p, new Integer(MAIN_CS), new Integer(ctr)}); |
577 |
|
/* |
578 |
|
if (interps.get("shortcut") != null) { |
579 |
|
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(MAIN_CS, |
580 |
|
((Integer)interps.get("shortcut")).intValue()); |
581 |
|
} |
582 |
|
*/ |
583 |
|
|
584 |
|
if (i ==0) { |
585 |
|
// testing |
586 |
|
int barU = -1; |
587 |
|
if (test_U) { |
588 |
|
barU = vs.translateCS(0, "Y", 1000, 100, 0); |
589 |
|
pa("***foobar*** "+barU); |
590 |
|
test_U = false; |
591 |
|
} |
592 |
|
if (OLD_U > 0 && barU >0) |
593 |
|
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(ctr, OLD_U); |
594 |
|
OLD_U = barU; |
595 |
|
} |
596 |
|
|
597 |
|
|
598 |
|
|
599 |
buoy_vc.setAccursed(p); |
buoy_vc.setAccursed(p); |
600 |
buoy_singlePlane.render(vs, fr, c2f); |
buoy_singlePlane.render(vs, fr, c2f); |
601 |
p = p.s(d.d1); |
p = p.s(d.d1); |