Home / Development / Documentation / 2.0.44 / DocumentAction
TreeGraph 2
 


info.bioinfweb.treegraph.gui.actions
Class DocumentAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by info.bioinfweb.treegraph.gui.actions.TreeGraphAction
          extended by info.bioinfweb.treegraph.gui.actions.DocumentAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
AbstractSelectionAction, AutoPositionLabelsAction, ChangePainterIDAction, CloseAction, CollapseNodeAction, CopyAllLabelsAction, CopyElementAction, DeleteColumnAction, DeleteElementAction, DeleteSubelementsAction, EditDialogAction, ExitAction, ExportToPDFAction, ImportTableAction, LadderizeAction, MoveSubtreeAction, NewDocumentAction, NewLegendAction, NewNodeAction, NextDocumentAction, PasteAction, PreviousDocumentAction, ReanchorLegendAction, RedoAction, RerootAction, SaveAction, SaveAsAction, SearchTextAction, SeparateBranchAction, SetColumnTypeAction, SetZoomAction, ShowHideScaleBarAction, ShowRootedAction, UndoAction, UndoRedoToAction

public abstract class DocumentAction
extends TreeGraphAction

Implements basic functionality for all actions in TreeGraph 2 which are applied on opened documents. All subclasses have access

Author:
Ben Stöver
See Also:
Serialized Form

Field Summary
private  MainFrame mainFrame
           
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
DocumentAction(MainFrame mainFrame)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
          Determines the currently active internal frame and passes it to onActionPerformed(ActionEvent, TreeInternalFrame).
protected  MainFrame getMainFrame()
           
protected abstract  void onActionPerformed(ActionEvent e, TreeInternalFrame frame)
          Subclasses should implement this method instead of overriding actionPerformed(ActionEvent).
protected static boolean oneElementSelected(TreeSelection selection)
          Tests if exactly one element (not none and not more) is contained in the given selection.
abstract  void setEnabled(Document document, TreeSelection selection, NodeBranchDataAdapter tableAdapter)
           
 
Methods inherited from class info.bioinfweb.treegraph.gui.actions.TreeGraphAction
loadSymbols
 
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
 

Field Detail

mainFrame

private MainFrame mainFrame
Constructor Detail

DocumentAction

public DocumentAction(MainFrame mainFrame)
Method Detail

onActionPerformed

protected abstract void onActionPerformed(ActionEvent e,
                                          TreeInternalFrame frame)
Subclasses should implement this method instead of overriding actionPerformed(ActionEvent).

Parameters:
e -
frame - the internal frame which was active while the user performed this action

setEnabled

public abstract void setEnabled(Document document,
                                TreeSelection selection,
                                NodeBranchDataAdapter tableAdapter)

oneElementSelected

protected static boolean oneElementSelected(TreeSelection selection)
Tests if exactly one element (not none and not more) is contained in the given selection.

Parameters:
selection -
Returns:

getMainFrame

protected MainFrame getMainFrame()

actionPerformed

public void actionPerformed(ActionEvent e)
Determines the currently active internal frame and passes it to onActionPerformed(ActionEvent, TreeInternalFrame). If no active frame is found an error message is displayed and onActionPerformed(ActionEvent, TreeInternalFrame) is not called.

See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)