41 |
import java.awt.Color; |
import java.awt.Color; |
42 |
import java.awt.Component; |
import java.awt.Component; |
43 |
import java.awt.Graphics; |
import java.awt.Graphics; |
|
import java.awt.Polygon; |
|
44 |
import java.io.Serializable; |
import java.io.Serializable; |
45 |
|
|
46 |
import javax.swing.Icon; |
import javax.swing.Icon; |
240 |
{ |
{ |
241 |
return new DummyIcon(); |
return new DummyIcon(); |
242 |
} |
} |
243 |
|
|
244 |
|
/** |
245 |
|
* Returns a new instance of a 4 x 8 icon showing a small black triangle that |
246 |
|
* points to the right. This is displayed in menu items that have a |
247 |
|
* sub menu. |
248 |
|
* |
249 |
|
* @return The icon. |
250 |
|
*/ |
251 |
public static Icon getMenuArrowIcon() |
public static Icon getMenuArrowIcon() |
252 |
{ |
{ |
253 |
return new Icon() |
return new Icon() |
254 |
{ |
{ |
255 |
public int getIconHeight() |
public int getIconHeight() |
256 |
{ |
{ |
257 |
return 12; |
return 8; |
258 |
} |
} |
|
|
|
259 |
public int getIconWidth() |
public int getIconWidth() |
260 |
{ |
{ |
261 |
return 12; |
return 4; |
262 |
} |
} |
|
|
|
263 |
public void paintIcon(Component c, Graphics g, int x, int y) |
public void paintIcon(Component c, Graphics g, int x, int y) |
264 |
{ |
{ |
|
g.translate(x, y); |
|
|
|
|
265 |
Color saved = g.getColor(); |
Color saved = g.getColor(); |
|
|
|
266 |
g.setColor(Color.BLACK); |
g.setColor(Color.BLACK); |
267 |
|
for (int i = 0; i < 4; i++) |
268 |
g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, |
g.drawLine(x + i, y + i, x + i, y + 7 - i); |
|
new int[] { 2, 6, 10 }, |
|
|
3)); |
|
|
|
|
269 |
g.setColor(saved); |
g.setColor(saved); |
|
g.translate(-x, -y); |
|
270 |
} |
} |
271 |
}; |
}; |
272 |
} |
} |