public class TLcdRotatingIcon extends Object implements ILcdIcon, Cloneable, Icon
Icon
interface.
JLabel
is all that needs to be done.
ILcdOriented
instead.
Refer to TLcdGXYIconPainter.setUseOrientation(boolean)
or TLspIconStyle#usesOrientation
for more information.Constructor and Description |
---|
TLcdRotatingIcon(ILcdIcon aIconToRotate)
Creates an automatically rotating icon from the given icon.
|
TLcdRotatingIcon(ILcdIcon aIconToRotate,
boolean aAutomaticRotation)
Creates a rotating icon from the given icon.
|
TLcdRotatingIcon(String aIconIdentifier)
Convenience constructor to create an automatically rotating image icon.
|
TLcdRotatingIcon(String aIconIdentifier,
boolean aAutomaticRotation)
Convenience constructor to create a rotating image icon.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Makes
Object.clone() public. |
int |
getIconHeight()
Returns the fixed height of the icon.
|
int |
getIconWidth()
Returns the fixed width of the icon.
|
void |
paintIcon(Component aComponent,
Graphics aGraphics,
int aX,
int aY)
Draw the
ILcdIcon at the specified location. |
void |
reset()
Resets the icon rotation.
|
void |
rotate(double aAngleStepRadians)
Rotates the icon over the given amount.
|
String |
toString() |
public TLcdRotatingIcon(String aIconIdentifier)
aIconIdentifier
- The identifier for the icon.
All strings accepted by TLcdIconFactory.create(String)
are accepted.public TLcdRotatingIcon(String aIconIdentifier, boolean aAutomaticRotation)
aIconIdentifier
- The identifier for the icon.
All strings accepted by TLcdIconFactory.create(String)
are accepted.aAutomaticRotation
- true
for automatic rotation, false
for manual rotation.public TLcdRotatingIcon(ILcdIcon aIconToRotate)
aIconToRotate
- The icon to rotate.public TLcdRotatingIcon(ILcdIcon aIconToRotate, boolean aAutomaticRotation)
aIconToRotate
- The icon to rotate.aAutomaticRotation
- true
for automatic rotation, false
for manual rotation.public int getIconWidth()
ILcdIcon
getIconWidth
in interface ILcdIcon
getIconWidth
in interface Icon
public int getIconHeight()
ILcdIcon
getIconHeight
in interface ILcdIcon
getIconHeight
in interface Icon
public Object clone()
ILcdCloneable
Makes Object.clone()
public.
java.lang.Object
, it can be implemented like this:
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException e ) {
// Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
throw new RuntimeException( e );
}
}
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()
public void paintIcon(Component aComponent, Graphics aGraphics, int aX, int aY)
ILcdIcon
ILcdIcon
at the specified location. ILcdIcon
implementations
may use the Component
argument to get properties useful for
painting, e.g. the foreground or background color.paintIcon
in interface ILcdIcon
paintIcon
in interface Icon
aComponent
- a Component to retrieve properties from.aGraphics
- the Graphics on which the icon will be painted.aX
- the x position where the icon will be painted. x is the first coordinate of the top left
corner point of the icon.aY
- the y position where the icon will be painted. y is the second coordinate of the top left
corner point of the icon.public void reset()
public void rotate(double aAngleStepRadians)
aAngleStepRadians
- The rotation step, in radians.