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 |
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) |
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 |
); |
); |