Package adams.flow.sink
Class DisplayPanelManager
-
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<Actor>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,TextSupporter
,VariablesInspectionHandler
,VariableChangeListener
,Actor
,DisplayTypeSupporter
,ErrorHandler
,InputConsumer
,ComponentSupplier
,TextSupplier
,MenuBarProvider
,SendToActionSupporter
,Serializable
,Comparable
public class DisplayPanelManager extends AbstractDisplay implements MenuBarProvider, ComponentSupplier, TextSupplier, SendToActionSupporter
Actor that displays a 'history' of panels created by the selected panel provider. The provider can be an actor that generates classifier errors, for instance.
Input/output:
- accepts:
java.lang.String
java.io.File
java.awt.image.BufferedImage
adams.data.image.AbstractImageContainer
adams.data.image.BufferedImageSupporter
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING min-user-mode: Expert
-name <java.lang.String> (property: name) The name of the actor. default: DisplayPanelManager
-annotation <adams.core.base.BaseAnnotation> (property: annotations) The annotations to attach to this actor. default:
-skip <boolean> (property: skip) If set to true, transformation is skipped and the input token is just forwarded as it is. default: false
-stop-flow-on-error <boolean> (property: stopFlowOnError) If set to true, the flow execution at this level gets stopped in case this actor encounters an error; the error gets propagated; useful for critical actors. default: false min-user-mode: Expert
-silent <boolean> (property: silent) If enabled, then no errors are output in the console; Note: the enclosing actor handler must have this enabled as well. default: false min-user-mode: Expert
-short-title <boolean> (property: shortTitle) If enabled uses just the name for the title instead of the actor's full name. default: false
-display-type <adams.flow.core.displaytype.AbstractDisplayType> (property: displayType) Determines how to show the display, eg as standalone frame (default) or in the Flow editor window. default: adams.flow.core.displaytype.Default
-width <int> (property: width) The width of the dialog. default: 640 minimum: -1
-height <int> (property: height) The height of the dialog. default: 480 minimum: -1
-x <int> (property: x) The X position of the dialog (>=0: absolute, -1: left, -2: center, -3: right ). default: -1 minimum: -3
-y <int> (property: y) The Y position of the dialog (>=0: absolute, -1: top, -2: center, -3: bottom ). default: -1 minimum: -3
-divider-location <int> (property: dividerLocation) The position for the divider in pixels. default: -1 minimum: -1
-provider <adams.flow.sink.DisplayPanelProvider> (property: panelProvider) The actor for generating the display panels. default: adams.flow.sink.ImageViewer -display-type adams.flow.core.displaytype.Default -writer adams.gui.print.NullWriter -selection-processor adams.gui.visualization.image.selection.NullProcessor -left-click-processor adams.gui.visualization.image.leftclick.NullProcessor -selection-shape-painter adams.gui.visualization.image.selectionshape.RectanglePainter -image-overlay adams.gui.visualization.image.NullOverlay
-num-tokens <int> (property: numTokens) The number of tokens to accept per created panel. default: 1 minimum: -1
-entry-name-variable <adams.core.VariableNameNoUpdate> (property: entryNameVariable) The variable to use for naming the entries; gets ignored if variable not available; an existing history entry gets replaced if a new one with the same name gets added. default: entryNameVariable
-allow-merge <boolean> (property: allowMerge) If enabled and the display panel is derived from adams.flow.sink.MergeableDisplayPanel then entries with the same name (ie when using 'entryNameVariable') get merged. default: false
-allow-search <boolean> (property: allowSearch) Whether to allow the user to search the entries. default: false
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DisplayPanelManager.DisplayPanelHistoryPanel
A history panel that keeps track of named DisplayPanel objects, e.g., containing experiments results.static class
DisplayPanelManager.HistorySplitPanel
Represents a panel with a history on the left and the displayed panel on the right.
-
Field Summary
Fields Modifier and Type Field Description static String
BACKUP_CURRENTCOUNT
the key for storing the current count in the backup.static String
BACKUP_CURRENTPANEL
the key for storing the current panel in the backup.protected boolean
m_AllowMerge
whether to allow merging of panel content.protected boolean
m_AllowSearch
whether to allow searching.protected JComponentWriterFileChooser
m_ComponentFileChooser
the filedialog for loading/saving flows.protected int
m_CurrentCount
the current count of tokens.protected DisplayPanel
m_CurrentPanel
the current panel, if any.protected int
m_DividerLocation
the position for the left divider.protected VariableNameNoUpdate
m_EntryNameVariable
the variable to use for naming the entries.protected DisplayPanelManager.HistorySplitPanel
m_HistoryPanel
the history panel.protected JMenuBar
m_MenuBar
the menu bar, if used.protected JMenuItem
m_MenuItemFileClear
the "clear" menu item.protected JMenuItem
m_MenuItemFileClose
the "exit" menu item.protected JMenuItem
m_MenuItemFileSaveAs
the "save as" menu item.protected JMenuItem
m_MenuItemFlowPauseResume
the "pause/resume" menu item.protected JMenuItem
m_MenuItemFlowStop
the "stop" menu item.protected int
m_NumTokens
the number of tokens to accept for a single panel.protected DisplayPanelProvider
m_PanelProvider
the actor to use for generating panels.protected boolean
m_ShowFlowControlSubMenu
whether to show flow control sub-menu.protected TextFileChooser
m_TextFileChooser
the filedialog for loading/saving flows.-
Fields inherited from class adams.flow.core.AbstractDisplay
BACKUP_INPUT, m_CreateFrame, m_DisplayType, m_Frame, m_Height, m_InputToken, m_KeepOpen, m_Panel, m_ShortTitle, m_Updating, m_Width, m_X, m_Y
-
Fields inherited from class adams.flow.core.AbstractActor
m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_ExecutionListeningSupporter, m_FullName, m_LoggingPrefix, m_Name, m_Parent, m_ScopeHandler, m_Self, m_Silent, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.flow.core.Actor
FILE_EXTENSION, FILE_EXTENSION_GZ
-
-
Constructor Summary
Constructors Constructor Description DisplayPanelManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class[]
accepts()
Returns the class that the consumer accepts.String
allowMergeTipText()
Returns the tip text for this property.String
allowSearchTipText()
Returns the tip text for this property.protected Hashtable<String,Object>
backupState()
Backs up the current state of the actor before update the variables.protected boolean
canPauseOrResume()
Returns whether the flow can be paused/resumed.protected void
cleanUpGUI()
Removes all graphical components.protected void
clear()
Clears the display.void
clearPanel()
Clears the content of the panel.protected void
close()
Closes the dialog or frame.protected JMenuBar
createMenuBar()
Assembles the menu bar.void
defineOptions()
Adds options to the internal list of options.protected void
display(Token token)
Displays the token (the panel and dialog have already been created at this stage).String
dividerLocationTipText()
Returns the tip text for this property.protected BaseFrame
doCreateFrame(BasePanel panel)
Creates the actual frame.String
entryNameVariableTipText()
Returns the tip text for this property.protected void
forceVariables(Variables value)
Updates the Variables instance in use.boolean
getAllowMerge()
Returns whether to enable merging of panel content in case of same name.boolean
getAllowSearch()
Returns whether to allow the user to search the entries.protected JComponentWriterFileChooser
getComponentFileChooser()
Returns (and initializes if necessary) the file chooser for the components.String
getCustomSupplyTextMenuItemCaption()
Returns the text for the menu item.ExtensionFileFilter
getCustomTextFileFilter()
Returns a custom file filter for the file chooser.protected int
getDefaultHeight()
Returns the default height for the dialog.protected int
getDefaultWidth()
Returns the default width for the dialog.int
getDividerLocation()
Returns the position for the left divider in pixels.VariableNameNoUpdate
getEntryNameVariable()
Returns the variable name which value gets used to name the entries.JMenuBar
getMenuBar()
Creates a menu bar (singleton per panel object).int
getNumTokens()
Returns the number of tokens to accept per panel before creating a new panel.DisplayPanelProvider
getPanelProvider()
Returns the panel provider in use for generating the panels.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.protected JPanel
getSelectedPanel()
Returns the currently selected panel.Class[]
getSendToClasses()
Returns the classes that the supporter generates.Object
getSendToItem(Class[] cls)
Returns the object to send.boolean
getShowFlowControlSubMenu()
Returns whether to show a flow control sub-menu in the menubar.protected TextFileChooser
getTextFileChooser()
Returns (and initializes if necessary) the file chooser for the text.String
globalInfo()
Returns a string describing the object.boolean
hasSendToItem(Class[] cls)
Checks whether something to send is available.protected boolean
isPaused()
Returns whether the flow is currently paused.protected BasePanel
newPanel()
Creates the panel to display in the dialog.String
numTokensTipText()
Returns the tip text for this property.String
panelProviderTipText()
Returns the tip text for this property.protected void
pauseResumeFlow()
Pauses or resumes the flow.protected void
pruneBackup()
Removes entries from the backup.protected void
reset()
Resets the object.protected void
restoreState(Hashtable<String,Object> state)
Restores the state of the actor before the variables got updated.protected void
saveAs()
Saves the setups.void
setAllowMerge(boolean value)
Sets whether to enable merging of panel content in case of same name.void
setAllowSearch(boolean value)
Sets whether to allow the user to search the entries.void
setDividerLocation(int value)
Sets the position for the left divider in pixels.void
setEntryNameVariable(VariableNameNoUpdate value)
Sets the variable name which value gets used to name the entries.void
setNumTokens(int value)
Sets the number of tokens to accept per panel before creating a new panel.void
setPanelProvider(DisplayPanelProvider value)
Sets the panel provider to use for generating the panels.void
setShowFlowControlSubMenu(boolean value)
Sets whether to show a flow control sub-menu in the menubar.String
showFlowControlSubMenuTipText()
Returns the tip text for this property.protected void
stopFlow()
Stops the flow.JComponent
supplyComponent()
Returns the current panel.String
supplyText()
Supplies the text.protected void
updateMenu()
updates the enabled state of the menu items.void
wrapUp()
Cleans up after the execution has finished.-
Methods inherited from class adams.flow.sink.AbstractDisplay
newDisplayRunnable, postDisplay, preDisplay
-
Methods inherited from class adams.flow.core.AbstractDisplay
cleanUp, cleanUpGUIKeepOpen, closeFrame, createFrame, createTitle, currentInput, deregisterInWrapUp, deregisterWindow, deregisterWithEditor, displayTypeTipText, doExecute, getCreateFrame, getDefaultDisplayType, getDefaultShortTitle, getDefaultX, getDefaultY, getDisplayType, getFrame, getFrameDefaultCloseOperation, getHeight, getKeepOpen, getPanel, getShortTitle, getWidth, getX, getY, hasInput, heightTipText, initialize, input, postCreateFrame, preCreateFrame, registerWindow, registerWithEditor, setCreateFrame, setDisplayType, setHeight, setKeepOpen, setShortTitle, setWidth, setX, setY, shortTitleTipText, stopExecution, widthTipText, xTipText, yTipText
-
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, canInspectOptions, canPerformSetUpCheck, compareTo, configureLogger, destroy, equals, execute, finalUpdateVariables, findVariables, findVariables, forCommandLine, forName, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, performVariableChecks, postExecute, preExecute, pruneBackup, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setUp, setVariables, shallowCopy, shallowCopy, silentTipText, sizeOf, skipTipText, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.flow.core.Actor
cleanUp, compareTo, destroy, equals, execute, findVariables, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, isExecuted, isFinished, isHeadless, isStopped, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setUp, setVariables, shallowCopy, shallowCopy, sizeOf, stopExecution, stopExecution, toCommandLine, variableChanged
-
Methods inherited from interface adams.core.AdditionalInformationHandler
getAdditionalInformation
-
Methods inherited from interface adams.flow.core.InputConsumer
currentInput, hasInput, input
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager
-
Methods inherited from interface adams.core.VariablesInspectionHandler
canInspectOptions
-
-
-
-
Field Detail
-
BACKUP_CURRENTCOUNT
public static final String BACKUP_CURRENTCOUNT
the key for storing the current count in the backup.- See Also:
- Constant Field Values
-
BACKUP_CURRENTPANEL
public static final String BACKUP_CURRENTPANEL
the key for storing the current panel in the backup.- See Also:
- Constant Field Values
-
m_HistoryPanel
protected DisplayPanelManager.HistorySplitPanel m_HistoryPanel
the history panel.
-
m_DividerLocation
protected int m_DividerLocation
the position for the left divider.
-
m_PanelProvider
protected DisplayPanelProvider m_PanelProvider
the actor to use for generating panels.
-
m_EntryNameVariable
protected VariableNameNoUpdate m_EntryNameVariable
the variable to use for naming the entries.
-
m_NumTokens
protected int m_NumTokens
the number of tokens to accept for a single panel.
-
m_ShowFlowControlSubMenu
protected boolean m_ShowFlowControlSubMenu
whether to show flow control sub-menu.
-
m_MenuBar
protected JMenuBar m_MenuBar
the menu bar, if used.
-
m_MenuItemFileClear
protected JMenuItem m_MenuItemFileClear
the "clear" menu item.
-
m_MenuItemFileSaveAs
protected JMenuItem m_MenuItemFileSaveAs
the "save as" menu item.
-
m_MenuItemFileClose
protected JMenuItem m_MenuItemFileClose
the "exit" menu item.
-
m_MenuItemFlowPauseResume
protected JMenuItem m_MenuItemFlowPauseResume
the "pause/resume" menu item.
-
m_MenuItemFlowStop
protected JMenuItem m_MenuItemFlowStop
the "stop" menu item.
-
m_ComponentFileChooser
protected transient JComponentWriterFileChooser m_ComponentFileChooser
the filedialog for loading/saving flows.
-
m_TextFileChooser
protected transient TextFileChooser m_TextFileChooser
the filedialog for loading/saving flows.
-
m_CurrentCount
protected int m_CurrentCount
the current count of tokens.
-
m_CurrentPanel
protected DisplayPanel m_CurrentPanel
the current panel, if any.
-
m_AllowMerge
protected boolean m_AllowMerge
whether to allow merging of panel content.
-
m_AllowSearch
protected boolean m_AllowSearch
whether to allow searching.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractDisplay
-
reset
protected void reset()
Resets the object.- Overrides:
reset
in classAbstractDisplay
-
pruneBackup
protected void pruneBackup()
Removes entries from the backup.- Overrides:
pruneBackup
in classAbstractActor
- See Also:
AbstractActor.reset()
-
backupState
protected Hashtable<String,Object> backupState()
Backs up the current state of the actor before update the variables.- Overrides:
backupState
in classAbstractDisplay
- Returns:
- the backup
- See Also:
AbstractActor.updateVariables()
,AbstractActor.restoreState(Hashtable)
-
restoreState
protected void restoreState(Hashtable<String,Object> state)
Restores the state of the actor before the variables got updated.- Overrides:
restoreState
in classAbstractDisplay
- Parameters:
state
- the backup of the state to restore from- See Also:
AbstractActor.updateVariables()
,AbstractActor.backupState()
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceActor
- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractDisplay
- Returns:
- null if no info available, otherwise short string
-
getDefaultWidth
protected int getDefaultWidth()
Returns the default width for the dialog.- Overrides:
getDefaultWidth
in classAbstractDisplay
- Returns:
- the default width
-
getDefaultHeight
protected int getDefaultHeight()
Returns the default height for the dialog.- Overrides:
getDefaultHeight
in classAbstractDisplay
- Returns:
- the default height
-
setDividerLocation
public void setDividerLocation(int value)
Sets the position for the left divider in pixels.- Parameters:
value
- the position
-
getDividerLocation
public int getDividerLocation()
Returns the position for the left divider in pixels.- Returns:
- the position
-
dividerLocationTipText
public String dividerLocationTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPanelProvider
public void setPanelProvider(DisplayPanelProvider value)
Sets the panel provider to use for generating the panels.- Parameters:
value
- the panel provider to use
-
getPanelProvider
public DisplayPanelProvider getPanelProvider()
Returns the panel provider in use for generating the panels.- Returns:
- the panel provider in use
-
panelProviderTipText
public String panelProviderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumTokens
public void setNumTokens(int value)
Sets the number of tokens to accept per panel before creating a new panel.- Parameters:
value
- the panel provider to use
-
getNumTokens
public int getNumTokens()
Returns the number of tokens to accept per panel before creating a new panel.- Returns:
- the number of tokens
-
numTokensTipText
public String numTokensTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setEntryNameVariable
public void setEntryNameVariable(VariableNameNoUpdate value)
Sets the variable name which value gets used to name the entries. Gets ignored if variable does not exist.- Parameters:
value
- the variable name
-
getEntryNameVariable
public VariableNameNoUpdate getEntryNameVariable()
Returns the variable name which value gets used to name the entries. Gets ignored if variable does not exist.- Returns:
- the variable name
-
entryNameVariableTipText
public String entryNameVariableTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAllowMerge
public void setAllowMerge(boolean value)
Sets whether to enable merging of panel content in case of same name.- Parameters:
value
- true if to allow merge- See Also:
setEntryNameVariable(VariableNameNoUpdate)
-
getAllowMerge
public boolean getAllowMerge()
Returns whether to enable merging of panel content in case of same name.- Returns:
- true if to allow merge
- See Also:
setEntryNameVariable(VariableNameNoUpdate)
-
allowMergeTipText
public String allowMergeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAllowSearch
public void setAllowSearch(boolean value)
Sets whether to allow the user to search the entries.- Parameters:
value
- true if to allow search
-
getAllowSearch
public boolean getAllowSearch()
Returns whether to allow the user to search the entries.- Returns:
- true if to allow search
-
allowSearchTipText
public String allowSearchTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setShowFlowControlSubMenu
public void setShowFlowControlSubMenu(boolean value)
Sets whether to show a flow control sub-menu in the menubar.- Parameters:
value
- true if to show
-
getShowFlowControlSubMenu
public boolean getShowFlowControlSubMenu()
Returns whether to show a flow control sub-menu in the menubar.- Returns:
- true if to show
-
showFlowControlSubMenuTipText
public String showFlowControlSubMenuTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
forceVariables
protected void forceVariables(Variables value)
Updates the Variables instance in use.
Use with caution!- Overrides:
forceVariables
in classAbstractActor
- Parameters:
value
- the instance to use
-
getSelectedPanel
protected JPanel getSelectedPanel()
Returns the currently selected panel.- Returns:
- the panel or null if none selected
-
supplyComponent
public JComponent supplyComponent()
Returns the current panel.- Specified by:
supplyComponent
in interfaceComponentSupplier
- Returns:
- the current panel, can be null
-
getCustomTextFileFilter
public ExtensionFileFilter getCustomTextFileFilter()
Returns a custom file filter for the file chooser.- Specified by:
getCustomTextFileFilter
in interfaceTextSupplier
- Returns:
- the file filter, null if to use default one
-
getCustomSupplyTextMenuItemCaption
public String getCustomSupplyTextMenuItemCaption()
Returns the text for the menu item.- Specified by:
getCustomSupplyTextMenuItemCaption
in interfaceTextSupplier
- Returns:
- the menu item text, null for default
-
supplyText
public String supplyText()
Supplies the text.- Specified by:
supplyText
in interfaceTextSupplier
- Specified by:
supplyText
in interfaceTextSupporter
- Returns:
- the text, null if none available
-
clearPanel
public void clearPanel()
Clears the content of the panel.- Specified by:
clearPanel
in classAbstractDisplay
-
newPanel
protected BasePanel newPanel()
Creates the panel to display in the dialog.- Specified by:
newPanel
in classAbstractDisplay
- Returns:
- the panel
-
doCreateFrame
protected BaseFrame doCreateFrame(BasePanel panel)
Creates the actual frame.- Overrides:
doCreateFrame
in classAbstractDisplay
- Parameters:
panel
- the panel to display in the frame- Returns:
- the created frame
-
getComponentFileChooser
protected JComponentWriterFileChooser getComponentFileChooser()
Returns (and initializes if necessary) the file chooser for the components.- Returns:
- the file chooser
-
getTextFileChooser
protected TextFileChooser getTextFileChooser()
Returns (and initializes if necessary) the file chooser for the text.- Returns:
- the file chooser
-
accepts
public Class[] accepts()
Returns the class that the consumer accepts.- Specified by:
accepts
in interfaceInputConsumer
- Returns:
- java.lang.String.class, java.io.File.class, java.awt.image.BufferedImage.class, adams.data.image.AbstractImageContainer.class, adams.data.image.BufferedImageSupporter.class
-
display
protected void display(Token token)
Displays the token (the panel and dialog have already been created at this stage).- Specified by:
display
in classAbstractDisplay
- Parameters:
token
- the token to display
-
createMenuBar
protected JMenuBar createMenuBar()
Assembles the menu bar.- Returns:
- the menu bar
-
getMenuBar
public JMenuBar getMenuBar()
Creates a menu bar (singleton per panel object). Can be used in frames.- Specified by:
getMenuBar
in interfaceMenuBarProvider
- Returns:
- the menu bar
-
updateMenu
protected void updateMenu()
updates the enabled state of the menu items.
-
clear
protected void clear()
Clears the display.
-
saveAs
protected void saveAs()
Saves the setups.
-
close
protected void close()
Closes the dialog or frame.
-
canPauseOrResume
protected boolean canPauseOrResume()
Returns whether the flow can be paused/resumed.- Returns:
- true if pause/resume available
-
isPaused
protected boolean isPaused()
Returns whether the flow is currently paused.- Returns:
- true if currently paused
-
pauseResumeFlow
protected void pauseResumeFlow()
Pauses or resumes the flow.
-
stopFlow
protected void stopFlow()
Stops the flow.
-
cleanUpGUI
protected void cleanUpGUI()
Removes all graphical components.- Overrides:
cleanUpGUI
in classAbstractDisplay
-
getSendToClasses
public Class[] getSendToClasses()
Returns the classes that the supporter generates.- Specified by:
getSendToClasses
in interfaceSendToActionSupporter
- Returns:
- the classes
-
hasSendToItem
public boolean hasSendToItem(Class[] cls)
Checks whether something to send is available.- Specified by:
hasSendToItem
in interfaceSendToActionSupporter
- Parameters:
cls
- the classes to retrieve the item for- Returns:
- true if an object is available for sending
-
getSendToItem
public Object getSendToItem(Class[] cls)
Returns the object to send.- Specified by:
getSendToItem
in interfaceSendToActionSupporter
- Parameters:
cls
- the classes to retrieve the item for- Returns:
- the item to send
-
wrapUp
public void wrapUp()
Cleans up after the execution has finished.- Specified by:
wrapUp
in interfaceActor
- Overrides:
wrapUp
in classAbstractDisplay
-
-