org.pushingpixels.flamingo.internal.utils
Class ArrowResizableIcon

java.lang.Object
  extended by org.pushingpixels.flamingo.internal.utils.ArrowResizableIcon
All Implemented Interfaces:
Icon, ResizableIcon
Direct Known Subclasses:
ArrowResizableIcon.CommandButtonPopupIcon

public class ArrowResizableIcon
extends Object
implements ResizableIcon

Helper implementation of ResizableIcon that draws an arrow.


Nested Class Summary
static class ArrowResizableIcon.CommandButtonPopupIcon
           
 
Field Summary
protected  int direction
          Arrow direction.
protected  int height
          The current icon height.
protected  int width
          The current icon width.
 
Constructor Summary
ArrowResizableIcon(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(Component c, Graphics g, int x, int y)
           
 void revertToOriginalDimension()
           
 void setDimension(Dimension newDimension)
          Changes the dimension of this icon.
protected  boolean toPaintEnabled(Component c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width

protected int width
The current icon width.


height

protected int height
The current icon height.


direction

protected int direction
Arrow direction. One of SwingConstants.SOUTH, SwingConstants.NORTH, SwingConstants.EAST or SwingConstants.WEST.

Constructor Detail

ArrowResizableIcon

public ArrowResizableIcon(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(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 Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface Icon

toPaintEnabled

protected boolean toPaintEnabled(Component c)

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface Icon