Package adams.gui.menu
Class ActorUsage
- java.lang.Object
-
- adams.gui.application.AbstractMenuItemDefinition
-
- adams.gui.application.AbstractBasicMenuItemDefinition
-
- adams.gui.menu.ActorUsage
-
- All Implemented Interfaces:
Serializable
,Comparable<AbstractMenuItemDefinition>
public class ActorUsage extends AbstractBasicMenuItemDefinition
Scans a user-selected directory for flows and analyzes/displays the actor usage. It also allows the user to edit selected flows.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected FlowEditorPanel
m_FlowEditor
the flow editor for displaying flows.-
Fields inherited from class adams.gui.application.AbstractMenuItemDefinition
CATEGORY_HELP, CATEGORY_MACHINELEARNING, CATEGORY_MAINTENANCE, CATEGORY_PROGRAM, CATEGORY_TOOLS, CATEGORY_VISUALIZATION, CATEGORY_WIZARD, m_Owner
-
-
Constructor Summary
Constructors Constructor Description ActorUsage()
Initializes the menu item.ActorUsage(AbstractApplicationFrame owner)
Initializes the menu item.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PlaceholderDirectory
chooseDir()
Lets the user choose the directory with the flows.protected SpreadSheet
determineUsage(PlaceholderDirectory dir)
Generates the spreadsheet with the actor usage.protected void
displayUsage(SpreadSheet sheet)
Displays the actor usage.String
getCategory()
Returns the category of the menu item in which it should appear, i.e., the name of the menu.String
getIconName()
Returns the file name of the icon.String
getTitle()
Returns the title of the window (and text of menuitem).UserMode
getUserMode()
Returns the user mode, which determines visibility as well.protected void
initialize()
Initializes the members.boolean
isSingleton()
Whether the panel can only be displayed once.void
launch()
Launches the functionality of the menu item.-
Methods inherited from class adams.gui.application.AbstractBasicMenuItemDefinition
getMenuItem, getUseThread, postLaunch, preLaunch
-
Methods inherited from class adams.gui.application.AbstractMenuItemDefinition
compareTo, createChildFrame, createChildFrame, equals, forCommandLine, forName, getActualCategory, getIcon, getLogger, getOwner, isAvailable, requiresRestartableApplication, setOwner
-
-
-
-
Field Detail
-
m_FlowEditor
protected FlowEditorPanel m_FlowEditor
the flow editor for displaying flows.
-
-
Constructor Detail
-
ActorUsage
public ActorUsage()
Initializes the menu item.
-
ActorUsage
public ActorUsage(AbstractApplicationFrame owner)
Initializes the menu item.- Parameters:
owner
- the owning application
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractMenuItemDefinition
-
getTitle
public String getTitle()
Returns the title of the window (and text of menuitem).- Specified by:
getTitle
in classAbstractMenuItemDefinition
- Returns:
- the title
-
getIconName
public String getIconName()
Returns the file name of the icon.- Overrides:
getIconName
in classAbstractMenuItemDefinition
- Returns:
- the filename or null if no icon available
-
getUserMode
public UserMode getUserMode()
Returns the user mode, which determines visibility as well.- Specified by:
getUserMode
in classAbstractMenuItemDefinition
- Returns:
- the user mode
-
getCategory
public String getCategory()
Returns the category of the menu item in which it should appear, i.e., the name of the menu.- Specified by:
getCategory
in classAbstractMenuItemDefinition
- Returns:
- the category/menu name
-
chooseDir
protected PlaceholderDirectory chooseDir()
Lets the user choose the directory with the flows.- Returns:
- the directory, null if dialog canceled
-
determineUsage
protected SpreadSheet determineUsage(PlaceholderDirectory dir)
Generates the spreadsheet with the actor usage.- Parameters:
dir
- the directory to inspect- Returns:
- the spreadsheet, null if failed to generate
-
displayUsage
protected void displayUsage(SpreadSheet sheet)
Displays the actor usage.- Parameters:
sheet
- the sheet with the usage
-
launch
public void launch()
Launches the functionality of the menu item.- Specified by:
launch
in classAbstractBasicMenuItemDefinition
-
isSingleton
public boolean isSingleton()
Whether the panel can only be displayed once.- Specified by:
isSingleton
in classAbstractMenuItemDefinition
- Returns:
- true if the panel can only be displayed once
-
-