jcontrol.ui.vole
Class TextScroller

java.lang.Object
  |
  +--jcontrol.ui.vole.Component
        |
        +--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) DOMOLOGIC Home Automation GmbH 2003

Version:
1.0
Author:
boehme

Field Summary
protected  int align
           
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
protected  int lh
           
protected  int line
           
protected  java.lang.String[] lines
           
protected  int offs
           
protected  int step
           
protected  int[] xpos
           
 
Fields inherited from class jcontrol.ui.vole.Component
focusOwner, font, g, height, listener, parent, visible, width, x, y
 
Constructor Summary
TextScroller(java.lang.String[] lines, 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, setLocation, setParent, setVisible, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, notifyAll, wait
 

Field Detail

align

protected int align

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

lh

protected int lh

line

protected int line

lines

protected java.lang.String[] lines

offs

protected int offs

step

protected int step

xpos

protected int[] xpos
Constructor Detail

TextScroller

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

Parameters:
lines - 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

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 step).

Specified by:
animate in interface Animateable

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.

transferFocus

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

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