Package adams.flow.sink
Class AbstractGraphicalDisplay
-
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<Actor>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,VariablesInspectionHandler
,VariableChangeListener
,Actor
,ClearableDisplay
,DisplayTypeSupporter
,ErrorHandler
,InputConsumer
,ComponentSupplier
,MenuBarProvider
,SendToActionSupporter
,Serializable
,Comparable
- Direct Known Subclasses:
ActualVsPredictedPlot
,ArrayDisplay
,BoxPlot
,Canvas
,ControlChartPlot
,DOMDisplay
,FilePreview
,FlowDisplay
,FourInOneDisplay
,Histogram
,Html4Display
,ImageHistogram
,ImageSegmentationViewer
,ImageViewer
,JFreeChartPlot
,JsonDisplay
,MatrixPlot
,ObjectPreview
,ObjectViewer
,PDFViewer
,ProbabilityPlotDisplay
,ProgressBar
,ScatterDisplay
,SequencePlotter
,SideBySideDiff
,SimplePlot
,SpreadSheetRowViewer
,StringTree
,TimeseriesDisplay
,WekaAttributeSummary
,WekaClassifierErrors
,WekaCostBenefitAnalysis
,WekaCostCurve
,WekaGraphVisualizer
,WekaInstancesDisplay
,WekaInstancesPlot
,WekaInstanceViewer
,WekaMarginCurve
,WekaThresholdCurve
,WekaTreeVisualizer
,ZScoreDisplay
public abstract class AbstractGraphicalDisplay extends AbstractDisplay implements MenuBarProvider, ComponentSupplier, SendToActionSupporter, ClearableDisplay
Ancestor for actors that display stuff.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected JComponentWriterFileChooser
m_GraphicFileChooser
the filedialog for saving the panel as picture.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_MenuItemFileSaveTextAs
the "save text as" menu item.protected JMenuItem
m_MenuItemFlowPauseResume
the "pause/resume" menu item.protected JMenuItem
m_MenuItemFlowStop
the "stop" menu item.protected boolean
m_ShowFlowControlSubMenu
whether to show flow control sub-menu.protected TextFileChooser
m_TextFileChooser
the filedialog for saving the textual data.protected JComponentWriter
m_Writer
the writer to use.-
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 AbstractGraphicalDisplay()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canPauseOrResume()
Returns whether the flow can be paused/resumed.protected void
cleanUpGUI()
Removes all graphical components.void
clear()
Clears the display.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 JComponentWriterFileChooser
getGraphicFileChooser()
Returns (and initializes if necessary) the file chooser for the images.JMenuBar
getMenuBar()
Creates a menu bar (singleton per panel object).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.JComponentWriter
getWriter()
Returns the writer.protected boolean
hasPanel()
Checks whether a panel is available that can be saved.boolean
hasSendToItem(Class[] cls)
Checks whether something to send is available.protected boolean
isPaused()
Returns whether the flow is currently paused.protected void
pauseResumeFlow()
Pauses or resumes the flow.protected void
saveAs()
Saves the panel as picture.protected void
saveTextAs()
Saves the text.void
setShowFlowControlSubMenu(boolean value)
Sets whether to show a flow control sub-menu in the menubar.void
setWriter(JComponentWriter value)
Sets the writer.String
showFlowControlSubMenuTipText()
Returns the tip text for this property.protected void
stopFlow()
Stops the flow.JComponent
supplyComponent()
Returns the current component.boolean
supportsClear()
Whether "clear" is supported and shows up in the menu.protected void
updateMenu()
updates the enabled state of the menu items.void
wrapUp()
Cleans up after the execution has finished.String
writerTipText()
Returns the tip text for this property.-
Methods inherited from class adams.flow.sink.AbstractDisplay
display, newDisplayRunnable, postDisplay, preDisplay
-
Methods inherited from class adams.flow.core.AbstractDisplay
backupState, cleanUp, cleanUpGUIKeepOpen, clearPanel, closeFrame, createFrame, createTitle, currentInput, deregisterInWrapUp, deregisterWindow, deregisterWithEditor, displayTypeTipText, doCreateFrame, doExecute, getCreateFrame, getDefaultDisplayType, getDefaultHeight, getDefaultShortTitle, getDefaultWidth, getDefaultX, getDefaultY, getDisplayType, getFrame, getFrameDefaultCloseOperation, getHeight, getKeepOpen, getPanel, getQuickInfo, getShortTitle, getWidth, getX, getY, hasInput, heightTipText, initialize, input, newPanel, postCreateFrame, preCreateFrame, registerWindow, registerWithEditor, reset, restoreState, 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, forceVariables, 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, 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, globalInfo, 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, getQuickInfo, 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
accepts, 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
-
m_Writer
protected JComponentWriter m_Writer
the writer to use.
-
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_MenuItemFileSaveTextAs
protected JMenuItem m_MenuItemFileSaveTextAs
the "save text 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_GraphicFileChooser
protected transient JComponentWriterFileChooser m_GraphicFileChooser
the filedialog for saving the panel as picture.
-
m_TextFileChooser
protected transient TextFileChooser m_TextFileChooser
the filedialog for saving the textual data.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractDisplay
-
setWriter
public void setWriter(JComponentWriter value)
Sets the writer.- Parameters:
value
- the writer
-
getWriter
public JComponentWriter getWriter()
Returns the writer.- Returns:
- the writer
-
writerTipText
public String writerTipText()
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.
-
hasPanel
protected boolean hasPanel()
Checks whether a panel is available that can be saved.- Returns:
- true if panel is available for saving
-
supplyComponent
public JComponent supplyComponent()
Returns the current component.- Specified by:
supplyComponent
in interfaceComponentSupplier
- Returns:
- the current component, can be null
-
getGraphicFileChooser
protected JComponentWriterFileChooser getGraphicFileChooser()
Returns (and initializes if necessary) the file chooser for the images.- Returns:
- the file chooser
-
getTextFileChooser
protected TextFileChooser getTextFileChooser()
Returns (and initializes if necessary) the file chooser for the text.- Returns:
- the file chooser
-
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.
-
supportsClear
public boolean supportsClear()
Whether "clear" is supported and shows up in the menu.
Default implementation returns "false".- Specified by:
supportsClear
in interfaceClearableDisplay
- Returns:
- true if supported
-
clear
public void clear()
Clears the display.- Specified by:
clear
in interfaceClearableDisplay
-
saveAs
protected void saveAs()
Saves the panel as picture.
-
saveTextAs
protected void saveTextAs()
Saves the text.
-
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 requested classes- 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 requested classes- 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
-
-