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

Diff of /gzz/gzz/view/LollipopCellVobFactory.java

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

revision 1.3 by tjl, Wed Oct 30 19:10:17 2002 UTC revision 1.4 by tjl, Fri Nov 1 19:53:52 2002 UTC
# Line 38  import java.util.*; Line 38  import java.util.*;
38    
39  public class LollipopCellVobFactory extends CellVobFactory {  public class LollipopCellVobFactory extends CellVobFactory {
40  public static final String rcsid = "$Id$";  public static final String rcsid = "$Id$";
41        float[] boxwh = new float[2];
42    
43      /** Add the vobs that make up an image of a cell      /** Add the vobs that make up an image of a cell
44       * into the given coordinate       * into the given coordinate
# Line 47  public static final String rcsid = "$Id$ Line 48  public static final String rcsid = "$Id$
48       * @param box The box in which the cell should be.       * @param box The box in which the cell should be.
49       * @param context The view context, for querying cursors, marks etc.       * @param context The view context, for querying cursors, marks etc.
50       */       */
51      public void place(final Cell c, final VobScene v,      public void place(final Cell c, final VobScene vs,
52                          final Box box,                          final int box,
53                        final ViewContext context) {                        final ViewContext context) {
54          setCenter(context.getAccursed());          setCenter(context.getAccursed());
55          if(d_clone == null)          if(d_clone == null)
# Line 80  public static final String rcsid = "$Id$ Line 81  public static final String rcsid = "$Id$
81              bg.setBg(bg.getBg().darker().darker());              bg.setBg(bg.getBg().darker().darker());
82          }          }
83    
         final Box contentBox = new Box();  
84          float pad = 5;          float pad = 5;
85    
86            vs.coords.getSqSize(box, boxwh);
87    
88          /** Coordsys to make OvalBgVob look circle and at          /** Coordsys to make OvalBgVob look circle and at
89           * right place of cell's Box. Currently "right place"           * right place of cell's Box. Currently "right place"
90           * is in the middle.           * is in the middle.
91           */           */
92          final int cs = v.orthoCS(box.getWHCoordsys(), "cs", 0,          final int cs = vs.orthoCS(box, "cs", 0,
93                                   box.getWidth()/2-box.getHeight()/2, 0,                                   boxwh[0]/2-boxwh[1]/2, 0,
94                                   box.getHeight(), box.getHeight());                                   boxwh[1], boxwh[1]);
95    
96    
97          /** Cell's content will be drawn next to OvalBgVob */          /** Cell's content will be drawn next to OvalBgVob */
98          contentBox.setSubWH(box, "CO", box.getWidth()/2+box.getHeight()/2+pad, pad,          final int contentBox = vs.orthoBoxCS(box, "CO", 0,
99                              box.getWidth()-2*pad,                      boxwh[0]/2+boxwh[1]/2+pad, pad, 1, 1,
100                              box.getHeight()-2*pad);                              boxwh[0]-2*pad,
101                                boxwh[1]-2*pad);
102    
103          if(!(GraphicsAPI.getInstance() instanceof gzz.client.gl.GLAPI)) {          if(!(GraphicsAPI.getInstance() instanceof gzz.client.gl.GLAPI)) {
104              ccv.place(c, v, contentBox, context);              ccv.place(c, vs, contentBox, context);
105              v.map.put(bg, cs);              vs.map.put(bg, cs);
106          } else {          } else {
107              v.map.put(bg, cs);              vs.map.put(bg, cs);
108              gzz.gfx.gl.Stencil.drawStenciled(              gzz.gfx.gl.Stencil.drawStenciled(
109                  v,                  vs,
110                  new Runnable() { public void run() {                  new Runnable() { public void run() {
111                      v.map.put(bg, cs);                      vs.map.put(bg, cs);
112                  }},                  }},
113                  null,                  null,
114                  null,                  null,
115                  new Runnable() { public void run() {                  new Runnable() { public void run() {
116                      ccv.place(c, v, contentBox, context);                      ccv.place(c, vs, contentBox, context);
117                  }},                  }},
118                  false                  false
119              );              );

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