/[gzz]/gzz/gzz/view/BoxCellView.java
ViewVC logotype

Diff of /gzz/gzz/view/BoxCellView.java

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

revision 1.2 by benja, Sat Nov 23 00:35:21 2002 UTC revision 1.3 by benja, Sat Nov 23 13:44:20 2002 UTC
# Line 52  public static final String rcsid = "$Id$ Line 52  public static final String rcsid = "$Id$
52    
53      static Object CONTENT_KEY = new Object();      static Object CONTENT_KEY = new Object();
54      static Object BOX_KEY = new Object();      static Object BOX_KEY = new Object();
55      static TextStyle style =      static Object UNCLIP = new Object();
56          GraphicsAPI.getInstance().getTextStyle("SansSerif", Font.PLAIN, 10);  
57        static Rectangle rect = new Rectangle();
58        static float[] boxwh = new float[2];
59    
     //CellContentView ccv = new TextCellContentView(style);  
     //CellContentView ccv = new SpanCellContentView(style);  
     //CellContentView ccv = new LinebrokenCellContentView(style);  
       
     /** The ccv to use, if any. XXX hack for demo, remove  
      */  
     CellContentView cellContentView = null; // use viewcontext's by default  
     public BoxCellView() {}  
     public BoxCellView(CellContentView ccv) { cellContentView = ccv; }  
       
60      Dim d_clone;      Dim d_clone;
     /*  
     Dim d_cursor;  
     Dim d_spaces;  
     Dim d_mark;  
     */  
   
     // CompoundSpace space;  
   
     /** @see #getSliceId.  
      * To be compared using ==  
      **/  
     Object sliceId = null;  
61    
62      public void setSpace(Space s) {      public void setSpace(Space s) {
63          d_clone = s.getCloneDim();          d_clone = s.getCloneDim();
         /*  
         d_cursor = s.getDim(Dims.d_cursor_id);  
         d_spaces = s.getDim(Dims.d_spaces_id);  
         d_mark = s.getDim(Dims.d_mark_id);  
         */  
         /*  
         if(s instanceof CompoundSpace)  
             space = (CompoundSpace)s;  
         */  
64      }      }
65    
66      Cell center;      Cell center;
# Line 97  public static final String rcsid = "$Id$ Line 68  public static final String rcsid = "$Id$
68          if(center == this.center || center.equals(this.center)) return;          if(center == this.center || center.equals(this.center)) return;
69          this.center = center;          this.center = center;
70          setSpace(center.space);          setSpace(center.space);
         sliceId = getSliceId(center);  
71      }      }
72    
73      public void getSize(Cell c, float scale, float[] into) {      public void getSize(Cell c, float scale, ViewContext context,
74          into[0] = style.getWidth("XXXXXXXXXX", scale)/scale+10;                          float[] into) {
75          into[1] = style.getHeight(scale)/scale + 10;          context.getCellContentView().getSize(c, scale, context, into);
76            into[0] += 10;
77            into[1] += 10;
78      }      }
79    
     static Object UNCLIP = new Object();  
   
     /** Get an Id for the slice this Cell is in.  
      *  Iff getSliceId(c).equals(getSliceId(d)), c and d are in the same slice.  
      */  
     public Object getSliceId(Cell c) {  
         return null;  
         /*  
         if(space == null) return null;  
         return space.getSpace(c);  
         */  
     }  
   
     static Rectangle rect = new Rectangle();  
   
     float[] boxwh = new float[2];  
   
80      public void place(final Cell c, final VobScene vs,      public void place(final Cell c, final VobScene vs,
81                          final int box,                          final int box,
82                        final ViewContext context) {                        final ViewContext context) {
# Line 129  public static final String rcsid = "$Id$ Line 84  public static final String rcsid = "$Id$
84          if(d_clone == null)          if(d_clone == null)
85              throw new NullPointerException("clone dim not set in BoxCellView");              throw new NullPointerException("clone dim not set in BoxCellView");
86                            
87          final CellInBox ccv =          final CellInBox ccv = context.getCellContentView();
             cellContentView != null ? cellContentView : context.getCellContentView();  
88    
89          final RectBgVob bg = new RectBgVob();          final RectBgVob bg = new RectBgVob();
90    
# Line 147  public static final String rcsid = "$Id$ Line 101  public static final String rcsid = "$Id$
101          if (context.isMarked(c)) // if marked          if (context.isMarked(c)) // if marked
102              bg.addColor(new Color(0xff0000));              bg.addColor(new Color(0xff0000));
103    
         Object sliceId2 = getSliceId(c);  
         if((sliceId==null && sliceId2!=null)  
            || (sliceId != null && !sliceId.equals(sliceId2))  
            ) { // if different slice  
             bg.setBg(bg.getBg().darker().darker());  
         }  
   
104          float pad = 5;          float pad = 5;
105    
106          vs.coords.getSqSize(box, boxwh);          vs.coords.getSqSize(box, boxwh);

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