55 |
/** Border drawing flag */ |
/** Border drawing flag */ |
56 |
protected final boolean drawBorder; |
protected final boolean drawBorder; |
57 |
|
|
58 |
|
/** Border color */ |
59 |
|
protected final Color borderColor; |
60 |
|
|
61 |
/** Constructor shorthands */ |
/** Constructor shorthands */ |
62 |
public RectBgVob() { this(Color.white, true); } |
public RectBgVob() { this(Color.white, true, null); } |
63 |
public RectBgVob(Color bgColor) { this(bgColor, true); } |
public RectBgVob(Color bgColor) { this(bgColor, true, null); } |
64 |
|
public RectBgVob(Color bgColor, boolean drawBorder) { this(bgColor, drawBorder, null); } |
65 |
|
|
66 |
/** Construct RectBgVob. |
/** Construct RectBgVob. |
67 |
* @param bgColor Background color. |
* @param bgColor Background color. |
68 |
* @param drawBorder Border drawing flag. |
* @param drawBorder Border drawing flag. |
69 |
|
* @param borderColor Border color. If null, default fgColor is used. |
70 |
*/ |
*/ |
71 |
public RectBgVob(Color bgColor, boolean drawBorder) { |
public RectBgVob(Color bgColor, boolean drawBorder, Color borderColor) { |
72 |
super(); |
super(); |
73 |
this.bgColor = bgColor; |
this.bgColor = bgColor; |
74 |
this.drawBorder = drawBorder; |
this.drawBorder = drawBorder; |
75 |
|
this.borderColor = borderColor; |
76 |
} |
} |
77 |
|
|
78 |
static Rectangle rect = new Rectangle(); |
static Rectangle rect = new Rectangle(); |
105 |
} |
} |
106 |
|
|
107 |
if(drawBorder) { |
if(drawBorder) { |
108 |
g.setColor(info1.getMixedFgColor()); |
if (borderColor == null) g.setColor(info1.getMixedFgColor()); |
109 |
|
else g.setColor(borderColor); |
110 |
g.drawRect(mx, my, mw-1, mh-1); |
g.drawRect(mx, my, mw-1, mh-1); |
111 |
if(mh >= 14) { |
if(mh >= 14) { |
112 |
g.drawRect(mx+1, my+1, mw-3, mh-3); |
g.drawRect(mx+1, my+1, mw-3, mh-3); |
146 |
"End\n"); |
"End\n"); |
147 |
} |
} |
148 |
|
|
149 |
|
String glBorderColorString = "0 0 0"; |
150 |
|
if (borderColor != null) |
151 |
|
glBorderColorString = ColorUtil.colorGLString(borderColor); |
152 |
|
|
153 |
glList = GLRen.createCallListBoxCoorded( |
glList = GLRen.createCallListBoxCoorded( |
154 |
"PushAttrib CURRENT_BIT ENABLE_BIT\n"+ |
"PushAttrib CURRENT_BIT ENABLE_BIT\n"+ |
155 |
"Disable TEXTURE_2D\n"+ |
"Disable TEXTURE_2D\n"+ |
156 |
|
|
157 |
bgcall + |
bgcall + |
158 |
|
|
159 |
"Color 0 0 0 1\n"+ |
"Color "+glBorderColorString+" 1\n"+ |
160 |
"Begin LINE_STRIP\n"+ |
"Begin LINE_STRIP\n"+ |
161 |
"Vertex 1 1\n"+ |
"Vertex 1 1\n"+ |
162 |
"Vertex 1 0\n"+ |
"Vertex 1 0\n"+ |