: Download: FAQ: Licensing: Support: Contact ME
LwVCL Home
Introduction
Overview
Screen Shots
On-line Demos
Requirements
Further Plans
Docs
Tutorial
How-to (PDF)
API
FAQ
Download
Latest version

Home > J2SE > API

Overview  Package   Class  Tree  Deprecated  Index  Help 

org.zaval.lw
Class LwLink

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

public class LwLink
extends LwStButton
implements Cursorable

This component is like text links that are used in "html". The link component uses one of the three colors to show its state. Use setColor method to set the color for the specified link state.

The class performs action event when the link has been pressed. Use the 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, bottom, height, isValidValue, left, parent, psHeight, psWidth, right, skins, temporary, top, width, x, y
 
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 setColor(int state, java.awt.Color c)
          Sets the specified link text color for the given state.
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, addStateListener, endDragged, fireByPress, getState, isFireByPress, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, perform, removeActionListener, removeStateListener, run, setEnabled, setState, startDragged, sync, viewManChanged
 
Methods inherited from class org.zaval.lw.LwCanvas
calcInsets, calcPreferredSize, canHaveFocus, customize, cvp, getBackground, getBottom, getBounds, getHeight, getInsets, getLeft, getLocation, getLwComponentAt, getLwParent, getOrigin, getPreferredSize, getPSImpl, getRight, getSize, getTop, getViewMan, getVisiblePart, getWidth, getX, getY, hasFocus, invalidate, isEnabled, isOpaque, isValid, isVisible, paint, recalc, repaint, repaint, repaint, requestFocus, setBackground, setInsets, setLocation, setLwParent, setOpaque, setPSSize, setSize, setViewMan, setVisible, update, validate, vrp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

setColor

public void setColor(int state,
                     java.awt.Color c)
Sets the specified link text color for the given state.
Parameters:
state - the specified state. Use one of the following values:
  • LwStButton.ST_ONSURFACE
  • LwStButton.ST_PRESSED
  • LwStButton.ST_OUTSURFACE
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.


: up