/[fenfire]/fenfire/org/fenfire/view/CanvasView2D.java
ViewVC logotype

Diff of /fenfire/org/fenfire/view/CanvasView2D.java

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

revision 1.33 by tjl, Thu Oct 23 19:09:57 2003 UTC revision 1.34 by tjl, Wed Nov 5 10:25:53 2003 UTC
# Line 45  import java.util.*; Line 45  import java.util.*;
45    
46  /** A View2D of a CANVAS2D, with a given node function.  /** A View2D of a CANVAS2D, with a given node function.
47   */   */
48  public class CanvasView2D extends View2D implements org.fenfire.view.lava.FastView {// NodedView2D,{  public class CanvasView2D extends View2D
49        implements NodedView2D {
50      public static boolean dbg = false;      public static boolean dbg = false;
51      private static void p(String s) { System.out.println("CanvasView2D:: "+s); }      private static void p(String s) { System.out.println("CanvasView2D:: "+s); }
52            
# Line 72  public class CanvasView2D extends View2D Line 73  public class CanvasView2D extends View2D
73          return null;          return null;
74      }      }
75    
76        public View2D getContentView2D() { return this; }
77    
78      public void render(VobScene vs, Object container,      public void render(VobScene vs, Object container,
79                         int matchingParent, int box2screen, int box2plane)                         int matchingParent, int box2screen, int box2plane)
# Line 122  public class CanvasView2D extends View2D Line 124  public class CanvasView2D extends View2D
124              }              }
125              p.place(vs, cs);              p.place(vs, cs);
126          }          }
127          chgFast(vs, box2screen);          chgFast(vs, container, matchingParent, box2screen, box2plane);
128    
129                    
130          // [mudyc] thinks that something which knows          // [mudyc] thinks that something which knows
# Line 168  public class CanvasView2D extends View2D Line 170  public class CanvasView2D extends View2D
170          return containerCS;          return containerCS;
171      }      }
172    
173      public void chgFast(VobScene oldVS, int parent) {      public void chgFast(VobScene oldVS, Object container,
174          int containerCS = getContainerCS(oldVS, parent);                          int matchingParent, int box2screen, int box2plane) {
175            int containerCS = getContainerCS(oldVS, box2screen);
176    
177          DefaultVobMatcher m = (DefaultVobMatcher)oldVS.matcher;          DefaultVobMatcher m = (DefaultVobMatcher)oldVS.matcher;
178          for(Iterator i=m.getKeys(containerCS).iterator(); i.hasNext();) {          for(Iterator i=m.getKeys(containerCS).iterator(); i.hasNext();) {
# Line 197  public class CanvasView2D extends View2D Line 200  public class CanvasView2D extends View2D
200      }      }
201    
202      public int getNodeCS(VobScene oldvs,      public int getNodeCS(VobScene oldvs,
203                      int x, int y,                           int x, int y,
204                      Object plane, int matchingParent,                           Object plane, int matchingParent,
205                      int box2screen, int box2plane,                           int box2screen, int box2plane,
206                      float[] xyout) {                           float[] xyout) {
207          return oldvs.getCSAt(box2screen, x, y, xyout);          return oldvs.getCSAt(box2screen, x, y, xyout);
208      }      }
209    
210      public int getNodeCS(VobScene oldVS,      public int getNodeCS(VobScene oldVS,
211                           Object node,                           Object node,
212                           Object plane, int matchingParent,                           Object plane, int matchingParent,
213                           int box2screen, int box2plane,                           int box2screen, int box2plane) {
                          float[] xyout) {  
214          int containerCS = getContainerCS(oldVS, box2screen);          int containerCS = getContainerCS(oldVS, box2screen);
215          int cs = oldVS.matcher.getCS(containerCS, node);          int cs = oldVS.matcher.getCS(containerCS, node);
216          if (cs < 1) throw new Error(cs+" is not possible!");          if (cs < 1) throw new Error(cs+" is not possible!");
217          return cs;          return cs;
218      }      }
219    
220        public Object getNode(VobScene oldVS, int cs) {
221            if (cs < 1) throw new Error(cs+" is not possible!");
222            return oldVS.matcher.getKey(cs);
223        }
224    
225    
226      static public boolean hasCanvas(ConstGraph g, Object node) {      static public boolean hasCanvas(ConstGraph g, Object node) {

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

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