/[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.2 by tjl, Fri Apr 25 14:43:04 2003 UTC revision 1.3 by tjl, Sat Apr 26 08:31:41 2003 UTC
# Line 32  import org.nongnu.libvob.impl.DefaultVob Line 32  import org.nongnu.libvob.impl.DefaultVob
32  import org.nongnu.libvob.buoy.*;  import org.nongnu.libvob.buoy.*;
33    
34  import java.awt.Rectangle;  import java.awt.Rectangle;
35    import java.awt.Color;
36  import java.awt.event.MouseEvent;  import java.awt.event.MouseEvent;
37    
38  /** A BuoyViewNodeType showing areas of 2D planes rendered through  /** A BuoyViewNodeType showing areas of 2D planes rendered through
# Line 40  import java.awt.event.MouseEvent; Line 41  import java.awt.event.MouseEvent;
41  public class NodeType2D implements BuoyViewNodeType {  public class NodeType2D implements BuoyViewNodeType {
42      public static boolean dbg = false;      public static boolean dbg = false;
43      private static void pa(String s) { System.out.println(s); }      private static void pa(String s) { System.out.println(s); }
44    
45        public static int effigy = 0;
46            
47      protected View2D view;      protected View2D view;
48    
# Line 60  public class NodeType2D implements BuoyV Line 63  public class NodeType2D implements BuoyV
63    
64      public int renderBuoy(VobScene vs, int into, Object linkId,      public int renderBuoy(VobScene vs, int into, Object linkId,
65                            Object anchor, Object cachedSize) {                            Object anchor, Object cachedSize) {
66            if(effigy != 0) {
67                Vob eff = org.nongnu.libvob.gl.GLRen.createQuad(effigy-1);
68                vs.map.put( eff, into);
69                //vs.map.put(new org.nongnu.libvob.vobs.RectBgVob(
70            //              Color.green, true, Color.black), into);
71                return into;
72            }
73          Pair p = (Pair)anchor;          Pair p = (Pair)anchor;
74          Object plane = p.first;          Object plane = p.first;
75          Rectangle rect = (Rectangle)p.second;          Rectangle rect = (Rectangle)p.second;
# Line 72  public class NodeType2D implements BuoyV Line 82  public class NodeType2D implements BuoyV
82          float scale = w / rect.width;          float scale = w / rect.width;
83          if(scale < h / rect.height) scale = h / rect.height;          if(scale < h / rect.height) scale = h / rect.height;
84    
85          int box2paper = vs.coords.orthoBox(0, 0, rect.x, rect.y,  ///     int box2paper = vs.coords.orthoBox(0, 0, rect.x, rect.y,
86                                             scale, scale,  ///                                        1/scale, 1/scale,
87    ///                                        w, h);
88            int box2paper = vs.coords.orthoBox(0, 0, 0, 0,
89                                               1, 1,
90                                             w, h);                                             w, h);
91          vs.matcher.add(into, box2paper, "BUOYPAP");          vs.matcher.add(into, box2paper, "BUOYPAP");
92    
93          view.render(vs, plane, into, into, box2paper);          view.render(vs, plane, into, into, box2paper);
94    
95          return vs.coords.translate(into, w/2f, h/2f);          return vs.coords.translate(into, w/2f, h/2f);
96      }      }
97    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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