Package org.eclipse.nebula.effects.stw
Interface Transitionable
-
- All Known Subinterfaces:
ImageTransitionable
public interface TransitionableObject implementing this interface enables theTransitionManagerto 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 aTransitionManagereither 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 ofControlobjects of at least oneControlobject. EachControlobject has an index that's used to get and set the current viewedControlobject using thegetSelection()andsetSelection(int)method. The index is also used to get the correspondingControlobject usinggetControl(int)method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddSelectionListener(org.eclipse.swt.events.SelectionListener listener)This method is called once by theTransitionManager's constructor to add aSelectionListenerto the "transitionable" widget to start the transition effect whenever the widget is selected.org.eclipse.swt.widgets.CompositegetComposite()returns theCompositeat which the transition should be shown.org.eclipse.swt.widgets.ControlgetControl(int index)returns theControlobject at index indexdoublegetDirection(int toIndex, int fromIndex)should compare toIndex with fromIndex and return the required direction of the transition.intgetSelection()returns the index of the current selectedControlobjectvoidsetSelection(int index)sets the current selectedControlobject
-
-
-
Method Detail
-
addSelectionListener
void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
This method is called once by theTransitionManager's constructor to add aSelectionListenerto the "transitionable" widget to start the transition effect whenever the widget is selected.- Parameters:
listener- theSelectionListenerinstance provided by theTransitionManager
-
getControl
org.eclipse.swt.widgets.Control getControl(int index)
returns theControlobject at index index- Parameters:
index- the index of theControlobject to return- Returns:
- the
Controlobject at the specified index
-
getComposite
org.eclipse.swt.widgets.Composite getComposite()
returns theCompositeat which the transition should be shown. It could be considered the composite that contains allControlobjects.- Returns:
- the composite at which the transition should be shown
-
getSelection
int getSelection()
returns the index of the current selectedControlobject- Returns:
- the index of the current selected
Controlobject
-
setSelection
void setSelection(int index)
sets the current selectedControlobject- Parameters:
index- the index of theControlobject 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 theControlobject to make transition tofromIndex- index of theControlobject to make transition from- Returns:
- the required direction
-
-