12 |
|
|
13 |
import org.nongnu.libvob.*; |
import org.nongnu.libvob.*; |
14 |
import org.nongnu.libvob.impl.*; |
import org.nongnu.libvob.impl.*; |
15 |
|
import org.nongnu.libvob.impl.gl.*; |
16 |
import org.nongnu.libvob.buoy.*; |
import org.nongnu.libvob.buoy.*; |
17 |
import org.nongnu.libvob.vobs.*; |
import org.nongnu.libvob.vobs.*; |
18 |
|
|
29 |
|
|
30 |
public class Pp implements BuoyLinkListener { |
public class Pp implements BuoyLinkListener { |
31 |
public static final String rcsid = "$Id$"; |
public static final String rcsid = "$Id$"; |
32 |
public static final boolean dbg = true; |
public static final boolean dbg = false; |
33 |
protected static void p(String s) { if(dbg) pa(s); } |
protected static void p(String s) { if(dbg) pa(s); } |
34 |
protected static void pa(String s) { System.out.println("Pp::"+s); } |
protected static void pa(String s) { System.out.println("Pp::"+s); } |
35 |
|
|
229 |
|
|
230 |
public void link(int dir, int anchorCS, BuoyViewNodeType otherNode, |
public void link(int dir, int anchorCS, BuoyViewNodeType otherNode, |
231 |
Object linkId, Object otherAnchor) { |
Object linkId, Object otherAnchor) { |
232 |
pa("link!"); |
p("link!"); |
233 |
|
|
|
OrthoCoorder c = (OrthoCoorder)curVs.coords; |
|
234 |
int anchorUnit = curVs.unitSqCS(anchorCS, "UN"); |
int anchorUnit = curVs.unitSqCS(anchorCS, "UN"); |
235 |
int anchorCenter = curVs.translateCS(anchorUnit, "TR55", 0.5f, 0.5f); |
int anchorCenter = curVs.translateCS(anchorUnit, "TR55", 0.5f, 0.5f); |
236 |
float r = ctrY * 0.9f; |
float r = ctrY * 0.9f; |
239 |
float max = (curVs.size.height * focusSizeFactor) / 3; |
float max = (curVs.size.height * focusSizeFactor) / 3; |
240 |
|
|
241 |
int buoyCS; |
int buoyCS; |
242 |
if (dir < 0){ |
|
243 |
buoyCS = c.buoyOnCircle(focusCtr, anchorCenter, |
if (GraphicsAPI.getInstance() instanceof GLAPI) { |
244 |
ctrX, ctrY, r, |
GLVobCoorder c = (GLVobCoorder)curVs.coords; |
245 |
ctrX-r, ctrY, |
throw new Error("gl link not implemented!"); |
|
min, max); |
|
246 |
} else { |
} else { |
247 |
buoyCS = c.buoyOnCircle(focusCtr, anchorCenter, |
OrthoCoorder c = (OrthoCoorder)curVs.coords; |
248 |
ctrX, ctrY, r, |
if (dir < 0){ |
249 |
ctrX+r, ctrY, |
buoyCS = c.buoyOnCircle(focusCtr, anchorCenter, |
250 |
min, max); |
ctrX, ctrY, r, |
251 |
|
ctrX-r, ctrY, |
252 |
|
min, max); |
253 |
|
} else { |
254 |
|
buoyCS = c.buoyOnCircle(focusCtr, anchorCenter, |
255 |
|
ctrX, ctrY, r, |
256 |
|
ctrX+r, ctrY, |
257 |
|
min, max); |
258 |
|
} |
259 |
} |
} |
260 |
buoys.put(""+buoyCS, linkId); |
buoys.put(""+buoyCS, linkId); |
261 |
curVs.matcher.add(buoyCS, linkId); |
curVs.matcher.add(buoyCS, linkId); |
262 |
curVs.activate(buoyCS); |
curVs.activate(buoyCS); |
263 |
|
|
|
float[] fl = new float[3]; |
|
|
c.getSqSize(buoyCS, fl); |
|
|
|
|
264 |
adaptor.renderBuoy(curVs, buoyCS, linkId, otherAnchor, null); |
adaptor.renderBuoy(curVs, buoyCS, linkId, otherAnchor, null); |
265 |
|
|
266 |
//curVs.put(new RectBgVob(), buoyCS); |
//curVs.put(new RectBgVob(), buoyCS); |