eu.beesoft.gantt.action
Class AbstractZoomAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by eu.beesoft.gantt.action.AbstractGanttAction
          extended by 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

Field Summary
 
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
 
Constructor Summary
AbstractZoomAction(JGantt gantt)
          Constructor.
 
Method Summary
protected  boolean executeAction(java.awt.event.ActionEvent event, UndoStep undo)
          Obtains next zoom policy step index from method zoom(int, int) and updates chart.
protected  ZoomPolicy getZoomPolicy()
          Returns ZoomPolicy from ChartComponent.
protected  int getZoomStep()
          Returns current index in ZoomPolicy steps.
protected abstract  int zoom(int currentStep, int stepCount)
          Returns the next step in the zoom action.
 
Methods inherited from class eu.beesoft.gantt.action.AbstractGanttAction
actionPerformed, getGantt, getTextFromResourceBundle, languageChanged
 
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
 

Constructor Detail

AbstractZoomAction

public AbstractZoomAction(JGantt gantt)
Constructor.

Parameters:
gantt - - JGantt instance to which this action belongs
Method Detail

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 action
undo - - 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 instance
stepCount - - total number of steps in the ZoomPolicy instance
Returns:
next step index