Package adams.gui.flow.menu
Class AbstractFlowEditorMenuItem
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.gui.flow.menu.AbstractFlowEditorMenuItem
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,Serializable
,Comparable<AbstractFlowEditorMenuItem>
- Direct Known Subclasses:
ShowTriggers
public abstract class AbstractFlowEditorMenuItem extends LoggingObject implements Comparable<AbstractFlowEditorMenuItem>
Ancestor for additional menu items in the flow editor.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractBaseAction
m_Action
the underlying action.protected FlowEditorPanel
m_Owner
the owner.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractFlowEditorMenuItem()
Initializes the menu item.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(AbstractFlowEditorMenuItem o)
Compares this object with the specified object for order.boolean
equals(Object o)
Returns whether the two objects are the same.AbstractBaseAction
getAction()
Returns the action to add to the flow editor menu.abstract String
getMenu()
Returns the name of the menu to list this item under.static Class[]
getMenuItems()
Returns a list with classnames of menu items.FlowEditorPanel
getOwner()
Returns the owner.protected void
initialize()
Initializes the menu item.protected abstract AbstractBaseAction
newAction()
Creates the action to use.void
setOwner(FlowEditorPanel value)
Sets the owning flow editor.abstract void
updateAction()
Updating the action, based on the current status of the owner.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Owner
protected FlowEditorPanel m_Owner
the owner.
-
m_Action
protected AbstractBaseAction m_Action
the underlying action.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the menu item.
-
newAction
protected abstract AbstractBaseAction newAction()
Creates the action to use.- Returns:
- the action
-
setOwner
public void setOwner(FlowEditorPanel value)
Sets the owning flow editor.- Parameters:
value
- the owner
-
getOwner
public FlowEditorPanel getOwner()
Returns the owner.- Returns:
- the owner, null if none set
-
getMenu
public abstract String getMenu()
Returns the name of the menu to list this item under.- Returns:
- the name of the menu
- See Also:
FlowEditorPanel.MENU_FILE
,FlowEditorPanel#MENU_DEBUG
,FlowEditorPanel.MENU_RUN
,FlowEditorPanel.MENU_VIEW
,FlowEditorPanel.MENU_WINDOW
-
getAction
public AbstractBaseAction getAction()
Returns the action to add to the flow editor menu.- Returns:
- the action to add
-
updateAction
public abstract void updateAction()
Updating the action, based on the current status of the owner.
-
compareTo
public int compareTo(AbstractFlowEditorMenuItem o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Uses the name of the menu item text for comparison.- Specified by:
compareTo
in interfaceComparable<AbstractFlowEditorMenuItem>
- Parameters:
o
- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
-
equals
public boolean equals(Object o)
Returns whether the two objects are the same.
Only compares the menu item text of the two objects.
-
getMenuItems
public static Class[] getMenuItems()
Returns a list with classnames of menu items.- Returns:
- the menu item classnames
-
-