42 |
public static Object NEWPAPERKEY = new Object(); |
public static Object NEWPAPERKEY = new Object(); |
43 |
|
|
44 |
private EventHandling ev_handler = EventHandling.i(); |
private EventHandling ev_handler = EventHandling.i(); |
45 |
public PPEvents pp_events; |
public PPMouseEvents pp_events; |
46 |
|
|
47 |
|
|
48 |
// Geometry |
// Geometry |
291 |
-buoyVPWidth/2, -buoyVPHeight/2, 1, 1, |
-buoyVPWidth/2, -buoyVPHeight/2, 1, 1, |
292 |
buoyVPWidth, buoyVPHeight); |
buoyVPWidth, buoyVPHeight); |
293 |
vs.activate(frameCS); |
vs.activate(frameCS); |
294 |
|
ev_handler.onClick(frameCS, "Link CLICK", |
295 |
|
new Object[]{ c, connectedFrom}); |
|
float[] bar = { 0,0,0 }; |
|
|
float [] foo= new float[3]; |
|
|
vs.coords.transformPoints3(frameCS, bar, foo); |
|
|
for (int i=0; i<foo.length; i++) { |
|
|
pa("CS: "+foo[i]); |
|
|
} |
|
|
|
|
|
final GLVobCoorder glc = (GLVobCoorder)vs.coords; |
|
|
float[] sqs = new float[2]; |
|
|
glc.getSqSize(frameCS, sqs); |
|
|
if (sqs[1] < 5) return; |
|
|
pa("size: Sqs frame: "+sqs[0]+" "+sqs[1]); |
|
|
|
|
|
|
|
296 |
|
|
297 |
// XXX Pan |
// XXX Pan |
298 |
int[] pan = getCoords(c); |
int[] pan = getCoords(c); |
300 |
-pan[0]*buoyZoom, -pan[1]*buoyZoom, buoyZoom, buoyZoom); |
-pan[0]*buoyZoom, -pan[1]*buoyZoom, buoyZoom, buoyZoom); |
301 |
vs.matcher.add(buoycs, c2fCS, "C2F"); |
vs.matcher.add(buoycs, c2fCS, "C2F"); |
302 |
|
|
|
|
|
303 |
buoyqueue.add(new Runnable() { |
buoyqueue.add(new Runnable() { |
304 |
public void run() { |
public void run() { |
305 |
buoy_vc.setAccursed(c); |
buoy_vc.setAccursed(c); |
321 |
this.window = w; |
this.window = w; |
322 |
this.coordinatePlaneView = new CoordinatePlaneView(d.contains, d.pan); |
this.coordinatePlaneView = new CoordinatePlaneView(d.contains, d.pan); |
323 |
this.ppactions = ppactions; |
this.ppactions = ppactions; |
324 |
pp_events = new PPEvents(ppactions); |
pp_events = new PPMouseEvents(this, ppactions, space); |
325 |
} |
} |
326 |
|
|
327 |
TextStyle style = GraphicsAPI.getInstance().getTextStyle("Sans", 0, 20); |
TextStyle style = GraphicsAPI.getInstance().getTextStyle("Sans", 0, 20); |
336 |
"LineWidth 2\nColor 0 0 0\nEnable TEXTURE_2D"); |
"LineWidth 2\nColor 0 0 0\nEnable TEXTURE_2D"); |
337 |
|
|
338 |
public void render(VobScene vs, int intoCS, ViewContext context) { |
public void render(VobScene vs, int intoCS, ViewContext context) { |
339 |
|
ev_handler.cleanCallers(); |
340 |
|
|
341 |
|
|
342 |
buoy_vc.setCellView(cellview); |
buoy_vc.setCellView(cellview); |
343 |
|
|
373 |
(-mainWidth)/2, -mainHeight/2, 1, 1, |
(-mainWidth)/2, -mainHeight/2, 1, 1, |
374 |
mainWidth, mainHeight); |
mainWidth, mainHeight); |
375 |
vs.activate(frameCS); |
vs.activate(frameCS); |
376 |
|
ev_handler.onClick(frameCS, "Click MAINVP", |
377 |
|
new Object[]{ new Integer(mainctr), new Integer(frameCS)} |
378 |
|
); |
379 |
|
ev_handler.onDrag(frameCS, "Drag MAINVP"); |
380 |
|
|
381 |
// cell to frame CS |
// cell to frame CS |
382 |
int c2fCS = vs.coords.ortho(0, 0, 0, 0, 10, 10); |
int c2fCS = vs.coords.ortho(0, 0, 0, 0, 10, 10); |
429 |
new_paper_button.getHeight(scale) + new_paper_button.getDepth(scale)); |
new_paper_button.getHeight(scale) + new_paper_button.getDepth(scale)); |
430 |
vs.activate(new_paper_button_frame); |
vs.activate(new_paper_button_frame); |
431 |
vs.map.put(new_paper_button, new_paper_button_cs); |
vs.map.put(new_paper_button, new_paper_button_cs); |
432 |
ev_handler.onClick(new_paper_button_frame, "Add new paper", null); |
ev_handler.onClick(new_paper_button_frame, "Add new paper"); |
433 |
|
|
434 |
// put the "Delete paper" -text |
// put the "Delete paper" -text |
435 |
TextVob delete_paper_button = new TextVob(style, "Tuhoa paperi"); |
TextVob delete_paper_button = new TextVob(style, "Tuhoa paperi"); |
442 |
delete_paper_button.getHeight(scale) + delete_paper_button.getDepth(scale)); |
delete_paper_button.getHeight(scale) + delete_paper_button.getDepth(scale)); |
443 |
vs.activate(delete_paper_button_frame); |
vs.activate(delete_paper_button_frame); |
444 |
vs.map.put(delete_paper_button, delete_paper_button_cs); |
vs.map.put(delete_paper_button, delete_paper_button_cs); |
445 |
ev_handler.onClick(delete_paper_button_frame, "Delete paper", null); |
ev_handler.onClick(delete_paper_button_frame, "Delete paper"); |
446 |
|
|
447 |
|
|
448 |
|
|
488 |
vs.matcher.add(ctr, fr, "frame"); |
vs.matcher.add(ctr, fr, "frame"); |
489 |
} |
} |
490 |
|
|
|
((DefaultVobMatcher)vs.matcher).dumpByParent(ctr); |
|
|
|
|
491 |
|
|
492 |
//vs.matcher.add(ctr, new Pair(p, null)); |
//vs.matcher.add(ctr, new Pair(p, null)); |
493 |
vs.matcher.add(ctr, new Pair(p, p)); |
vs.matcher.add(ctr, new Pair(p, p)); |
|
//vs.matcher.add(ctr, new Pair(p, new Cell(space, "dasfdsaffsa"))); |
|
|
//vs.matcher.add(ctr, p); |
|
494 |
vs.activate(fr); |
vs.activate(fr); |
495 |
|
ev_handler.onClick(fr, "Shortcut link", new Object[]{p}); |
496 |
|
|
497 |
|
|
498 |
int c2f = vs.coords.ortho(0, 11, 0, 0, |
int c2f = vs.coords.ortho(0, 11, 0, 0, |
499 |
leftPanelZoom, leftPanelZoom); |
leftPanelZoom, leftPanelZoom); |
500 |
vs.matcher.add(ctr, c2f, "C2F"); |
vs.matcher.add(ctr, c2f, "C2F"); |
501 |
|
|
|
pa(" ctr: "+ctr+ |
|
|
" fr: "+fr+ |
|
|
" c2f: "+c2f); |
|
|
|
|
502 |
buoy_vc.setAccursed(p); |
buoy_vc.setAccursed(p); |
503 |
buoy_singlePlane.render(vs, fr, c2f); |
buoy_singlePlane.render(vs, fr, c2f); |
504 |
p = p.s(d.d1); |
p = p.s(d.d1); |
505 |
|
|
506 |
i++; |
i++; |
507 |
} |
} |
|
pa("********************************************************"); |
|
508 |
//((DefaultVobMatcher)vs.matcher).dumbByParent(); |
//((DefaultVobMatcher)vs.matcher).dumbByParent(); |
509 |
} |
} |
510 |
|
|
537 |
(-linkbuoyVPWidth)/2, -linkbuoyVPHeight/2, 1, 1, |
(-linkbuoyVPWidth)/2, -linkbuoyVPHeight/2, 1, 1, |
538 |
linkbuoyVPWidth, linkbuoyVPHeight); |
linkbuoyVPWidth, linkbuoyVPHeight); |
539 |
vs.activate(frameCS); |
vs.activate(frameCS); |
540 |
|
ev_handler.onClick(frameCS, "Assoc link", |
541 |
|
new Object[]{otherNote, new Integer(dir)} ); |
542 |
|
|
543 |
int c2f = vs.coords.ortho(0, 0, |
int c2f = vs.coords.ortho(0, 0, |
544 |
-linkbuoyZoom*coords[0], -linkbuoyZoom*coords[1], |
-linkbuoyZoom*coords[0], -linkbuoyZoom*coords[1], |
567 |
*/ |
*/ |
568 |
public void setCursorToMain(VobScene vs, float x, float y, |
public void setCursorToMain(VobScene vs, float x, float y, |
569 |
AbstractViewContext context, int cs, int vp) { |
AbstractViewContext context, int cs, int vp) { |
570 |
|
/* |
571 |
float[] hit = new float[2]; |
float[] hit = new float[2]; |
572 |
int vobcs = vs.coords.getCSAt(cs, x, y, hit); |
int vobcs = vs.coords.getCSAt(cs, x, y, hit); |
573 |
if(vobcs < 0) { |
if(vobcs < 0) { |
593 |
} |
} |
594 |
context.setAccursed((Cell)k); |
context.setAccursed((Cell)k); |
595 |
context.setCursorOffset(style.getOffsetInText(((Cell)k).t(), 1, hit[0])); |
context.setCursorOffset(style.getOffsetInText(((Cell)k).t(), 1, hit[0])); |
596 |
|
*/ |
597 |
} |
} |
598 |
|
|
599 |
public Pair getMakeLinkOrSetCursor(VobScene vs, float x, float y, AbstractViewContext context) { |
public Pair getMakeLinkOrSetCursor(VobScene vs, float x, float y, AbstractViewContext context) { |
600 |
|
/* |
601 |
// First, get the frame that was hit. |
// First, get the frame that was hit. |
602 |
// This gives the "frame" coordsys. |
// This gives the "frame" coordsys. |
603 |
int cs = vs.coords.getCSAt(0, x, y, null); |
int cs = vs.coords.getCSAt(0, x, y, null); |
622 |
} |
} |
623 |
Pair p = (Pair)key; |
Pair p = (Pair)key; |
624 |
return p; |
return p; |
625 |
|
*/ |
626 |
|
return null; |
627 |
} |
} |
628 |
|
|
629 |
/** Set the cursor of the given view context to the clicked point. |
/** Set the cursor of the given view context to the clicked point. |
632 |
* DefaultVobMatcher.setKeyMap() method. |
* DefaultVobMatcher.setKeyMap() method. |
633 |
*/ |
*/ |
634 |
public Map setCursorTo(VobScene vs, float x, float y, AbstractViewContext context) { |
public Map setCursorTo(VobScene vs, float x, float y, AbstractViewContext context) { |
635 |
|
/* |
636 |
// First, get the frame that was hit. |
// First, get the frame that was hit. |
637 |
// This gives the "frame" coordsys. |
// This gives the "frame" coordsys. |
638 |
int cs = vs.coords.getCSAt(0, x, y, null); |
int cs = vs.coords.getCSAt(0, x, y, null); |
643 |
|
|
644 |
|
|
645 |
if(!"frame".equals(vs.matcher.getKey(cs))) { |
if(!"frame".equals(vs.matcher.getKey(cs))) { |
|
/* |
|
646 |
try { |
try { |
647 |
if ("new_paper_button_frame".equals(vs.matcher.getKey(cs)) ) { |
if ("new_paper_button_frame".equals(vs.matcher.getKey(cs)) ) { |
648 |
ppactions.newPaper(); |
ppactions.newPaper(); |
657 |
pa("WRONG KEY! "+vs.matcher.getKey(cs)); |
pa("WRONG KEY! "+vs.matcher.getKey(cs)); |
658 |
} |
} |
659 |
} catch (Exception e) { pa(e.getMessage()); } |
} catch (Exception e) { pa(e.getMessage()); } |
|
*/ |
|
|
|
|
660 |
return null; |
return null; |
661 |
} |
} |
662 |
|
|
663 |
|
|
664 |
// Get its parent |
// Get its parent |
665 |
int vp = ((GLVobCoorder)vs.coords).getParent(cs); |
int vp = ((GLVobCoorder)vs.coords).getParent(cs); |
666 |
Object key = vs.matcher.getKey(vp); |
Object key = vs.matcher.getKey(vp); |
727 |
return r; |
return r; |
728 |
} |
} |
729 |
|
|
730 |
|
|
731 |
if ("BuoyOnCircle".equals(((GLVobCoorder)vs.coords).getCoordSystemStr(vp))) { |
if ("BuoyOnCircle".equals(((GLVobCoorder)vs.coords).getCoordSystemStr(vp))) { |
732 |
|
|
733 |
pa("Buoy!!!"); |
pa("Buoy!!!"); |
757 |
// Change to paper which has been selected from the left panel. |
// Change to paper which has been selected from the left panel. |
758 |
((AbstractViewContext)context).setAccursed((Cell)p.first); |
((AbstractViewContext)context).setAccursed((Cell)p.first); |
759 |
} |
} |
760 |
return r; |
|
761 |
} |
return r; |
762 |
|
*/ |
763 |
|
return null; |
764 |
|
} |
765 |
} |
} |