Class RenderedPlainTextExporter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.debug.objectexport.AbstractObjectExporter
-
- adams.gui.visualization.debug.objectexport.RenderedPlainTextExporter
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,FileFormatHandler,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,Serializable
public class RenderedPlainTextExporter extends AbstractObjectExporter
Uses an AbstractObjectPlainTextRenderer to generated the string to export.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected TextRendererm_CustomRendererthe custom renderer to use.protected booleanm_UnlimitedRenderingwhether to perform unlimited rendering.protected booleanm_UseCustomRendererwhether to use a custom renderer.-
Fields inherited from class adams.gui.visualization.debug.objectexport.AbstractObjectExporter
m_ExporterClasses, m_Exporters
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description RenderedPlainTextExporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcustomRendererTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected StringdoExport(Object obj, File file)Performs the actual export.TextRenderergetCustomRenderer()Returns the custom renderer to use.StringgetFormatDescription()Returns a string describing the format (used in the file chooser).String[]getFormatExtensions()Returns the extension(s) of the format.booleangetUnlimitedRendering()Returns whether to use unlimited rendering if possible.booleangetUseCustomRenderer()Returns whether to use a custom renderer.booleanhandles(Class cls)Checks whether the exporter can handle the specified class.voidsetCustomRenderer(TextRenderer value)Sets the custom renderer to use.voidsetUnlimitedRendering(boolean value)Sets whether to use unlimited rendering (if possible).voidsetUseCustomRenderer(boolean value)Sets whether to use a custom renderer.StringunlimitedRenderingTipText()Returns the tip text for this property.StringuseCustomRendererTipText()Returns the tip text for this property.-
Methods inherited from class adams.gui.visualization.debug.objectexport.AbstractObjectExporter
export, getDefaultFormatExtension, getExporters, getExporters, getExporters, getExporters, getExporters, globalInfo, initExporters, instantiate
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_UseCustomRenderer
protected boolean m_UseCustomRenderer
whether to use a custom renderer.
-
m_CustomRenderer
protected TextRenderer m_CustomRenderer
the custom renderer to use.
-
m_UnlimitedRendering
protected boolean m_UnlimitedRendering
whether to perform unlimited rendering.
-
-
Method Detail
-
getFormatDescription
public String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescriptionin interfaceFileFormatHandler- Specified by:
getFormatDescriptionin classAbstractObjectExporter- Returns:
- a description suitable for displaying in the file chooser
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setUseCustomRenderer
public void setUseCustomRenderer(boolean value)
Sets whether to use a custom renderer.- Parameters:
value- true if custom
-
getUseCustomRenderer
public boolean getUseCustomRenderer()
Returns whether to use a custom renderer.- Returns:
- true if custom
-
useCustomRendererTipText
public String useCustomRendererTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setCustomRenderer
public void setCustomRenderer(TextRenderer value)
Sets the custom renderer to use.- Parameters:
value- the renderer
-
getCustomRenderer
public TextRenderer getCustomRenderer()
Returns the custom renderer to use.- Returns:
- the renderer
-
customRendererTipText
public String customRendererTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUnlimitedRendering
public void setUnlimitedRendering(boolean value)
Sets whether to use unlimited rendering (if possible).- Parameters:
value- true if unlimited
-
getUnlimitedRendering
public boolean getUnlimitedRendering()
Returns whether to use unlimited rendering if possible.- Returns:
- true if unlimited
-
unlimitedRenderingTipText
public String unlimitedRenderingTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the extension(s) of the format.- Specified by:
getFormatExtensionsin interfaceFileFormatHandler- Specified by:
getFormatExtensionsin classAbstractObjectExporter- Returns:
- the extension (without the dot!)
-
handles
public boolean handles(Class cls)
Checks whether the exporter can handle the specified class.- Specified by:
handlesin classAbstractObjectExporter- Parameters:
cls- the class to check- Returns:
- true if the exporter can handle this type of object
-
doExport
protected String doExport(Object obj, File file)
Performs the actual export.- Specified by:
doExportin classAbstractObjectExporter- Parameters:
obj- the object to exportfile- the file to export to- Returns:
- null if successful, otherwise error message
-
-