Class FlowProcessor
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.gui.tools.spreadsheetprocessor.AbstractWidget
-
- adams.gui.tools.spreadsheetprocessor.processors.AbstractProcessor
-
- adams.gui.tools.spreadsheetprocessor.processors.FlowProcessor
-
- All Implemented Interfaces:
LoggingLevelHandler,LoggingSupporter,SizeOfHandler,Serializable,Comparable<AbstractWidget>
public class FlowProcessor extends AbstractProcessor
Uses a subflow for processing the spreadsheet.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_FLOWprotected BaseButtonm_ButtonCheckthe "check flow" button.protected BaseButtonm_ButtonLoadthe "load flow" button.protected BaseButtonm_ButtonNewthe "new flow" button.protected BaseButtonm_ButtonRunthe "run flow" button.protected BaseButtonm_ButtonSavethe "save flow" button.protected FlowFileChooserm_FileChooserFlowthe file chooser for the flows.protected FlowPanelm_PanelFlowthe flow panel.protected BasePanelm_PanelWidgetthe widget.-
Fields inherited from class adams.gui.tools.spreadsheetprocessor.AbstractWidget
m_Owner
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description FlowProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassign(AbstractWidget other)Retrieves the values from the other widget, if possible.protected booleancheckFlow(boolean silent)Checks the flow.voiddeserialize(Object data, MessageCollection errors)Deserializes the setup and maps it onto the widget. /** Deserializes the setup and maps it onto the widget.protected SpreadSheetdoProcess(SpreadSheet data, MessageCollection errors)Processes the data.ActorgetCurrentFlow()Returns the flow.StringgetName()Returns the name of the widget.ComponentgetWidget()Returns the widget.protected voidloadFlow()Allows the user to load a flow snippet.protected voidnewFlow()Replaces the current flow snippet with an empty one.protected voidrunFlow()Runs the flow.protected voidsaveFlow()Allows the user to save the current flow snippet.Objectserialize()Serializes the setup from the widget.voidsetCurrentFlow(Actor value)Sets the flow.voidupdate()Updates the widget.-
Methods inherited from class adams.gui.tools.spreadsheetprocessor.processors.AbstractProcessor
check, process
-
Methods inherited from class adams.gui.tools.spreadsheetprocessor.AbstractWidget
compareTo, equals, getOwner, notifyOwner, setOwner, toString
-
Methods inherited from class adams.core.logging.CustomLoggingLevelObject
setLoggingLevel
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
KEY_FLOW
public static final String KEY_FLOW
- See Also:
- Constant Field Values
-
m_PanelWidget
protected BasePanel m_PanelWidget
the widget.
-
m_PanelFlow
protected FlowPanel m_PanelFlow
the flow panel.
-
m_ButtonNew
protected BaseButton m_ButtonNew
the "new flow" button.
-
m_ButtonLoad
protected BaseButton m_ButtonLoad
the "load flow" button.
-
m_ButtonSave
protected BaseButton m_ButtonSave
the "save flow" button.
-
m_ButtonCheck
protected BaseButton m_ButtonCheck
the "check flow" button.
-
m_ButtonRun
protected BaseButton m_ButtonRun
the "run flow" button.
-
m_FileChooserFlow
protected FlowFileChooser m_FileChooserFlow
the file chooser for the flows.
-
-
Method Detail
-
getName
public String getName()
Returns the name of the widget.- Specified by:
getNamein classAbstractWidget- Returns:
- the name
-
getWidget
public Component getWidget()
Returns the widget.- Specified by:
getWidgetin classAbstractWidget- Returns:
- the widget
-
newFlow
protected void newFlow()
Replaces the current flow snippet with an empty one.
-
loadFlow
protected void loadFlow()
Allows the user to load a flow snippet.
-
saveFlow
protected void saveFlow()
Allows the user to save the current flow snippet.
-
checkFlow
protected boolean checkFlow(boolean silent)
Checks the flow.- Parameters:
silent- only pops up a dialog if invalid flow- Returns:
- true if flow ok
-
runFlow
protected void runFlow()
Runs the flow.
-
setCurrentFlow
public void setCurrentFlow(Actor value)
Sets the flow.- Parameters:
value- the flow
-
getCurrentFlow
public Actor getCurrentFlow()
Returns the flow.- Returns:
- the flow
-
assign
public void assign(AbstractWidget other)
Retrieves the values from the other widget, if possible.- Specified by:
assignin classAbstractWidget- Parameters:
other- the other widget to get the values from
-
serialize
public Object serialize()
Serializes the setup from the widget.- Specified by:
serializein classAbstractWidget- Returns:
- the generated setup representation
-
deserialize
public void deserialize(Object data, MessageCollection errors)
Deserializes the setup and maps it onto the widget. /** Deserializes the setup and maps it onto the widget.- Specified by:
deserializein classAbstractWidget- Parameters:
data- the setup representation to useerrors- for collecting errors
-
update
public void update()
Updates the widget.- Specified by:
updatein classAbstractWidget
-
doProcess
protected SpreadSheet doProcess(SpreadSheet data, MessageCollection errors)
Processes the data.- Specified by:
doProcessin classAbstractProcessor- Parameters:
data- the input dataerrors- for storing errors- Returns:
- the generated data, null in case of an error
-
-