Package org.eclipse.nebula.effects.stw
Interface Transitionable
- All Known Subinterfaces:
ImageTransitionable
public interface Transitionable
Object implementing this interface enables the
A "transitionable" widget is a widget that can provide a set of methods to a
A "transitionable" widget is supposed to have a list of
TransitionManager
to carry out transition effects either on it or on the object it's delegate for.A "transitionable" widget is a widget that can provide a set of methods to a
TransitionManager
either through direct implementation of this interface or through
delegation by providing a delegate object implementing this interface.A "transitionable" widget is supposed to have a list of
Control
objects of at
least one Control
object. Each Control
object has an index that's used
to get and set the current viewed Control
object using the getSelection()
and setSelection(int)
method. The index is also used to get the
corresponding Control
object using getControl(int)
method.-
Method Summary
Modifier and Type Method Description void
addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
This method is called once by theTransitionManager
's constructor to add aSelectionListener
to the "transitionable" widget to start the transition effect whenever the widget is selected.org.eclipse.swt.widgets.Composite
getComposite()
returns theComposite
at which the transition should be shown.org.eclipse.swt.widgets.Control
getControl(int index)
returns theControl
object at index indexdouble
getDirection(int toIndex, int fromIndex)
should compare toIndex with fromIndex and return the required direction of the transition.int
getSelection()
returns the index of the current selectedControl
objectvoid
setSelection(int index)
sets the current selectedControl
object
-
Method Details
-
addSelectionListener
void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)This method is called once by theTransitionManager
's constructor to add aSelectionListener
to the "transitionable" widget to start the transition effect whenever the widget is selected.- Parameters:
listener
- theSelectionListener
instance provided by theTransitionManager
-
getControl
org.eclipse.swt.widgets.Control getControl(int index)returns theControl
object at index index- Parameters:
index
- the index of theControl
object to return- Returns:
- the
Control
object at the specified index
-
getComposite
org.eclipse.swt.widgets.Composite getComposite()returns theComposite
at which the transition should be shown. It could be considered the composite that contains allControl
objects.- Returns:
- the composite at which the transition should be shown
-
getSelection
int getSelection()returns the index of the current selectedControl
object- Returns:
- the index of the current selected
Control
object
-
setSelection
void setSelection(int index)sets the current selectedControl
object- Parameters:
index
- the index of theControl
object to be set as the current selection
-
getDirection
double getDirection(int toIndex, int fromIndex)should compare toIndex with fromIndex and return the required direction of the transition.- Parameters:
toIndex
- index of theControl
object to make transition tofromIndex
- index of theControl
object to make transition from- Returns:
- the required direction
-