eu.beesoft.gantt.action
Class AbstractZoomAction
java.lang.Object
javax.swing.AbstractAction
eu.beesoft.gantt.action.AbstractGanttAction
eu.beesoft.gantt.action.AbstractZoomAction
- All Implemented Interfaces:
- LanguageListener, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
- Direct Known Subclasses:
- ZoomInAction, ZoomOutAction
public abstract class AbstractZoomAction
- extends AbstractGanttAction
Abstract action to support zoom operations.
- See Also:
- Serialized Form
Fields inherited from class javax.swing.AbstractAction |
enabled, changeSupport |
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractZoomAction
public AbstractZoomAction(JGantt gantt)
- Constructor.
- Parameters:
gantt
- -
JGantt instance to which this action belongs
getZoomPolicy
protected ZoomPolicy getZoomPolicy()
- Returns
ZoomPolicy
from ChartComponent
.
- Returns:
- current zoom policy
getZoomStep
protected int getZoomStep()
- Returns current index in
ZoomPolicy
steps.
- Returns:
- current index in zoom policy steps
executeAction
protected final boolean executeAction(java.awt.event.ActionEvent event,
UndoStep undo)
- Obtains next zoom policy step index from method
zoom(int, int)
and updates
chart.
- Specified by:
executeAction
in class AbstractGanttAction
- Parameters:
event
- - event that invoked this actionundo
- - register for undo / redo operations
- Returns:
- true if action finished successfully
zoom
protected abstract int zoom(int currentStep,
int stepCount)
- Returns the next step in the zoom action.
- Parameters:
currentStep
- - current index of step in the ZoomPolicy instancestepCount
- - total number of steps in the ZoomPolicy instance
- Returns:
- next step index