org.jvnet.flamingo.utils
Class ArrowResizableIcon

java.lang.Object
  extended by org.jvnet.flamingo.utils.ArrowResizableIcon
All Implemented Interfaces:
javax.swing.Icon, ResizableIcon

public class ArrowResizableIcon
extends java.lang.Object
implements ResizableIcon

Helper implementation of ResizableIcon that draws an arrow.

Author:
Kirill Grouchnikov

Constructor Summary
ArrowResizableIcon(java.awt.Dimension initialDim, int direction)
          Creates a new arrow resizable icon.
ArrowResizableIcon(int initialDim, int direction)
          Creates a new arrow resizable icon.
 
Method Summary
 int getIconHeight()
           
 int getIconWidth()
           
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
 void revertToOriginalDimension()
           
 void setDimension(java.awt.Dimension newDimension)
          Changes the dimension of this icon.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrowResizableIcon

public ArrowResizableIcon(java.awt.Dimension initialDim,
                          int direction)
Creates a new arrow resizable icon.

Parameters:
initialDim - Initial icon dimension.
direction - Arrow direction. Must be one of SwingConstants.SOUTH, SwingConstants.NORTH, SwingConstants.EAST or SwingConstants.WEST.

ArrowResizableIcon

public ArrowResizableIcon(int initialDim,
                          int direction)
Creates a new arrow resizable icon.

Parameters:
initialDim - Initial icon dimension.
direction - Arrow direction. Must be one of SwingConstants.SOUTH, SwingConstants.NORTH, SwingConstants.EAST or SwingConstants.WEST.
Method Detail

revertToOriginalDimension

public void revertToOriginalDimension()

setDimension

public void setDimension(java.awt.Dimension newDimension)
Description copied from interface: ResizableIcon
Changes the dimension of this icon.

Specified by:
setDimension in interface ResizableIcon
Parameters:
newDimension - New dimension for this icon.

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface javax.swing.Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface javax.swing.Icon

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon