/[fenfire]/fenfire/org/fenfire/modules/pp/PPCanvasNode.java
ViewVC logotype

Diff of /fenfire/org/fenfire/modules/pp/PPCanvasNode.java

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

revision 1.2 by mudyc, Wed Mar 26 14:00:24 2003 UTC revision 1.3 by mudyc, Thu Mar 27 10:42:37 2003 UTC
# Line 1  Line 1 
1  //(c): Matti J. Katila  //(c): Matti J. Katila
2    
3  package org.fenfire.modules.pp;  package org.fenfire.modules.pp;
4    import org.fenfire.*;
5    import org.fenfire.impl.*;
6    //import org.fenfire.vocab.*;
7  import org.fenfire.vocab.*;  import org.fenfire.vocab.*;
8  import org.fenfire.util.*;  import org.fenfire.util.*;
9  import org.fenfire.view.*;  import org.fenfire.view.*;
10  import org.fenfire.view.buoy.*;  import org.fenfire.view.buoy.*;
11  import org.nongnu.libvob.*;  import org.nongnu.libvob.*;
12  import org.nongnu.libvob.buoy.*;  import org.nongnu.libvob.buoy.*;
13    
14    import org.nongnu.storm.*;
15    import org.nongnu.alph.*;
16    import org.nongnu.alph.impl.*;
17    
18  import com.hp.hpl.mesa.rdf.jena.model.*;  import com.hp.hpl.mesa.rdf.jena.model.*;
19  import com.hp.hpl.mesa.rdf.jena.common.*;  import com.hp.hpl.mesa.rdf.jena.common.*;
20  import com.hp.hpl.mesa.rdf.jena.vocabulary.*;  import com.hp.hpl.mesa.rdf.jena.vocabulary.*;
# Line 16  private static final String rcsid = "$Id Line 24  private static final String rcsid = "$Id
24      public static boolean dbg = false;      public static boolean dbg = false;
25      private static void pa(String s) { System.out.println("PPCanvasNode:"+s); }      private static void pa(String s) { System.out.println("PPCanvasNode:"+s); }
26    
27      private Model model;      private Space space;
28      private GraphicsAPI.Window win;      private GraphicsAPI.Window win;
29      public PPCanvasNode(Model m, GraphicsAPI.Window w) {      public PPCanvasNode(Space s, GraphicsAPI.Window w) {
30          this.model = m;          this.space = s;
31          this.win = w;          this.win = w;
32      }      }
33            
34        /** The zoom to be used for the buoys.
35         */
36        public float buoyZoom = 1;
37    
38        /** The zoom to be used for the link creation buoys.
39         */
40        public float linkbuoyZoom = .5f;
41    
42      /** True if this view "owns" a certain node.      /** True if this view "owns" a certain node.
43       */       */
44      public boolean ownsNode(RDFNode node)      public boolean ownsNode(RDFNode node)
45      {      {
46          // check if node is a note          // check if node is a note
47          if (ShortRDF.isNodeType(model, node, PP.noteType)) return true;          if (ShortRDF.isNodeType(space.getModel(), node, PP.noteType)) return true;
48                    
49          // or if node is a paper          // or if node is a paper
50          if (ShortRDF.isNodeType(model, node, PP.paperType)) return true;          if (ShortRDF.isNodeType(space.getModel(), node, PP.paperType)) return true;
51                    
52          // otherwise          // otherwise
53          return false;          return false;
# Line 49  private static final String rcsid = "$Id Line 64  private static final String rcsid = "$Id
64              wh[1] /= 6;              wh[1] /= 6;
65              return null;              return null;
66          }          }
67            
68          // XXX          wh[0] = 250;
69            wh[1] = 250;
70          return null;          return null;
71      }      }
72    
# Line 68  private static final String rcsid = "$Id Line 84  private static final String rcsid = "$Id
84    
85          int[] pan = getCoords(node);          int[] pan = getCoords(node);
86    
87          /*                SimpleVStreamTexter sct = (SimpleVStreamTexter)space.getNodeTexter();
88          SimpleVStreamTexter sct = (SimpleVStreamTexter)space.getCellTexter();          Enfilade1DImpl enf = (Enfilade1DImpl)sct.getEnfilade(node, null);
         Enfilade1DImpl enf = (Enfilade1DImpl)sct.getEnfilade(c, null);  
89          java.util.List enfList= enf.getList();          java.util.List enfList= enf.getList();
90          Span1D span = (Span1D) enfList.get(0);          Span1D span = (Span1D) enfList.get(0);
91          CellView cv;  
         if (span instanceof TextSpan)  
             cv = new TextCellContentView();  
         else  
             cv = new PageSpanCellView();  
92          float [] bs = new float[3];          float [] bs = new float[3];
         cv.getSize(c, ((ViewContext)new AbstractViewContext()), bs);  
93    
94          pan[0] += bs[0]/2;          //cv.getSize(c, ((ViewContext)new AbstractViewContext()), bs);
95          pan[1] += bs[1]/2;  
96            //pan[0] += bs[0]/2;
97            //pan[1] += bs[1]/2;
98            pan[0] += 200/2;
99            pan[1] += 200/2;
100    
101    
102          final int c2fCS =          final int c2fCS =
# Line 92  private static final String rcsid = "$Id Line 106  private static final String rcsid = "$Id
106          vs.matcher.add(into, c2fCS, "C2F");          vs.matcher.add(into, c2fCS, "C2F");
107          vs.matcher.add(into, c2fCSInv, "C2FINV");          vs.matcher.add(into, c2fCSInv, "C2FINV");
108    
109          SinglePaper.i(space, d,win,c).render(vs, into, c2fCS, c2fCSInv, null);          //SinglePaper.i(space, d,win,c).render(vs, into, c2fCS, c2fCSInv, null);
         */  
110          return into;          return into;
111      }      }
112    
# Line 108  private static final String rcsid = "$Id Line 121  private static final String rcsid = "$Id
121      private int[] getCoords(RDFNode node) {      private int[] getCoords(RDFNode node) {
122          int [] ints = new int[2];          int [] ints = new int[2];
123                    
124          ints[0] = ShortRDF.getInt(model, node, SPATIAL.coordX);          ints[0] = ShortRDF.getInt(space.getModel(), node, SPATIAL.coordX);
125          ints[1] = ShortRDF.getInt(model, node, SPATIAL.coordY);          ints[1] = ShortRDF.getInt(space.getModel(), node, SPATIAL.coordY);
126          return ints;          return ints;
127      }      }
128    

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