Package adams.flow.standalone
Class GridView
-
- All Implemented Interfaces:
AdditionalInformationHandler,CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,ShallowCopySupporter<Actor>,SizeOfHandler,Stoppable,StoppableWithFeedback,VariablesInspectionHandler,VariableChangeListener,Actor,ActorHandler,ActorReferenceHandler,DataPlotUpdaterSupporter,DisplayTypeSupporter,ErrorHandler,FlowControlSubMenuSupporter,Flushable,HeadlessExecutionSupporter,MutableActorHandler,ComponentSupplier,MenuBarProvider,SendToActionSupporter,Serializable,Comparable
public class GridView extends AbstractMultiView implements ComponentSupplier, DataPlotUpdaterSupporter
Displays multiple graphical actors in a grid. The actors get added row-wise to the grid from top-left to bottom-right. The actors can be referenced in the flow using adams.flow.sink.CallableSink actors.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-name <java.lang.String> (property: name) The name of the actor. default: GridView
-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
-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
-short-title <boolean> (property: shortTitle) If enabled uses just the name for the title instead of the actor's full name. default: false
-display-in-editor <boolean> (property: displayInEditor) If enabled displays the panel in a tab in the flow editor rather than in a separate frame. default: false
-width <int> (property: width) The width of the dialog. default: 800 minimum: -1
-height <int> (property: height) The height of the dialog. default: 600 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
-actor <adams.flow.core.Actor> [-actor ...] (property: actors) The panel-generating actors to display in the grid. default:
-num-rows <int> (property: numRows) The number of rows in the grid. default: 1 minimum: 1
-num-cols <int> (property: numCols) The number of columns in the grid. default: 1 minimum: 1
-add-headers <boolean> (property: addHeaders) If enabled, headers with the names of the actors as labels get added as well. default: false
-show-controls <boolean> (property: showControls) If enabled, the controls for adjusting rows/columns are visible. default: false
-writer <adams.gui.print.JComponentWriter> (property: writer) The writer to use for generating the graphics output. default: adams.gui.print.NullWriter
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.flow.standalone.AbstractMultiView
AbstractMultiView.ViewWrapper
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_AddHeaderswhether to add headers.protected intm_NumColsthe number of columns to display.protected intm_NumRowsthe number of rows to display.protected List<BasePanel>m_Panelsthe panels to display.protected booleanm_ShowControlswhether to show the controls.protected JComponentWriterm_Writerthe writer to use.-
Fields inherited from class adams.flow.standalone.AbstractMultiView
m_Actors, m_MenuBar, m_MenuItemFileClear, m_MenuItemFileClose, m_MenuItemFlowPauseResume, m_MenuItemFlowStop, m_ShowFlowControlSubMenu, m_Wrappers
-
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_ResetGUIWaiting, 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 GridView()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringactorsTipText()Returns the tip text for this property.StringaddHeadersTipText()Returns the tip text for this property.voidaddPanel(Actor actor, BasePanel panel)Replaces the current dummy panel with the actual panel.voidcleanUp()Cleans up after the execution has finished.voiddefineOptions()Adds options to the internal list of options.booleangetAddHeaders()Returns whether to add headers to the cells in the grid with the names of the actors.intgetNumCols()Returns the number of columns in the grid.intgetNumRows()Returns the number of rows in the grid.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.booleangetShowControls()Returns whether to show the controls for adjusting rows/columns.JComponentWritergetWriter()Returns the writer.StringglobalInfo()Returns a string describing the object.protected voidinitialize()Initializes the members.booleanmakeVisible(AbstractMultiView.ViewWrapper wrapper)Ensures that the wrapper is visible.protected BasePanelnewPanel()Creates the panel to display in the dialog.StringnumColsTipText()Returns the tip text for this property.StringnumRowsTipText()Returns the tip text for this property.voidsetAddHeaders(boolean value)Sets whether to add headers to the cells in the grid with the names of the actors.voidsetNumCols(int value)Sets the number of columns in the grid.voidsetNumRows(int value)Sets the number of rows in the grid.voidsetShowControls(boolean value)Sets whether to show the controls for adjusting rows/columns.voidsetWriter(JComponentWriter value)Sets the writer.StringshowControlsTipText()Returns the tip text for this property.JComponentsupplyComponent()Returns the current component.voidupdatePlot()Updates the data container panel regardless, notifying the listeners.voidwrapUp()Cleans up after the execution has finished.StringwriterTipText()Returns the tip text for this property.-
Methods inherited from class adams.flow.standalone.AbstractMultiView
add, add, canPauseOrResume, check, check, checkActorReferenceHandlers, clear, clearPanel, close, createMenuBar, doExecute, firstActive, flushExecution, get, getActorHandlerInfo, getActors, getMenuBar, getProhibitedPrecedingActorReferenceHandlers, getSendToClasses, getSendToItem, getShowFlowControlSubMenu, hasSendToItem, indexOf, isPaused, isReferencingRequired, lastActive, newDisplayRunnable, pauseResumeFlow, remove, removeAll, set, setActors, setShowFlowControlSubMenu, setUp, setVariables, showFlowControlSubMenuTipText, size, stopExecution, stopFlow, supportsClear, updateMenu, updateParent
-
Methods inherited from class adams.flow.core.AbstractDisplay
backupState, cleanUpGUI, cleanUpGUIKeepOpen, closeDisplay, createFrame, createTitle, currentInput, deregisterInWrapUp, deregisterWindow, deregisterWithEditor, displayTypeTipText, doCreateFrame, doExecuteHeadless, getCreateFrame, getDefaultDisplayType, getDefaultHeight, getDefaultShortTitle, getDefaultWidth, getDefaultX, getDefaultY, getDisplayType, getFrame, getFrameDefaultCloseOperation, getHeight, getKeepOpen, getPanel, getShortTitle, getWidth, getX, getY, hasInput, heightTipText, input, postCreateFrame, preCreateFrame, registerWindow, registerWithEditor, reset, restoreState, setCreateFrame, setDisplayType, setHeight, setKeepOpen, setShortTitle, setWidth, setX, setY, shortTitleTipText, supportsHeadlessExecution, 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, 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
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, shallowCopy, shallowCopy, sizeOf, stopExecution, toCommandLine, variableChanged
-
Methods inherited from interface adams.core.AdditionalInformationHandler
getAdditionalInformation
-
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_NumRows
protected int m_NumRows
the number of rows to display.
-
m_NumCols
protected int m_NumCols
the number of columns to display.
-
m_AddHeaders
protected boolean m_AddHeaders
whether to add headers.
-
m_ShowControls
protected boolean m_ShowControls
whether to show the controls.
-
m_Writer
protected JComponentWriter m_Writer
the writer to use.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractMultiView
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractMultiView
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfoin interfaceActor- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractDisplay- Returns:
- null if no info available, otherwise short string
-
setNumRows
public void setNumRows(int value)
Sets the number of rows in the grid.- Parameters:
value- the number of rows
-
getNumRows
public int getNumRows()
Returns the number of rows in the grid.- Returns:
- the number of rows
-
numRowsTipText
public String numRowsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumCols
public void setNumCols(int value)
Sets the number of columns in the grid.- Parameters:
value- the number of cols
-
getNumCols
public int getNumCols()
Returns the number of columns in the grid.- Returns:
- the number of cols
-
numColsTipText
public String numColsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAddHeaders
public void setAddHeaders(boolean value)
Sets whether to add headers to the cells in the grid with the names of the actors.- Parameters:
value- true if to add headers
-
getAddHeaders
public boolean getAddHeaders()
Returns whether to add headers to the cells in the grid with the names of the actors.- Returns:
- true if to add headers
-
addHeadersTipText
public String addHeadersTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setShowControls
public void setShowControls(boolean value)
Sets whether to show the controls for adjusting rows/columns.- Parameters:
value- true if to show controls
-
getShowControls
public boolean getShowControls()
Returns whether to show the controls for adjusting rows/columns.- Returns:
- true if to show controls
-
showControlsTipText
public String showControlsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
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.
-
actorsTipText
public String actorsTipText()
Returns the tip text for this property.- Specified by:
actorsTipTextin classAbstractMultiView- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
updatePlot
public void updatePlot()
Updates the data container panel regardless, notifying the listeners.- Specified by:
updatePlotin interfaceDataPlotUpdaterSupporter
-
makeVisible
public boolean makeVisible(AbstractMultiView.ViewWrapper wrapper)
Ensures that the wrapper is visible.- Specified by:
makeVisiblein classAbstractMultiView- Parameters:
wrapper- the wrapper to make visible- Returns:
- true if successful
-
newPanel
protected BasePanel newPanel()
Creates the panel to display in the dialog.- Specified by:
newPanelin classAbstractMultiView- Returns:
- the panel
-
addPanel
public void addPanel(Actor actor, BasePanel panel)
Replaces the current dummy panel with the actual panel.- Specified by:
addPanelin classAbstractMultiView- Parameters:
actor- the actor this panel is forpanel- the panel to replace the dummy one
-
supplyComponent
public JComponent supplyComponent()
Returns the current component.- Specified by:
supplyComponentin interfaceComponentSupplier- Returns:
- the current component, can be null
-
wrapUp
public void wrapUp()
Cleans up after the execution has finished.- Specified by:
wrapUpin interfaceActor- Overrides:
wrapUpin classAbstractMultiView
-
cleanUp
public void cleanUp()
Cleans up after the execution has finished. Also removes graphical components.- Specified by:
cleanUpin interfaceActor- Specified by:
cleanUpin interfaceCleanUpHandler- Overrides:
cleanUpin classAbstractMultiView
-
-