com.levigo.util.swing
Class RotatedIcon

java.lang.Object
  extended by com.levigo.util.swing.RotatedIcon
All Implemented Interfaces:
Icon

public class RotatedIcon
extends Object
implements Icon

Delegating icon implementation which allows to rotate the rendering of the nested icon.

Author:
Francois Fernandes

Nested Class Summary
static class RotatedIcon.Rotation
           
 
Constructor Summary
RotatedIcon(Icon icon, RotatedIcon.Rotation rotate)
          Create a RotatedIcon
 
Method Summary
 Icon getIcon()
          Gets the Icon to be rotated
 int getIconHeight()
          Gets the height of this icon.
 int getIconWidth()
          Gets the width of this icon.
 RotatedIcon.Rotation getRotation()
          Gets the Rotate enum which indicates the direction of rotation
 void paintIcon(Component c, Graphics g, int x, int y)
          Paint the icons of this compound icon at the specified location
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RotatedIcon

public RotatedIcon(Icon icon,
                   RotatedIcon.Rotation rotate)
Create a RotatedIcon

Parameters:
icon - the Icon to rotate
rotate - the rotation to be applied
Method Detail

getIcon

public Icon getIcon()
Gets the Icon to be rotated

Returns:
the Icon to be rotated

getRotation

public RotatedIcon.Rotation getRotation()
Gets the Rotate enum which indicates the direction of rotation

Returns:
the Rotate enum

getIconWidth

public int getIconWidth()
Gets the width of this icon.

Specified by:
getIconWidth in interface Icon
Returns:
the width of the icon in pixels.

getIconHeight

public int getIconHeight()
Gets the height of this icon.

Specified by:
getIconHeight in interface Icon
Returns:
the height of the icon in pixels.

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Paint the icons of this compound icon at the specified location

Specified by:
paintIcon in interface Icon
Parameters:
c - The component on which the icon is painted
g - the graphics context
x - the X coordinate of the icon's top-left corner
y - the Y coordinate of the icon's top-left corner


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.