|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.gui.swt.graph.TENSlider
This class is a simple wrapper around the SWT widget .
It provides extra useful methods like:
Slider
This class implements an internal selection listener used in order to
retrieve the Slider's drag orientation and to know whether or not a Drag is
being performed at a given time. This is required because while the
informs the user that a drag is being performed, there is no easy mean to
know the direction of the drag.
Slider
| Field Summary | |
static int |
DRAG_ORIENTATION_DECREMENT
The drag orientation is from bottom to top for vertical sliders, or right to left for horizontal sliders. |
static int |
DRAG_ORIENTATION_INCREMENT
The drag orientation is from top to bottom for vertical sliders, or left to right for horizontal sliders. |
static int |
DRAG_ORIENTATION_NONE
The drag orientation could not be defined. |
| Constructor Summary | |
TENSlider(org.eclipse.swt.widgets.Composite parent,
int style)
Initializes the local instance this class
is a wrapper of and adds a selection listener to it.
|
|
TENSlider(org.eclipse.swt.widgets.Composite parent,
int style,
int selection,
int extent,
int min,
int max)
TODO SGu (12.07.2005): Comment constructor |
|
| Method Summary | |
void |
addListener(int arg0,
org.eclipse.swt.widgets.Listener arg1)
See
|
void |
addSelectionListener(org.eclipse.swt.events.SelectionListener arg0)
Adds the passed selection listener to the internal
instance. |
void |
dispose()
Disposes allocated resources. |
int |
getDragDecrementValue()
Useful when the slider's thumb is being dragged, this method returns the drag decrement value. |
int |
getDragIncrementValue()
Useful when the slider's thumb is being dragged, this method returns the drag increment value. |
int |
getDragOrientation()
Useful when the slider's thumb is being dragged, this method returns the drag orientation. |
int |
getIncrement()
Returns the local instance's Increment
value. |
int |
getMaximum()
Returns the maximum as understood by the view. |
int |
getMinimum()
Returns the minimum as understood by the view - this value can be negative (contrary to the slider ones which cannot) |
int |
getPageIncrement()
Returns the local instance's Page
Increment value. |
int |
getSelection()
The selection on this TENSlider (can be negative). |
int |
getSwtSliderThumb()
Returns the local slider instance's thumb value. |
boolean |
isCurrentlyPerformingDrag()
Returns true if the slider's thumb is being dragged. |
void |
refreshSliderSelection()
|
void |
removeListener(int eventType,
org.eclipse.swt.widgets.Listener listener)
Removes the listener from the collection of listeners who will be notifed when an event of the given type occurs. |
void |
removeSelectionListener(org.eclipse.swt.events.SelectionListener arg0)
Removes the passed . |
boolean |
selectionChanged()
TODO SGu (07.07.2005): Comment method |
void |
setEnabled(boolean enabled)
Enables the receiver if the argument is true, and
disables it otherwise. |
void |
setLayoutData(java.lang.Object arg0)
See
|
void |
setMinAndMax(int min,
int max)
Because of the offset if the minimum is set to a negative value we need to set the minimum first, then the maximum. |
void |
setRangeProperties(int newValue,
int newExtent,
int newMin,
int newMax,
int newIncrement,
int newPageIncrement,
boolean adjusting)
TODO SGu (12.07.2005): Comment method |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int DRAG_ORIENTATION_NONE
public static final int DRAG_ORIENTATION_INCREMENT
public static final int DRAG_ORIENTATION_DECREMENT
| Constructor Detail |
public TENSlider(org.eclipse.swt.widgets.Composite parent,
int style)
Initializes the local instance this class
is a wrapper of and adds a selection listener to it.
Properties are set using the following default values:
Slider
selection = 0
extent = 0
minimum = 0
maximum = 100
parent - a composite control which will be the parent of the new
instance (cannot be null)style - the style of control to construct
public TENSlider(org.eclipse.swt.widgets.Composite parent,
int style,
int selection,
int extent,
int min,
int max)
TODO SGu (12.07.2005): Comment constructor
parent - a composite control which will be the parent of the new
instance (cannot be null)style - the style of control to constructselection - the slider valueextent - the amount by which the value can "jump"min - the minimum valuemax - the maximum value| Method Detail |
public final int getDragOrientation()
Useful when the slider's thumb is being dragged, this method returns the drag orientation.
DRAG_ORIENTATION_NONE,DRAG_ORIENTATION_INCREMENT
or DRAG_ORIENTATION_DECREMENTpublic final int getDragIncrementValue()
Useful when the slider's thumb is being dragged, this method returns the drag increment value.
public final int getDragDecrementValue()
Useful when the slider's thumb is being dragged, this method returns the drag decrement value.
public void addSelectionListener(org.eclipse.swt.events.SelectionListener arg0)
Slider
instance.
arg0 - the SelectionListener to setSlider.addSelectionListener(org.eclipse.swt.events.SelectionListener)public int getIncrement()
Slider instance's Increment
value.
Slider instance's Increment
value.Slider.getIncrement()public int getMaximum()
Slider instance !!.
Slider.getMaximum()public int getMinimum()
Slider.getMinimum()public int getPageIncrement()
Slider instance's Page
Increment value.
Slider instance's Page
Increment value.Slider.getPageIncrement()public int getSelection()
The selection on this TENSlider (can be negative). Attention. THIS IS
NOT the selection on the local instance.
Slider
Slider
instance.public int getSwtSliderThumb()
Slider.getThumb()public void removeSelectionListener(org.eclipse.swt.events.SelectionListener arg0)
SelectionListener.
arg0 - the SelectionListener to removeSlider.removeSelectionListener(org.eclipse.swt.events.SelectionListener)
public void removeListener(int eventType,
org.eclipse.swt.widgets.Listener listener)
eventType - the type of event to listen forlistener - the listener which should no longer be notified when the event
occurs
public void setMinAndMax(int min,
int max)
Because of the offset if the minimum is set to a negative value we need to set the minimum first, then the maximum. Hence this method which forces it.
min - the slider's minimum value. Should be the dame as the
CompositeView's scrollbar minimum value.max - the slider's maximum value. Should be the dame as the
CompositeView's scrollbar maximum value.public void setEnabled(boolean enabled)
true, and
disables it otherwise. A disabled control is typically not selectable
from the user interface and draws with an inactive or "grayed" look.
enabled - the new enabled statepublic void setLayoutData(java.lang.Object arg0)
See Control.setLayoutData(java.lang.Object)
arg0 - the new layout data for the receiver.
public void addListener(int arg0,
org.eclipse.swt.widgets.Listener arg1)
See Widget.addListener(int, org.eclipse.swt.widgets.Listener)
arg0 - the type of event to listen forarg1 - the listener which should be notified when the event occurspublic void refreshSliderSelection()
public boolean isCurrentlyPerformingDrag()
public void dispose()
Disposes allocated resources.
public final boolean selectionChanged()
TODO SGu (07.07.2005): Comment method
public java.lang.String toString()
public void setRangeProperties(int newValue,
int newExtent,
int newMin,
int newMax,
int newIncrement,
int newPageIncrement,
boolean adjusting)
TODO SGu (12.07.2005): Comment method
newValue - newExtent - newMin - newMax - newIncrement - newPageIncrement - adjusting -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||