// (c): Matti J. Katila package org.fenfire.view; import org.fenfire.view.lava.*; import org.nongnu.libvob.*; import org.nongnu.libvob.gl.*; /** View2D to draw the selecting area */ public class AreaSelectingView2D extends View2D { public static boolean dbg = false; private static void pa(String s) { System.out.println("AreaSelectingView2D:: "+s); } public View2D getChildView2D() { return child; } protected View2D child; private float x0,y0,x1,y1; public void setArea(float x0, float y0, float x1, float y1) { this.x0 = x0; this.y0 = y0; this.x1 = x1; this.y1 = y1; } private Paper paper; private GLRen.FixedPaperQuad pq; public AreaSelectingView2D(View2D child) { this.child = child; setArea(0,0,0,0); paper = SpecialPapers.solidPaper(java.awt.Color.red); pq = GLRen.createFixedPaperQuad(paper, 0, 0, 1, 1, 0, 10, 10, 10); } public void render(VobScene vs, Object plane, int matchingParent, int box2screen, int box2paper) { int cs = vs.orthoCS(box2paper, "foo", 0, x0,y0,x1,y1); vs.put(pq, cs); } public void getSize(Object plane, float[] wh) { if(child != null) child.getSize(plane, wh); else { wh[0] = -1; wh[1] = -1; } } }