nl.skybound.awt
Class VerticalLabel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--nl.skybound.awt.VerticalLabel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class VerticalLabel
extends java.awt.Canvas

Label like class that displays it's label tilted + or - 90 degrees so that you can read the label either down-up or up-down.

See Also:
Label, Canvas, Serialized Form

Inner classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static int DIRECTION_DOWN
          Text direction constant for reading downwards (with your head tilted to the right).
static int DIRECTION_UP
          Text direction constant for reading upwards (with your head tilted to the left).
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
VerticalLabel(int direction, java.lang.String text)
          Constructs a new VerticalLabel with the specified text, direction, and Label.LEFT alignment.
VerticalLabel(int direction, java.lang.String text, int alignment)
          Constructs a new VerticalLabel with the specified direction, text, and alignment.
VerticalLabel(java.lang.String text)
          Constructs a new VerticalLabel with the specified text, Label.LEFT alignment, and DIRECTION_UP direction.
VerticalLabel(java.lang.String text, int alignment)
          Constructs a new VerticalLabel with the specified text, alignment, and DIRECTION_UP direction.
 
Method Summary
 void addNotify()
           
 int getAlignment()
          Gets the alignment for this label.
 int getDirection()
          Gets the direction for this label.
 java.awt.Dimension getMaximumSize()
          Gets the maximum size of this label.
 java.awt.Dimension getMinimumSize()
          Gets the minimum size of this label.
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of this label.
 java.lang.String getText()
          Gets the text of this label.
 void paint(java.awt.Graphics g)
          Paints the vertical text.
protected  java.lang.String paramString()
          Returns the parameter string representing the state of this label.
 void setAlignment(int alignment)
          Sets the alignment for this label to the specified alignment.
 void setDirection(int direction)
          Sets the direction for this label to the specified direction.
 void setFont(java.awt.Font font)
          Sets the font of this label.
 void setSize(int width, int height)
           
 void setText(java.lang.String text)
          Sets the text for this label to the specified text.
 void update(java.awt.Graphics g)
          Calls paint(Graphics g).
 
Methods inherited from class java.awt.Canvas
getAccessibleContext
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setVisible, show, show, size, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DIRECTION_DOWN

public static final int DIRECTION_DOWN
Text direction constant for reading downwards (with your head tilted to the right).

DIRECTION_UP

public static final int DIRECTION_UP
Text direction constant for reading upwards (with your head tilted to the left).
Constructor Detail

VerticalLabel

public VerticalLabel(java.lang.String text)
Constructs a new VerticalLabel with the specified text, Label.LEFT alignment, and DIRECTION_UP direction.
Parameters:
text - the initial text.
See Also:
Label

VerticalLabel

public VerticalLabel(java.lang.String text,
                     int alignment)
Constructs a new VerticalLabel with the specified text, alignment, and DIRECTION_UP direction. See the java.awt.Label class for valid alignments.
Parameters:
text - the initial text.
alignment - the initial alignment.
See Also:
Label

VerticalLabel

public VerticalLabel(int direction,
                     java.lang.String text)
Constructs a new VerticalLabel with the specified text, direction, and Label.LEFT alignment. See the java.awt.Label class for valid alignments.
Parameters:
direction - the initial direction.
text - the initial text.
See Also:
Label

VerticalLabel

public VerticalLabel(int direction,
                     java.lang.String text,
                     int alignment)
Constructs a new VerticalLabel with the specified direction, text, and alignment. See the java.awt.Label class for valid alignments.
Parameters:
direction - the initial direction.
text - the initial text.
alignment - the initial alignment.
See Also:
Label
Method Detail

setAlignment

public void setAlignment(int alignment)
Sets the alignment for this label to the specified alignment. Possible values are Label.LEFT, Label.RIGHT, and Label.CENTER.
Parameters:
alignment - the alignment to be set.
Throws:
java.lang.IllegalArgumentException - if an improper value for alignment is given.
See Also:
getAlignment()

getAlignment

public int getAlignment()
Gets the alignment for this label.
Returns:
the current alignment of this label.
See Also:
setAlignment(int), Label.getAlignment()

setDirection

public void setDirection(int direction)
Sets the direction for this label to the specified direction. Possible values are VerticalLabel.DIRECTION_UP, VerticalLabel.DIRECTION_DOWN.
Parameters:
direction - the direction to be set.
Throws:
java.lang.IllegalArgumentException - if an improper value for direction is given.
See Also:
getDirection()

getDirection

public int getDirection()
Gets the direction for this label.
Returns:
the current direction of this label.
See Also:
setDirection(int)

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred size of this label.
Overrides:
getPreferredSize in class java.awt.Component

getMinimumSize

public java.awt.Dimension getMinimumSize()
Gets the minimum size of this label.
Overrides:
getMinimumSize in class java.awt.Component

getMaximumSize

public java.awt.Dimension getMaximumSize()
Gets the maximum size of this label.
Overrides:
getMaximumSize in class java.awt.Component

setFont

public void setFont(java.awt.Font font)
Sets the font of this label.
Overrides:
setFont in class java.awt.Component
See Also:
Component.setFont(java.awt.Font)

addNotify

public void addNotify()
Overrides:
addNotify in class java.awt.Canvas
See Also:
Canvas.addNotify()

paint

public void paint(java.awt.Graphics g)
Paints the vertical text.
Overrides:
paint in class java.awt.Canvas
See Also:
update(java.awt.Graphics), Canvas.paint(java.awt.Graphics)

update

public void update(java.awt.Graphics g)
Calls paint(Graphics g).
Overrides:
update in class java.awt.Component
See Also:
paint(java.awt.Graphics), Canvas.paint(java.awt.Graphics)

setSize

public void setSize(int width,
                    int height)
Overrides:
setSize in class java.awt.Component
See Also:
Component.setSize(int, int)

getText

public java.lang.String getText()
Gets the text of this label.
Returns:
the text of this label, or null if the text has been set to null.
See Also:
setText(java.lang.String)

setText

public void setText(java.lang.String text)
Sets the text for this label to the specified text.
Parameters:
text - the text that this label displays. If text is null, it is treated for display purposes like an empty string "".
See Also:
getText()

paramString

protected java.lang.String paramString()
Returns the parameter string representing the state of this label. This string is useful for debugging.
Overrides:
paramString in class java.awt.Component
Returns:
the parameter string of this label.