jcontrol.ui.vole
Class TextScroller

java.lang.Object
  extended by jcontrol.ui.vole.Component
      extended by jcontrol.ui.vole.TextScroller
All Implemented Interfaces:
Animateable

public class TextScroller
extends Component
implements Animateable

This class provides a graphical TextScroller component for the Vole GUI. It implements the Animateable interface and therefore should be added to an AnimationContainer.

(c) Copyright 2003-2007 DOMOLOGIC GmbH


Field Summary
static int ALIGN_CENTER
          Constant value for center alignment
static int ALIGN_LEFT
          Constant value for left alignment
static int ALIGN_RIGHT
          Constant value for right alignment
 
Fields inherited from class jcontrol.ui.vole.Component
eventQueue, focusOwner, font, g, height, listener, parent, visible, width, x, y
 
Constructor Summary
TextScroller(String[] items, int x, int y, int width, int height, int align)
          Creates a new TextScroller containing the specified text.
 
Method Summary
 void animate()
          The animate method of the text scroller.
 void paint()
          Draws the text scroller.
 void setStep(int step)
          Sets the step width of this text scroller in pixels.
 boolean transferFocus()
          Don't gain input focus.
 
Methods inherited from class jcontrol.ui.vole.Component
getBounds, getParent, isVisible, onActionEvent, onKeyEvent, remove, removeFocus, requestFocus, setBounds, setFont, setGraphics, setParent, setVisible, validate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notifyAll, toString, wait
 

Field Detail

ALIGN_CENTER

public static final int ALIGN_CENTER
Constant value for center alignment

See Also:
Constant Field Values

ALIGN_LEFT

public static final int ALIGN_LEFT
Constant value for left alignment

See Also:
Constant Field Values

ALIGN_RIGHT

public static final int ALIGN_RIGHT
Constant value for right alignment

See Also:
Constant Field Values
Constructor Detail

TextScroller

public TextScroller(String[] items,
                    int x,
                    int y,
                    int width,
                    int height,
                    int align)
Creates a new TextScroller containing the specified text.

Parameters:
items - Some lines of text to display in this TextScroller.
x -
y -
width -
height -
align - Specifies the alignment of the text. Possible values are ALIGN_CENTER, ALIGN_LEFT and ALIGN_RIGHT.
Method Detail

paint

public void paint()
Draws the text scroller.

Overrides:
paint in class Component

setStep

public void setStep(int step)
Sets the step width of this text scroller in pixels.

Parameters:
step - The step width.

animate

public void animate()
The animate method of the text scroller. Whenever this method is called from the AnimationContainer, the component scrolls the text. The scroll speed and direction depends on the step value, which can be set with setStep(int m_step).

Specified by:
animate in interface Animateable

transferFocus

public boolean transferFocus()
Don't gain input focus.

Overrides:
transferFocus in class Component
Returns:
true, if the focus was transferred successfully.