org.zaval.lw
Class LwLink

java.lang.Object
  |
  +--org.zaval.util.ValidationObject
        |
        +--org.zaval.lw.LwCanvas
              |
              +--org.zaval.lw.LwStButton
                    |
                    +--org.zaval.lw.LwLink
All Implemented Interfaces:
Cursorable, Drawable, java.util.EventListener, Layoutable, LwComponent, LwMouseListener, LwMouseMotionListener, java.lang.Runnable, Validationable

public class LwLink
extends LwStButton
implements Cursorable

This component is something like text links that are used by "html". The link component uses three link text colors to show it state:


Event performing.
The class performs LwActionEvent when the link has been pressed. Use addActionListener and removeActionListener methods to catch the event.


Fields inherited from class org.zaval.lw.LwStButton
ST_DISABLED, ST_ONSURFACE, ST_OUTSURFACE, ST_PRESSED
 
Fields inherited from class org.zaval.lw.LwCanvas
bits, height, insets, parent, psHeight, psWidth, skins, width, x, y
 
Fields inherited from class org.zaval.util.ValidationObject
isValidFlag
 
Constructor Summary
LwLink(java.lang.String s)
          Constructs a link component with the specified link text.
 
Method Summary
 int getCursorType(LwComponent target, int x, int y)
          Gets the cursor type.
 void setHighlightColor(java.awt.Color c)
          Sets the specified "highlightColor" of the link text.
 void setNonActiveColor(java.awt.Color c)
          Sets the specified "nonActiveColor" of the link text.
 void setPressingColor(java.awt.Color c)
          Sets the specified "pressingColor" of the link text.
protected  void stateChanged(int s, int ps)
          Invoked when the state of the component has been changed.
 
Methods inherited from class org.zaval.lw.LwStButton
addActionListener, endDragged, fireByPress, getState, isFireByPress, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, perform, removeActionListener, run, setEnabled, setState, startDragged, sync, viewManChanged
 
Methods inherited from class org.zaval.lw.LwCanvas
calcPreferredSize, canHaveFocus, getBackground, getBounds, getHeight, getInsets, getLocation, getLwComponentAt, getLwParent, getOrigin, getPreferredSize, getSize, getViewMan, getVisiblePart, getWidth, getX, getY, hasFocus, invalidate, isEnabled, isOpaque, isVisible, paint, recalc, repaint, repaint, requestFocus, setBackground, setInsets, setLocation, setLwParent, setOpaque, setPSSize, setSize, setViewMan, setVisible, toString, update, validate, vrp
 
Methods inherited from class org.zaval.util.ValidationObject
isValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zaval.util.Validationable
isValid
 

Constructor Detail

LwLink

public LwLink(java.lang.String s)
Constructs a link component with the specified link text.
Parameters:
s - the specified link text.
Method Detail

setHighlightColor

public void setHighlightColor(java.awt.Color c)
Sets the specified "highlightColor" of the link text. The color is used to show the link text when the mouse cursor is inside the component, but a mouse button has not been pressed.
Parameters:
c - the specified color.

setPressingColor

public void setPressingColor(java.awt.Color c)
Sets the specified "pressingColor" of the link text. The color is used to show the link text when a mouse button has been pressed.
Parameters:
c - the specified color.

setNonActiveColor

public void setNonActiveColor(java.awt.Color c)
Sets the specified "nonActiveColor" of the link text. The color is used to show the link text when the mouse cursor is outside the component and a mouse button has not been pressed.
Parameters:
c - the specified color.

getCursorType

public int getCursorType(LwComponent target,
                         int x,
                         int y)
Gets the cursor type. The method is an implementation of Cursorable interface and it is used to define cursor type. The component returns java.awt.Cursor.HAND_CURSOR cursor type.
Specified by:
getCursorType in interface Cursorable
Parameters:
target - the specified component.
x - the specified x coordinate of the mouse cursor relatively the component.
y - the specified y coordinate of the mouse cursor relatively the component.
Returns:
a cursor type.

stateChanged

protected void stateChanged(int s,
                            int ps)
Invoked when the state of the component has been changed. The method is used to listen state changing and setting appropriate link text color for the state.
Overrides:
stateChanged in class LwStButton
Parameters:
s - the new state of the component.
ps - the previous state of the component.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org