Class FileTarget
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.gui.tools.spreadsheetprocessor.AbstractWidget
-
- adams.gui.tools.spreadsheetprocessor.targets.AbstractTarget
-
- adams.gui.tools.spreadsheetprocessor.targets.FileTarget
-
- All Implemented Interfaces:
LoggingLevelHandler,LoggingSupporter,SizeOfHandler,Serializable,Comparable<AbstractWidget>
public class FileTarget extends AbstractTarget
For storing the processed data in a file.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_OUTPUTstatic StringKEY_WRITERprotected BaseButtonm_ButtonSavethe button for saving.protected SpreadSheetFileChooserPanelm_PanelOutputthe writer to use.protected BasePanelm_Widgetthe 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 FileTarget()
-
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 voidcheck(SpreadSheet data, MessageCollection errors)Hook method for performing checks.voiddeserialize(Object data, MessageCollection errors)Deserializes the setup and maps it onto the widget.protected voiddoProcess(SpreadSheet data, MessageCollection errors)Processes the data.FilegetCurrentFile()Returns the current file.SpreadSheetWritergetCurrentWriter()Returns the current writer.StringgetName()Returns the name of the widget.ComponentgetWidget()Returns the widget.protected voidsave()Loads the dataObjectserialize()Serializes the setup from the widget.voidsetCurrentFile(File value)Sets the current file.voidsetCurrentWriter(SpreadSheetWriter writer)Sets the current writer.voidupdate()Updates the widget.-
Methods inherited from class adams.gui.tools.spreadsheetprocessor.targets.AbstractTarget
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_OUTPUT
public static final String KEY_OUTPUT
- See Also:
- Constant Field Values
-
KEY_WRITER
public static final String KEY_WRITER
- See Also:
- Constant Field Values
-
m_Widget
protected BasePanel m_Widget
the widget.
-
m_PanelOutput
protected SpreadSheetFileChooserPanel m_PanelOutput
the writer to use.
-
m_ButtonSave
protected BaseButton m_ButtonSave
the button for saving.
-
-
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
-
update
public void update()
Updates the widget.- Specified by:
updatein classAbstractWidget
-
save
protected void save()
Loads the data
-
setCurrentFile
public void setCurrentFile(File value)
Sets the current file.- Parameters:
value- the current file
-
getCurrentFile
public File getCurrentFile()
Returns the current file.- Returns:
- the current file
-
setCurrentWriter
public void setCurrentWriter(SpreadSheetWriter writer)
Sets the current writer.- Parameters:
writer- the current writer
-
getCurrentWriter
public SpreadSheetWriter getCurrentWriter()
Returns the current writer.- Returns:
- the current writer
-
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.- Specified by:
deserializein classAbstractWidget- Parameters:
data- the setup representation to useerrors- for collecting errors
-
check
protected void check(SpreadSheet data, MessageCollection errors)
Hook method for performing checks.- Overrides:
checkin classAbstractTarget- Parameters:
data- the data to checkerrors- for storing errors
-
doProcess
protected void doProcess(SpreadSheet data, MessageCollection errors)
Processes the data.- Specified by:
doProcessin classAbstractTarget- Parameters:
data- the input dataerrors- for storing errors
-
-