com.tensegrity.gui.swt.control
Class SwtSliderTextPanel

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended bycom.tensegrity.gui.swt.control.SwtSliderTextPanel
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class SwtSliderTextPanel
extends org.eclipse.swt.widgets.Composite

This class represents a Scale coupled with a textfield. The two components interact. The slider will adjust itself to the value of the textfield and vice versa. It is possible to type a number into the textfield and the slider is adjusted if return is pressed or if the focus is lost on the text field. The text field will be automatically adjusted to the scale's minimum value if the text entered is not an Integer or an Integer inferior to the minimum value; if the entered value is greater than the scale's maximum value then the text is set to this maximum value.

Version:
$Id: SwtSliderTextPanel.java,v 1.5 2005/12/02 14:54:05 ArndHouben Exp $
Author:
S�bastien Guyon

Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
SwtSliderTextPanel(org.eclipse.swt.widgets.Composite parent, int style, java.lang.String text, int min, int max, int value)
           The single constructor for SwtSliderTextPanel
 
Method Summary
 int getValue()
          Retrieves the value of the slider.
 void setValue(int n)
          Sets the value of the slider.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, 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, 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
 

Constructor Detail

SwtSliderTextPanel

public SwtSliderTextPanel(org.eclipse.swt.widgets.Composite parent,
                          int style,
                          java.lang.String text,
                          int min,
                          int max,
                          int value)

The single constructor for SwtSliderTextPanel

Parameters:
parent - the parent Composite
style - the style to be applied to this Composite
text - the text to be displayed
min - the minimum value
max - the maximum value
value - the default value
Method Detail

getValue

public int getValue()
Retrieves the value of the slider. The value is in the interval that is specified upon creation of the instance.

Returns:
the value of the slider.

setValue

public void setValue(int n)
Sets the value of the slider. The value must be in the interval that is specified upon creation of the instance.

Parameters:
n - the slider value.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.