Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.gui4j.core.swing.calendar
Class ArrowIcon  view ArrowIcon download ArrowIcon.java

java.lang.Object
  extended byorg.gui4j.core.swing.calendar.ArrowIcon
All Implemented Interfaces:
javax.swing.Icon

class ArrowIcon
extends java.lang.Object
implements javax.swing.Icon

Instances of this class represent an icon displaying an arrow pointing * up, down, left or right.


Field Summary
static int DOWN
           
static int LEFT
           
private static int nPoints
           
private  int orientation
           
private  java.awt.Dimension preferredSize
           
static int RIGHT
           
static int UP
           
private  int[] xPoints
           
private  int[] yPoints
           
 
Constructor Summary
ArrowIcon(int orientation)
          Creates an instance of ArrowIcon with the specified arrow orientation.
 
Method Summary
 int getIconHeight()
          Returns the icon's height.
 int getIconWidth()
          Returns the icon's width.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          Draws the icon at the specified location.
protected  void recalculateShape(int x, int y, int w, int h)
          Recalculates the shape of the arrow icon accoring to the specified location * and dimension.
 void setPreferredSize(java.awt.Dimension size)
          Sets the size of the icon to the given dimension * @param size the new size of the icon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UP

public static final int UP
See Also:
Constant Field Values

LEFT

public static final int LEFT
See Also:
Constant Field Values

DOWN

public static final int DOWN
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

nPoints

private static final int nPoints
See Also:
Constant Field Values

orientation

private int orientation

preferredSize

private java.awt.Dimension preferredSize

xPoints

private int[] xPoints

yPoints

private int[] yPoints
Constructor Detail

ArrowIcon

public ArrowIcon(int orientation)
Creates an instance of ArrowIcon with the specified arrow orientation. * @param orientation defines the direction the arrow points to. Can be: * ArrowIcon.UP, ArrowIcon.DOWN, ArrowIcon.LEFT, ArrowIcon.RIGHT

Method Detail

setPreferredSize

public void setPreferredSize(java.awt.Dimension size)
Sets the size of the icon to the given dimension * @param size the new size of the icon


getIconHeight

public int getIconHeight()
Returns the icon's height. * @return the icon's height

Specified by:
getIconHeight in interface javax.swing.Icon

getIconWidth

public int getIconWidth()
Returns the icon's width. * @return the icon's width

Specified by:
getIconWidth in interface javax.swing.Icon

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Draws the icon at the specified location. * @param c the component on which the icon should be painted * @param g the Graphics instance that should be used to paint * @param x the x-position where the icon should to be painted * @param y the y-position where the icon should to be painted

Specified by:
paintIcon in interface javax.swing.Icon

recalculateShape

protected void recalculateShape(int x,
                                int y,
                                int w,
                                int h)
Recalculates the shape of the arrow icon accoring to the specified location * and dimension. * @param x the x-position where the icon should to be painted * @param y the y-position where the icon should to be painted * @param w the width the icon should have * @param h the height the icon should have