26 |
*/ |
*/ |
27 |
package org.fenfire.view.buoy; |
package org.fenfire.view.buoy; |
28 |
import org.fenfire.view.View2D; |
import org.fenfire.view.View2D; |
29 |
|
import org.fenfire.view.NodedView2D; |
30 |
import org.fenfire.util.Pair; |
import org.fenfire.util.Pair; |
31 |
import org.nongnu.libvob.*; |
import org.nongnu.libvob.*; |
32 |
import org.nongnu.libvob.impl.DefaultVobMatcher; |
import org.nongnu.libvob.impl.DefaultVobMatcher; |
53 |
public Object getSize(Object linkId, Object anchor, |
public Object getSize(Object linkId, Object anchor, |
54 |
float wh[]) { |
float wh[]) { |
55 |
Pair p = (Pair)anchor; |
Pair p = (Pair)anchor; |
56 |
Rectangle rect = (Rectangle)p.second; |
Pair q = (Pair)p.second; |
57 |
|
Rectangle rect = (Rectangle)q.first; |
58 |
wh[0] = rect.width; |
wh[0] = rect.width; |
59 |
wh[1] = rect.height; |
wh[1] = rect.height; |
60 |
return null; |
return null; |
70 |
} |
} |
71 |
Pair p = (Pair)anchor; |
Pair p = (Pair)anchor; |
72 |
Object plane = p.first; |
Object plane = p.first; |
|
Rectangle rect = (Rectangle)p.second; |
|
73 |
|
|
74 |
|
Pair q = (Pair)p.second; |
75 |
|
Rectangle rect = (Rectangle)q.first; |
76 |
|
Object node = q.second; // may be null if this |
77 |
|
// is not a noded View2D |
78 |
|
|
79 |
float[] tmp = new float[2]; |
float[] tmp = new float[2]; |
80 |
vs.coords.getSqSize(into, tmp); |
vs.coords.getSqSize(into, tmp); |
81 |
float w = tmp[0], h = tmp[1]; |
float w = tmp[0], h = tmp[1]; |
95 |
view2d.render(vs, plane, into, into, box2paper); |
view2d.render(vs, plane, into, into, box2paper); |
96 |
|
|
97 |
if (dbg) pa("start renderBuoy..DONE"); |
if (dbg) pa("start renderBuoy..DONE"); |
98 |
return vs.coords.unitSq(into); |
|
99 |
|
int box = node==null ? into : vs.matcher.getCS(into, new Pair(plane, node)); |
100 |
|
return vs.coords.unitSq(box); |
101 |
} |
} |
102 |
} |
} |