45 |
|
|
46 |
/** A View2D of a CANVAS2D, with a given node function. |
/** A View2D of a CANVAS2D, with a given node function. |
47 |
*/ |
*/ |
48 |
public class CanvasView2D extends View2D implements org.fenfire.view.lava.FastView {// NodedView2D,{ |
public class CanvasView2D extends View2D |
49 |
|
implements NodedView2D { |
50 |
public static boolean dbg = false; |
public static boolean dbg = false; |
51 |
private static void p(String s) { System.out.println("CanvasView2D:: "+s); } |
private static void p(String s) { System.out.println("CanvasView2D:: "+s); } |
52 |
|
|
73 |
return null; |
return null; |
74 |
} |
} |
75 |
|
|
76 |
|
public View2D getContentView2D() { return this; } |
77 |
|
|
78 |
public void render(VobScene vs, Object container, |
public void render(VobScene vs, Object container, |
79 |
int matchingParent, int box2screen, int box2plane) |
int matchingParent, int box2screen, int box2plane) |
124 |
} |
} |
125 |
p.place(vs, cs); |
p.place(vs, cs); |
126 |
} |
} |
127 |
chgFast(vs, box2screen); |
chgFast(vs, container, matchingParent, box2screen, box2plane); |
128 |
|
|
129 |
|
|
130 |
// [mudyc] thinks that something which knows |
// [mudyc] thinks that something which knows |
170 |
return containerCS; |
return containerCS; |
171 |
} |
} |
172 |
|
|
173 |
public void chgFast(VobScene oldVS, int parent) { |
public void chgFast(VobScene oldVS, Object container, |
174 |
int containerCS = getContainerCS(oldVS, parent); |
int matchingParent, int box2screen, int box2plane) { |
175 |
|
int containerCS = getContainerCS(oldVS, box2screen); |
176 |
|
|
177 |
DefaultVobMatcher m = (DefaultVobMatcher)oldVS.matcher; |
DefaultVobMatcher m = (DefaultVobMatcher)oldVS.matcher; |
178 |
for(Iterator i=m.getKeys(containerCS).iterator(); i.hasNext();) { |
for(Iterator i=m.getKeys(containerCS).iterator(); i.hasNext();) { |
200 |
} |
} |
201 |
|
|
202 |
public int getNodeCS(VobScene oldvs, |
public int getNodeCS(VobScene oldvs, |
203 |
int x, int y, |
int x, int y, |
204 |
Object plane, int matchingParent, |
Object plane, int matchingParent, |
205 |
int box2screen, int box2plane, |
int box2screen, int box2plane, |
206 |
float[] xyout) { |
float[] xyout) { |
207 |
return oldvs.getCSAt(box2screen, x, y, xyout); |
return oldvs.getCSAt(box2screen, x, y, xyout); |
208 |
} |
} |
209 |
|
|
210 |
public int getNodeCS(VobScene oldVS, |
public int getNodeCS(VobScene oldVS, |
211 |
Object node, |
Object node, |
212 |
Object plane, int matchingParent, |
Object plane, int matchingParent, |
213 |
int box2screen, int box2plane, |
int box2screen, int box2plane) { |
|
float[] xyout) { |
|
214 |
int containerCS = getContainerCS(oldVS, box2screen); |
int containerCS = getContainerCS(oldVS, box2screen); |
215 |
int cs = oldVS.matcher.getCS(containerCS, node); |
int cs = oldVS.matcher.getCS(containerCS, node); |
216 |
if (cs < 1) throw new Error(cs+" is not possible!"); |
if (cs < 1) throw new Error(cs+" is not possible!"); |
217 |
return cs; |
return cs; |
218 |
} |
} |
219 |
|
|
220 |
|
public Object getNode(VobScene oldVS, int cs) { |
221 |
|
if (cs < 1) throw new Error(cs+" is not possible!"); |
222 |
|
return oldVS.matcher.getKey(cs); |
223 |
|
} |
224 |
|
|
225 |
|
|
226 |
static public boolean hasCanvas(ConstGraph g, Object node) { |
static public boolean hasCanvas(ConstGraph g, Object node) { |