/[gzz]/gzz/gzz/modules/pp2/PPCanvasNode.java
ViewVC logotype

Diff of /gzz/gzz/modules/pp2/PPCanvasNode.java

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

revision 1.3 by mudyc, Wed Feb 5 02:27:20 2003 UTC revision 1.4 by mudyc, Wed Feb 5 15:02:38 2003 UTC
# Line 33  import gzz.client.*; Line 33  import gzz.client.*;
33  /** XXX  /** XXX
34   */   */
35  public class PPCanvasNode implements CellBuoyViewNodeType {  public class PPCanvasNode implements CellBuoyViewNodeType {
36      private static final String rcsid = "$Id$";    private static final String rcsid = "$Id$";  
37      public static boolean dbg = false;      public static boolean dbg = false;
38      private static void pa(String s) { System.err.println(s); }      private static void pa(String s) { System.out.println("PPCanvasNode:"+s); }
39    
40      private PPDims d;      private PPDims d;
41      private AbstractViewContext avc;      private AbstractViewContext avc;
# Line 49  public class PPCanvasNode implements Cel Line 49  public class PPCanvasNode implements Cel
49      }      }
50    
51    
52        /** The zoom to be used for the buoys.
53         */
54        public float buoyZoom = 1;
55    
56        /** The zoom to be used for the link creation buoys.
57         */
58        public float linkbuoyZoom = .5f;
59    
60    
61    
62    
63      public boolean ownsCell(Cell c) {      public boolean ownsCell(Cell c) {
64          // XXX          // XXX
65          // how can I check that this is PP cell?          // how can I check that this is PP cell?
# Line 59  public class PPCanvasNode implements Cel Line 70  public class PPCanvasNode implements Cel
70      }      }
71    
72      public void renderBuoy(VobScene vs, int into, Cell c, Object content) {      public void renderBuoy(VobScene vs, int into, Cell c, Object content) {
73                    pa("Tee poiju!!!");
74    
75            vs.activate(into);
76            // XXX Pan
77            int[] pan = getCoords(c);
78            final int c2fCS =
79                vs.coords.ortho(0, 0,  -pan[0]*buoyZoom, -pan[1]*buoyZoom, buoyZoom, buoyZoom);
80            vs.matcher.add(into, c2fCS, "C2F");
81    
82            SinglePaper.i(avc,d,win).render(vs, into, c2fCS);
83      }      }
84    
85      public BuoyViewMainNode createMainNode(Cell c, Object content, CellPlacementHook hook) {      public BuoyViewMainNode createMainNode(Cell c, Object content, CellPlacementHook hook) {
86          return new PPCanvasCursor(c, avc, d, win);          return new PPCanvasCursor(c, avc, d, win);
87      }      }
88    
89        private int[] getCoords(Cell c) {
90            Cell firstCoord = c.s(d.pan);
91            if(firstCoord == null) return null;
92            return gzz.client.Params.getInts(firstCoord, d.pan, 2, null);
93        }
94    
95  }  }

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

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