//(c): Matti Katila package org.fenfire.modules.pp; import org.nongnu.libvob.*; import org.nongnu.libvob.gl.*; import org.nongnu.libvob.util.ColorUtil; import java.awt.*; /** A vob which is a rectangular background and frame. * Draws a filled (possibly with several colors) background rectangle, * surrounded by a rectangle of the current foreground color. */ public class UniquePaperVob extends Vob { public static final String rcsid = "$Id: UniquePaperVob.java,v 1.1 2003/03/31 12:37:47 mudyc Exp $"; public static boolean dbg = false; private static void pa(String s) { System.err.println(s); } private final Object uniqId; public UniquePaperVob(Object uniqId) { this.uniqId = uniqId; } public void render(Graphics g, boolean fast, Vob.RenderInfo info1, Vob.RenderInfo info2) { Shape oldClip = g.getClip(); Color oldfg = g.getColor(); Rectangle rect = new Rectangle(); Rectangle geom = new Rectangle(); info1.getExtRect(rect); g.setClip(rect.x, rect.y, rect.width, rect.height); int mx = rect.x, my=rect.y, mw = rect.width, mh = rect.height; info2.getExtRect(geom); int panx = geom.width, pany = geom.height; pa("mx: "+mx+", gx: "+geom.x+", panx: "+panx+", pany: "+pany); float zoom = ((float)(geom.x - mx))/100000; int gx = geom.x; pa("Zoom: "+zoom); g.setColor(Color.orange); g.fillRect(mx, my, mw, mh); int x = panx + mx + mw/4, y = pany + my + mh/4, w = (int)((float)mw)/2, h = (int)((float)mh)/2; pa("x"+x+"y"+y+"w"+w+"h"+h); g.setColor(Color.gray); g.fillRect(x, y, w, h); g.setColor(oldfg); g.setClip(oldClip); } Vob glList; public int putGL(VobScene vs, int coordsys1) { /* if(dbg) pa("Addtolistgl rectbg "+coordsys1); if(glList == null) { String bgcall = ""; if(colors != null && NColors > 0) { double w = 1.0 / NColors; for(int i=0; i