/[fenfire]/fenfire/org/fenfire/view/buoy/NodeType2D.java
ViewVC logotype

Diff of /fenfire/org/fenfire/view/buoy/NodeType2D.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by tjl, Wed Jul 30 12:52:33 2003 UTC revision 1.15 by mudyc, Thu Jul 31 10:08:05 2003 UTC
# Line 26  NodeType2D.java Line 26  NodeType2D.java
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.CanvasView2D;
30  import org.fenfire.view.NodedView2D;  import org.fenfire.view.NodedView2D;
31  import org.fenfire.util.Pair;  import org.fenfire.util.Pair;
32  import org.fenfire.util.Triple;  import org.fenfire.util.Triple;
# Line 42  import java.awt.event.MouseEvent; Line 43  import java.awt.event.MouseEvent;
43   */   */
44  public class NodeType2D extends AbstractNodeType2D {  public class NodeType2D extends AbstractNodeType2D {
45      public static boolean dbg = false;      public static boolean dbg = false;
46      private static void pa(String s) { System.out.println("NodeType2D:: "+s); }      private static void p(String s) { System.out.println("NodeType2D:: "+s); }
47    
48      public static int effigy = 0;      public static int effigy = 0;
49            
# Line 61  public class NodeType2D extends Abstract Line 62  public class NodeType2D extends Abstract
62    
63      public int renderBuoy(VobScene vs, int into, Object linkId,      public int renderBuoy(VobScene vs, int into, Object linkId,
64                            Object a, Object cachedSize) {                            Object a, Object cachedSize) {
65          if (dbg) pa("start renderBuoy");          if (dbg) p("start renderBuoy");
66          if(effigy != 0) {          if(effigy != 0) {
67              Vob eff = org.nongnu.libvob.gl.GLRen.createQuad(effigy-1, 0,0);              Vob eff = org.nongnu.libvob.gl.GLRen.createQuad(effigy-1, 0,0);
68              vs.map.put( eff, into);              vs.map.put( eff, into);
# Line 72  public class NodeType2D extends Abstract Line 73  public class NodeType2D extends Abstract
73          float[] tmp = new float[2];          float[] tmp = new float[2];
74          vs.coords.getSqSize(into, tmp);          vs.coords.getSqSize(into, tmp);
75          float w = tmp[0], h = tmp[1];          float w = tmp[0], h = tmp[1];
76          if (dbg) pa("rect "+anchor+" coords "+w+","+h);          if (dbg) p("rect "+anchor+" coords "+w+","+h);
77    
78          float scale = w / anchor.w;          float scale = w / anchor.w;
79          if(scale < h / anchor.h) scale = h / anchor.h;          if(scale < h / anchor.h) scale = h / anchor.h;
# Line 87  public class NodeType2D extends Abstract Line 88  public class NodeType2D extends Abstract
88    
89          view2d.render(vs, anchor.plane, into, into, box2paper);          view2d.render(vs, anchor.plane, into, into, box2paper);
90    
91          if (dbg) pa("start renderBuoy..DONE");          if (dbg) p("start renderBuoy..DONE");
92    
93          // anchor.node may be null if this          // anchor.node may be null if this
94          // is not a noded View2D          // is not a noded View2D
95                    
96          int box = anchor.node==null          int box = into;
97                      ?  into          if (anchor.node != null ) {
98                      : vs.matcher.getCS(into,              int containerCS = CanvasView2D.getContainerCS(vs, into);
99                              new Pair(anchor.plane, anchor.node));              box = vs.matcher.getCS(containerCS, anchor.node);
100                if (dbg) p("box is: "+box);
101            }
102            if (box < 0) {
103                box = into;
104                throw new Error("Heyhey boys!! this doesn't work!");
105            }
106          return vs.coords.unitSq(box);          return vs.coords.unitSq(box);
107      }      }
108  }  }

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26