Package adams.data.io.output
Class ViaAnnotationsReportWriter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.output.AbstractReportWriter<Report>
-
- adams.data.io.output.ViaAnnotationsReportWriter
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,FileFormatHandler
,PrettyPrintingSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<AbstractReportWriter>
,SizeOfHandler
,ReportWriter<Report>
,Serializable
,Comparable
public class ViaAnnotationsReportWriter extends AbstractReportWriter<Report> implements PrettyPrintingSupporter
Writes polygon annotations in VGG Image Annotator JSON format.
For more information, see:
http://www.robots.ox.ac.uk/~vgg/software/via/
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-output <adams.core.io.PlaceholderFile> (property: output) The file to write the report to. default: ${TMP}/out.json
-finder <adams.data.objectfinder.ObjectFinder> (property: finder) The object finder to use. default: adams.data.objectfinder.AllFinder
-label-key <java.lang.String> (property: labelKey) The key in the meta-data containing the label, ignored if empty. default:
-pretty-printing <boolean> (property: prettyPrinting) If enabled, the output is printed in a 'pretty' format. default: false
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ObjectFinder
m_Finder
the object finder to use.protected String
m_LabelKey
the meta-data key with the label.protected boolean
m_PrettyPrinting
whether to use pretty-printing.-
Fields inherited from class adams.data.io.output.AbstractReportWriter
m_Output
-
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 ViaAnnotationsReportWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.String
finderTipText()
Returns the tip text for this property.ObjectFinder
getFinder()
Returns the finder to use for locating the objects.String
getFormatDescription()
Returns a string describing the format (used in the file chooser).String[]
getFormatExtensions()
Returns the extension of the format.String
getLabelKey()
Returns the key in the meta-data containing the label.boolean
getPrettyPrinting()
Returns whether pretty-printing is used or not.String
globalInfo()
Returns a string describing the object.String
labelKeyTipText()
Returns the tip text for this property.String
prettyPrintingTipText()
Returns the tip text for this property.void
setFinder(ObjectFinder value)
Sets the finder to use for locating the objects.void
setLabelKey(String value)
Sets the key in the meta-data containing the label.void
setPrettyPrinting(boolean value)
Sets whether to use pretty-printing or not.protected boolean
writeData(Report data)
Performs the actual writing.-
Methods inherited from class adams.data.io.output.AbstractReportWriter
checkData, cleanUp, compareTo, destroy, equals, forCommandLine, forName, getDefaultFormatExtension, getOutput, getWriters, outputTipText, reset, setOutput, shallowCopy, shallowCopy, write
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Finder
protected ObjectFinder m_Finder
the object finder to use.
-
m_LabelKey
protected String m_LabelKey
the meta-data key with the label.
-
m_PrettyPrinting
protected boolean m_PrettyPrinting
whether to use pretty-printing.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractReportWriter<Report>
-
setFinder
public void setFinder(ObjectFinder value)
Sets the finder to use for locating the objects.- Parameters:
value
- the finder
-
getFinder
public ObjectFinder getFinder()
Returns the finder to use for locating the objects.- Returns:
- the finder
-
finderTipText
public String finderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLabelKey
public void setLabelKey(String value)
Sets the key in the meta-data containing the label.- Parameters:
value
- the key
-
getLabelKey
public String getLabelKey()
Returns the key in the meta-data containing the label.- Returns:
- the key
-
labelKeyTipText
public String labelKeyTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPrettyPrinting
public void setPrettyPrinting(boolean value)
Sets whether to use pretty-printing or not.- Specified by:
setPrettyPrinting
in interfacePrettyPrintingSupporter
- Parameters:
value
- true if to use pretty-printing
-
getPrettyPrinting
public boolean getPrettyPrinting()
Returns whether pretty-printing is used or not.- Specified by:
getPrettyPrinting
in interfacePrettyPrintingSupporter
- Returns:
- true if to use pretty-printing
-
prettyPrintingTipText
public String prettyPrintingTipText()
Returns the tip text for this property.- Specified by:
prettyPrintingTipText
in interfacePrettyPrintingSupporter
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getFormatDescription
public String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescription
in interfaceFileFormatHandler
- Specified by:
getFormatDescription
in classAbstractReportWriter<Report>
- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the extension of the format.- Specified by:
getFormatExtensions
in interfaceFileFormatHandler
- Specified by:
getFormatExtensions
in classAbstractReportWriter<Report>
- Returns:
- the extension (without the dot!)
-
writeData
protected boolean writeData(Report data)
Performs the actual writing.- Specified by:
writeData
in classAbstractReportWriter<Report>
- Parameters:
data
- the data to write- Returns:
- true if successfully written
-
-