38 |
/** A BuoyViewNodeType showing areas of 2D planes rendered through |
/** A BuoyViewNodeType showing areas of 2D planes rendered through |
39 |
* a View2D. |
* a View2D. |
40 |
*/ |
*/ |
41 |
public class NodeType2D implements BuoyViewNodeType { |
public class NodeType2D extends AbstractNodeType2D { |
42 |
public static boolean dbg = false; |
public static boolean dbg = false; |
43 |
private static void pa(String s) { System.out.println(s); } |
private static void pa(String s) { System.out.println(s); } |
44 |
|
|
45 |
public static int effigy = 0; |
public static int effigy = 0; |
46 |
|
|
|
protected View2D view2d; |
|
|
|
|
|
public View2D getView2D() { return view2d; } |
|
47 |
|
|
48 |
public NodeType2D(View2D view2d) { |
public NodeType2D(View2D view2d) { |
49 |
this.view2d = view2d; |
super(view2d); |
50 |
} |
} |
51 |
|
|
52 |
public Object getSize(Object linkId, Object anchor, |
public Object getSize(Object linkId, Object anchor, |
63 |
if(effigy != 0) { |
if(effigy != 0) { |
64 |
Vob eff = org.nongnu.libvob.gl.GLRen.createQuad(effigy-1); |
Vob eff = org.nongnu.libvob.gl.GLRen.createQuad(effigy-1); |
65 |
vs.map.put( eff, into); |
vs.map.put( eff, into); |
|
//vs.map.put(new org.nongnu.libvob.vobs.RectBgVob( |
|
|
// Color.green, true, Color.black), into); |
|
66 |
return into; |
return into; |
67 |
} |
} |
68 |
Pair p = (Pair)anchor; |
Pair p = (Pair)anchor; |
83 |
// int box2paper = vs.coords.orthoBox(0, 0, 0, 0, |
// int box2paper = vs.coords.orthoBox(0, 0, 0, 0, |
84 |
// 1, 1, |
// 1, 1, |
85 |
// w, h); |
// w, h); |
86 |
vs.matcher.add(into, box2paper, "BUOYPAP"); |
vs.matcher.add(into, box2paper, "BOX2PAPER"); |
87 |
|
|
88 |
view2d.render(vs, plane, into, into, box2paper); |
view2d.render(vs, plane, into, into, box2paper); |
89 |
|
|
90 |
return vs.coords.translate(into, w/2f, h/2f); |
return vs.coords.translate(into, w/2f, h/2f); |
91 |
} |
} |
|
|
|
|
public BuoyViewMainNode createMainNode(Object linkId, |
|
|
Object anchor) { |
|
|
Pair p = (Pair)anchor; |
|
|
Object plane = p.first; |
|
|
Rectangle rect = (Rectangle)p.second; |
|
|
|
|
|
return new MainNode2D(plane, view2d, |
|
|
rect.x+rect.width/2f, |
|
|
rect.y+rect.height/2f, 1); |
|
|
} |
|
92 |
} |
} |