com.tensegrity.gui.swing.icon
Class TriangleIcon
java.lang.Object
javax.swing.ImageIcon
com.tensegrity.gui.swing.icon.Icon
com.tensegrity.gui.swing.icon.TriangleIcon
- All Implemented Interfaces:
- javax.accessibility.Accessible, javax.swing.Icon, java.io.Serializable
- public class TriangleIcon
- extends Icon
TriangleIcon draws a triangle in a Icon of 16x16 to a given direction defined
by SwingConstants (NORTH, EAST, SOUTH and WEST).
- Version:
- $Id: TriangleIcon.java,v 1.9 2004/03/02 13:18:53 GillesIachelini Exp $
- Author:
- Gilles Iachelini
- See Also:
- Serialized Form
| Nested classes inherited from class javax.swing.ImageIcon |
javax.swing.ImageIcon.AccessibleImageIcon |
| Fields inherited from class javax.swing.ImageIcon |
component, tracker |
|
Constructor Summary |
TriangleIcon()
Creates the default TriangleIcon with orientation NORTH, black color and
antialiasing turned on. |
TriangleIcon(java.awt.Color color,
boolean antialiasing,
int orientation)
Creates the TriangleIcon with the given color and orientation. |
TriangleIcon(java.awt.Color color,
int orientation)
Creates a TriangleIcon with the given color and orientation. |
TriangleIcon(int orientation)
Creates a black triangle with antialiasing and the given orientation. |
|
Method Summary |
void |
paintIcon(java.awt.Component component,
java.awt.Graphics graphics,
int x,
int y)
|
void |
setColor(java.awt.Color color)
The method setColor sets the color for the triangle. |
| Methods inherited from class javax.swing.ImageIcon |
getAccessibleContext, getDescription, getIconHeight, getIconWidth, getImageLoadStatus, getImageObserver, loadImage, setDescription, setImageObserver, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TriangleIcon
public TriangleIcon()
- Creates the default TriangleIcon with orientation NORTH, black color and
antialiasing turned on.
TriangleIcon
public TriangleIcon(java.awt.Color color,
int orientation)
- Creates a TriangleIcon with the given color and orientation.
- Parameters:
color - the drawing color.orientation - the orientation.- See Also:
SwingConstants.WEST,
SwingConstants.EAST,
SwingConstants.NORTH,
SwingConstants.SOUTH
TriangleIcon
public TriangleIcon(int orientation)
- Creates a black triangle with antialiasing and the given orientation.
- Parameters:
orientation - the direction where the triangle points to.- See Also:
SwingConstants.WEST,
SwingConstants.EAST,
SwingConstants.NORTH,
SwingConstants.SOUTH
TriangleIcon
public TriangleIcon(java.awt.Color color,
boolean antialiasing,
int orientation)
- Creates the TriangleIcon with the given color and orientation. If
antialiasing should be used, the boolean should be set to true.
- Parameters:
color - a Color instance used for drawing.antialiasing - the flag, that indicates antialiasing.orientation - the orientation of the triangle.- See Also:
SwingConstants.WEST,
SwingConstants.EAST,
SwingConstants.NORTH,
SwingConstants.SOUTH
paintIcon
public void paintIcon(java.awt.Component component,
java.awt.Graphics graphics,
int x,
int y)
- Specified by:
paintIcon in interface javax.swing.Icon- Overrides:
paintIcon in class Icon
setColor
public void setColor(java.awt.Color color)
- The method setColor sets the color for the triangle.
- Overrides:
setColor in class Icon
- Parameters:
color - the new color for the triangle.
Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.