info.bioinfweb.treegraph.gui.actions
Class DocumentAction
java.lang.Object
javax.swing.AbstractAction
info.bioinfweb.treegraph.gui.actions.TreeGraphAction
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
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 |
mainFrame
private MainFrame mainFrame
DocumentAction
public DocumentAction(MainFrame mainFrame)
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)