56 |
/** Border drawing flag */ |
/** Border drawing flag */ |
57 |
protected final boolean drawBorder; |
protected final boolean drawBorder; |
58 |
|
|
59 |
|
/** Border color */ |
60 |
|
protected final Color borderColor; |
61 |
|
|
62 |
static protected float [][] circleGL = new float[360][2]; |
static protected float [][] circleGL = new float[360][2]; |
63 |
static protected boolean circleGLReady = false; |
static protected boolean circleGLReady = false; |
64 |
static protected void prepareCircleGL(float r) { |
static protected void prepareCircleGL(float r) { |
83 |
protected int step; |
protected int step; |
84 |
|
|
85 |
/** Constructor shorthands */ |
/** Constructor shorthands */ |
86 |
public OvalBgVob() { this(Color.white, true); } |
public OvalBgVob() { this(Color.white, true, null); } |
87 |
public OvalBgVob(Color bgColor) { this(bgColor, true); } |
public OvalBgVob(Color bgColor) { this(bgColor, true, null); } |
88 |
public OvalBgVob(Color bgColor, boolean drawBorder) { |
public OvalBgVob(Color bgColor, boolean drawBorder) { this(bgColor, drawBorder, null); } |
89 |
this(bgColor, drawBorder, 90, 360, 10); |
public OvalBgVob(Color bgColor, boolean drawBorder, Color borderColor) { |
90 |
|
this(bgColor, drawBorder, borderColor, 90, 360, 10); |
91 |
} |
} |
92 |
public OvalBgVob(int start, int sector, int step) { |
public OvalBgVob(int start, int sector, int step) { |
93 |
this(Color.white, true, start, sector, step); |
this(Color.white, true, null, start, sector, step); |
94 |
} |
} |
95 |
|
|
96 |
/** Constructor for OvalBgVob. |
/** Constructor for OvalBgVob. |
97 |
* @param bgColor Background color. |
* @param bgColor Background color. |
98 |
* @param drawBorder Border drawing flag. |
* @param drawBorder Border drawing flag. |
99 |
|
* @param borderColor Border color. If null, default fgColor is used. |
100 |
* @param start Start angle of the sector. 0 degree is at clock three. |
* @param start Start angle of the sector. 0 degree is at clock three. |
101 |
* 90 degrees is at clock twelve. |
* 90 degrees is at clock twelve. |
102 |
* @param sector The angle of the sector to be drawn. Max 360 degrees. |
* @param sector The angle of the sector to be drawn. Max 360 degrees. |
105 |
* resolution is 360 vertexes. XXX this will be removed |
* resolution is 360 vertexes. XXX this will be removed |
106 |
* after DiceableMesh renderable works. |
* after DiceableMesh renderable works. |
107 |
*/ |
*/ |
108 |
public OvalBgVob(Color bgColor, boolean drawBorder, |
public OvalBgVob(Color bgColor, boolean drawBorder, Color borderColor, |
109 |
int start, int sector, int step) { |
int start, int sector, int step) { |
110 |
super(); |
super(); |
111 |
this.bgColor = bgColor; |
this.bgColor = bgColor; |
112 |
this.drawBorder = drawBorder; |
this.drawBorder = drawBorder; |
113 |
|
this.borderColor = borderColor; |
114 |
this.start = Math.abs(start); |
this.start = Math.abs(start); |
115 |
this.sector = Math.abs(sector); |
this.sector = Math.abs(sector); |
116 |
this.step = Math.abs(step); |
this.step = Math.abs(step); |
180 |
} |
} |
181 |
|
|
182 |
if(drawBorder) { |
if(drawBorder) { |
183 |
g.setColor(info1.getMixedFgColor()); |
if (borderColor == null) g.setColor(info1.getMixedFgColor()); |
184 |
|
else g.setColor(borderColor); |
185 |
g.drawOval(mx, my, mw, mh); |
g.drawOval(mx, my, mw, mh); |
186 |
if(mh >= 14) { |
if(mh >= 14) { |
187 |
/** Heavier border for greter Vobs */ |
/** Heavier border for greter Vobs */ |
249 |
|
|
250 |
protected String glBorderString() { |
protected String glBorderString() { |
251 |
String glString = ""; |
String glString = ""; |
252 |
|
String glBorderColorString = "0 0 0"; |
253 |
|
if (borderColor != null) |
254 |
|
glBorderColorString = ColorUtil.colorGLString(borderColor); |
255 |
glString += ( |
glString += ( |
256 |
"Color 0 0 0 1\n" + |
"Color "+glBorderColorString+" 1\n" + |
257 |
"Begin LINE_LOOP\n"); |
"Begin LINE_LOOP\n"); |
258 |
if (sector < 360) glString += ("Vertex 0.5 0.5\n"); |
if (sector < 360) glString += ("Vertex 0.5 0.5\n"); |
259 |
for (int i=0;i<sector;i+=step) { |
for (int i=0;i<sector;i+=step) { |