33 |
/** XXX |
/** XXX |
34 |
*/ |
*/ |
35 |
public class PPCanvasNode implements CellBuoyViewNodeType { |
public class PPCanvasNode implements CellBuoyViewNodeType { |
36 |
private static final String rcsid = "$Id$"; |
private static final String rcsid = "$Id$"; |
37 |
public static boolean dbg = false; |
public static boolean dbg = false; |
38 |
private static void pa(String s) { System.err.println(s); } |
private static void pa(String s) { System.out.println("PPCanvasNode:"+s); } |
39 |
|
|
40 |
private PPDims d; |
private PPDims d; |
41 |
private AbstractViewContext avc; |
private AbstractViewContext avc; |
49 |
} |
} |
50 |
|
|
51 |
|
|
52 |
|
/** The zoom to be used for the buoys. |
53 |
|
*/ |
54 |
|
public float buoyZoom = 1; |
55 |
|
|
56 |
|
/** The zoom to be used for the link creation buoys. |
57 |
|
*/ |
58 |
|
public float linkbuoyZoom = .5f; |
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
public boolean ownsCell(Cell c) { |
public boolean ownsCell(Cell c) { |
64 |
// XXX |
// XXX |
65 |
// how can I check that this is PP cell? |
// how can I check that this is PP cell? |
70 |
} |
} |
71 |
|
|
72 |
public void renderBuoy(VobScene vs, int into, Cell c, Object content) { |
public void renderBuoy(VobScene vs, int into, Cell c, Object content) { |
73 |
|
pa("Tee poiju!!!"); |
74 |
|
|
75 |
|
vs.activate(into); |
76 |
|
// XXX Pan |
77 |
|
int[] pan = getCoords(c); |
78 |
|
final int c2fCS = |
79 |
|
vs.coords.ortho(0, 0, -pan[0]*buoyZoom, -pan[1]*buoyZoom, buoyZoom, buoyZoom); |
80 |
|
vs.matcher.add(into, c2fCS, "C2F"); |
81 |
|
|
82 |
|
SinglePaper.i(avc,d,win).render(vs, into, c2fCS); |
83 |
} |
} |
84 |
|
|
85 |
public BuoyViewMainNode createMainNode(Cell c, Object content, CellPlacementHook hook) { |
public BuoyViewMainNode createMainNode(Cell c, Object content, CellPlacementHook hook) { |
86 |
return new PPCanvasCursor(c, avc, d, win); |
return new PPCanvasCursor(c, avc, d, win); |
87 |
} |
} |
88 |
|
|
89 |
|
private int[] getCoords(Cell c) { |
90 |
|
Cell firstCoord = c.s(d.pan); |
91 |
|
if(firstCoord == null) return null; |
92 |
|
return gzz.client.Params.getInts(firstCoord, d.pan, 2, null); |
93 |
|
} |
94 |
|
|
95 |
} |
} |