net.sourceforge.geeboss.view.widget.led
Class LedControl

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by net.sourceforge.geeboss.view.widget.led.LedControl
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
Direct Known Subclasses:
RedLed

public abstract class LedControl
extends org.eclipse.swt.widgets.Composite

Base class for led controls

Author:
Frederic BORRY

Field Summary
static int HEIGHT
          Led height
static int WIDTH
          Led width
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
LedControl(Parameter parameter, org.eclipse.swt.widgets.Composite comp, int flag, org.eclipse.swt.graphics.Image background)
          Construct a new LedControl given a background image
 
Method Summary
protected abstract  org.eclipse.swt.graphics.Image getLedOffImage()
          Get implementation specific led off image
protected abstract  org.eclipse.swt.graphics.Image getLedOnImage()
          Get implementation specific led on image
 boolean getState()
          Getter for current state
 void redraw()
          Redraw method overlaod
 void setState(boolean state)
          Externally set the state
 boolean toggleState()
          Toggle the state of the led
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WIDTH

public static final int WIDTH
Led width

See Also:
Constant Field Values

HEIGHT

public static final int HEIGHT
Led height

See Also:
Constant Field Values
Constructor Detail

LedControl

public LedControl(Parameter parameter,
                  org.eclipse.swt.widgets.Composite comp,
                  int flag,
                  org.eclipse.swt.graphics.Image background)
Construct a new LedControl given a background image

Parameters:
parameter - the parameter associated to this led
comp - the parent composite
flag - the style flag
background - the background image
Method Detail

getLedOnImage

protected abstract org.eclipse.swt.graphics.Image getLedOnImage()
Get implementation specific led on image

Returns:
a led on image

getLedOffImage

protected abstract org.eclipse.swt.graphics.Image getLedOffImage()
Get implementation specific led off image

Returns:
a led off image

redraw

public void redraw()
Redraw method overlaod

Overrides:
redraw in class org.eclipse.swt.widgets.Control

setState

public void setState(boolean state)
Externally set the state

Parameters:
state - the new state

toggleState

public boolean toggleState()
Toggle the state of the led

Returns:
the new state

getState

public boolean getState()
Getter for current state

Returns:
the current state


Copyright (c) 2005 The Geeboss team (http://geeboss.sourceforge.net). All Rights Reserved.