29 |
import org.fenfire.*; |
import org.fenfire.*; |
30 |
import org.fenfire.view.*; |
import org.fenfire.view.*; |
31 |
import org.fenfire.view.buoy.*; |
import org.fenfire.view.buoy.*; |
|
import org.fenfire.view.lava.FastView; |
|
32 |
import org.fenfire.vocab.*; |
import org.fenfire.vocab.*; |
33 |
import org.fenfire.swamp.*; |
import org.fenfire.swamp.*; |
34 |
import org.fenfire.util.*; |
import org.fenfire.util.*; |
|
import org.fenfire.util.lava.*; |
|
35 |
import org.nongnu.libvob.*; |
import org.nongnu.libvob.*; |
36 |
import org.nongnu.libvob.gl.*; |
import org.nongnu.libvob.gl.*; |
37 |
import org.nongnu.libvob.impl.gl.*; |
import org.nongnu.libvob.impl.gl.*; |
38 |
import org.nongnu.libvob.buoy.*; |
import org.nongnu.libvob.buoy.*; |
39 |
import org.nongnu.libvob.vobs.SimpleConnection; |
import org.nongnu.libvob.vobs.SimpleConnection; |
|
import org.nongnu.libvob.lava.placeable.Placeable; |
|
40 |
import org.nongnu.alph.*; |
import org.nongnu.alph.*; |
41 |
|
|
42 |
import java.util.*; |
import java.util.*; |
43 |
|
|
44 |
/** A View2D of a CANVAS2D, with a given node function. |
/** A View2D of a CANVAS2D, with a given node function. |
45 |
*/ |
*/ |
46 |
public class CanvasView2D extends View2D implements NodedView2D, FastView { |
public class CanvasView2D extends View2D implements NodedView2D, org.fenfire.view.lava.FastView { |
47 |
public static final String rcsid = "$Id$"; |
public static final String rcsid = "$Id$"; |
48 |
public static boolean dbg = false; |
public static boolean dbg = false; |
49 |
private static void pa(String s) { System.out.println("CanvasView2D::"+s); } |
private static void pa(String s) { System.out.println("CanvasView2D::"+s); } |
69 |
|
|
70 |
//private Object container; |
//private Object container; |
71 |
private int paper2screen = -1; |
private int paper2screen = -1; |
72 |
private CoordsysCache coords = new CoordsysCache(); |
private org.fenfire.util.lava.CoordsysCache coords = |
73 |
|
new org.fenfire.util.lava.CoordsysCache(); |
74 |
private Map containers = new HashMap(10); |
private Map containers = new HashMap(10); |
75 |
|
|
76 |
public void render(VobScene vs, Object container, |
public void render(VobScene vs, Object container, |
92 |
//nodes.clear(); |
//nodes.clear(); |
93 |
while (iter.hasNext()) { |
while (iter.hasNext()) { |
94 |
Object n = iter.next(); |
Object n = iter.next(); |
95 |
Placeable p = (Placeable)nodeView.f(fen.constgraph, n); |
org.nongnu.libvob.lava.placeable.Placeable p = |
96 |
|
(org.nongnu.libvob.lava.placeable.Placeable)nodeView.f(fen.constgraph, n); |
97 |
Pair matchKey = new Pair(container, n); |
Pair matchKey = new Pair(container, n); |
98 |
|
|
99 |
int cs = vs.coords.orthoBox(paper2screen, 0,1,2,3,4,5,6); |
int cs = vs.coords.orthoBox(paper2screen, 0,1,2,3,4,5,6); |
142 |
float x = RDFUtil.getFloat(fen.graph, n, CANVAS2D.x); |
float x = RDFUtil.getFloat(fen.graph, n, CANVAS2D.x); |
143 |
float y = RDFUtil.getFloat(fen.graph, n, CANVAS2D.y); |
float y = RDFUtil.getFloat(fen.graph, n, CANVAS2D.y); |
144 |
|
|
145 |
Placeable p = (Placeable)nodeView.f(fen.constgraph, n); |
org.nongnu.libvob.lava.placeable.Placeable p = |
146 |
|
(org.nongnu.libvob.lava.placeable.Placeable)nodeView |
147 |
|
.f(fen.constgraph, n); |
148 |
|
|
149 |
// int cs = vs.coords.translate(paper2screen, x, y); |
// int cs = vs.coords.translate(paper2screen, x, y); |
150 |
if(dbg) pa("CANVAS: "+p.getWidth()+" "+p.getHeight()); |
if(dbg) pa("CANVAS: "+p.getWidth()+" "+p.getHeight()); |