net.sourceforge.geeboss.view.widget.button
Class LedButton

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.button.LedButton
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
Direct Known Subclasses:
BlackLedButton

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

Base class for led buttons

Author:
Frederic BORRY

Field Summary
static int HEIGHT
          Button height
static int WIDTH
          Button width
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
LedButton(org.eclipse.swt.widgets.Composite comp, int flag, org.eclipse.swt.graphics.Image background)
          Construct a new LedButton 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 getLedOffPressedImage()
          Get implementation specific led on pressed image
protected abstract  org.eclipse.swt.graphics.Image getLedOnImage()
          Get implementation specific led on image
protected abstract  org.eclipse.swt.graphics.Image getLedOnPressedImage()
          Get implementation specific led on pressed 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
Button width

See Also:
Constant Field Values

HEIGHT

public static final int HEIGHT
Button height

See Also:
Constant Field Values
Constructor Detail

LedButton

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

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

getLedOnPressedImage

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

Returns:
a led on pressed image

getLedOffImage

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

Returns:
a led off image

getLedOffPressedImage

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

Returns:
a led on pressed 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.