32 |
import java.awt.*; |
import java.awt.*; |
33 |
import java.awt.event.*; |
import java.awt.event.*; |
34 |
import java.util.*; |
import java.util.*; |
35 |
|
import java.lang.Math; |
36 |
import gzz.client.GraphicsAPI; |
import gzz.client.GraphicsAPI; |
37 |
|
|
38 |
/** A vob which is a circular background and frame. |
/** A vob which is a circular background and frame. |
54 |
if (!texLoaded) { |
if (!texLoaded) { |
55 |
String[] texparam = {"type", "8"}; |
String[] texparam = {"type", "8"}; |
56 |
tex = GL.createTexture(); |
tex = GL.createTexture(); |
|
/** XXX Should texture's size be relative to vob's physical size? |
|
|
* If so, texture should be reloaded always when greater needed. |
|
|
* Currently texture is loaded only once. |
|
|
*/ |
|
57 |
tex.shade(128, 128, 0, 1, "ALPHA", "ALPHA", "geometric", texparam); |
tex.shade(128, 128, 0, 1, "ALPHA", "ALPHA", "geometric", texparam); |
58 |
texLoaded = true; |
texLoaded = true; |
59 |
} |
} |
96 |
g.setColor(bg); |
g.setColor(bg); |
97 |
g.fillOval(mx, my, mw, mh); |
g.fillOval(mx, my, mw, mh); |
98 |
} else { |
} else { |
99 |
|
int arc = 360 / nsolids; |
100 |
for(int i=0; i<nsolids; i++) { |
for(int i=0; i<nsolids; i++) { |
101 |
g.setColor(solids[i]); |
g.setColor(solids[i]); |
102 |
g.fillOval(mx+(mw*i)/nsolids, my, mw/nsolids, mh); |
g.fillArc(mx, my, mw, mh, -90 + arc * (i-1), arc); |
103 |
} |
} |
104 |
} |
} |
105 |
|
|
106 |
if(drawBorder) { |
if(drawBorder) { |
107 |
g.setColor(info1.getMixedFgColor()); |
g.setColor(info1.getMixedFgColor()); |
108 |
g.drawOval(mx, my, mw-1, mh-1); |
if(mh >= 14) g.drawOval(mx-1, my-1, mw+2, mh+2); |
109 |
if(mh >= 14) { |
else g.drawOval(mx, my, mw, mh); |
|
g.drawOval(mx+1, my+1, mw-3, mh-3); |
|
|
} |
|
110 |
} |
} |
111 |
|
|
112 |
g.setColor(oldfg); |
g.setColor(oldfg); |
122 |
if (!texLoaded) loadTex(); |
if (!texLoaded) loadTex(); |
123 |
String bgcall = ""; |
String bgcall = ""; |
124 |
if(nsolids > 0) { |
if(nsolids > 0) { |
125 |
|
double arc = (2*Math.PI) / nsolids; |
126 |
double w = 1.0 / nsolids; |
double w = 1.0 / nsolids; |
127 |
for(int i=0; i<nsolids; i++) { |
for(int i=0; i<nsolids; i++) { |
128 |
double x1 = i*w; |
double x1 = i*w; |
196 |
* of the array. Mostly useful for checking for nullness. |
* of the array. Mostly useful for checking for nullness. |
197 |
*/ |
*/ |
198 |
public Color[] getSolidColors() { return solids; } |
public Color[] getSolidColors() { return solids; } |
|
|
|
199 |
} |
} |
200 |
|
|
201 |
|
|