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

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

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

revision 1.23 by benja, Sun Jun 8 12:22:11 2003 UTC revision 1.24 by benja, Mon Jun 9 19:03:13 2003 UTC
# Line 51  public class MainNode2D extends Abstract Line 51  public class MainNode2D extends Abstract
51              this.zoom = zoom;              this.zoom = zoom;
52          }          }
53          public AbstractMainNode2D create(Object plane, View2D view2d,          public AbstractMainNode2D create(Object plane, View2D view2d,
54                      float panx, float pany) {                                           float panx, float pany) {
55              return new MainNode2D(plane, view2d, panx, pany, zoom);              return new MainNode2D(plane, view2d,
56                                      new SimpleFocus(panx, pany), zoom);
57          }          }
58      }      }
59    
60      /** Create a main node with a given plane, pan, and zoom.      /** Create a main node with a given plane, pan, and zoom.
61       */       */
62      public MainNode2D(Object plane, View2D view2d,      public MainNode2D(Object plane, View2D view2d,
63                        float panX, float panY, float zoom) {                     Focus focus, float zoom) {
64          super(plane, view2d, panX, panY);          super(plane, view2d, focus);
65          this.zoom = zoom;          this.zoom = zoom;
66      }      }
67            
68      /** Create a main node focused the center of a given plane.      /** Create a main node focused the center of a given plane.
69       */       */
70      public MainNode2D(Object plane, View2D view2d) {      public MainNode2D(Object plane, View2D view2d) {
71          this(plane, view2d, 0, 0, 1);          this(plane, view2d, new SimpleFocus(0, 0), 1);
72          view2d.getSize(plane, tmp);          view2d.getSize(plane, tmp);
73          if(tmp[0] >= 0) {          if(tmp[0] >= 0) {
74              panX = tmp[0] / 2f;              focus.setPan(tmp[0] / 2f, tmp[1] / 2f);
             panY = tmp[1] / 2f;  
75          }          }
76      }      }
77    
# Line 91  public class MainNode2D extends Abstract Line 91  public class MainNode2D extends Abstract
91    
92      protected void setZoomPan(VobScene vs, int mainFrame) {      protected void setZoomPan(VobScene vs, int mainFrame) {
93          vs.coords.setOrthoBoxParams(box2paper, 0,          vs.coords.setOrthoBoxParams(box2paper, 0,
94                          panX-boxw/zoom/2, panY-boxh/zoom/2,                          focus.getPanX()-boxw/zoom/2, focus.getPanY()-boxh/zoom/2,
95                                      1/zoom, 1/zoom, boxw, boxh);                                      1/zoom, 1/zoom, boxw, boxh);
96      }      }
97    

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

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