Package adams.gui.visualization.report
Class ReportDateFieldPaintlet
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.core.AbstractPaintlet
-
- adams.gui.visualization.report.ReportDateFieldPaintlet
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<Paintlet>
,SizeOfHandler
,TechnicalInformationHandler
,Paintlet
,Serializable
public class ReportDateFieldPaintlet extends AbstractPaintlet implements TechnicalInformationHandler
Paintlet for painting an indicator based on the date(s) stored in the report.
For more details on the date format, see:
Javadoc. java.text.SimpleDateFormat.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-field <adams.data.report.Field> [-field ...] (property: fields) The date field(s) in the report to highlight. default:
-format <java.lang.String> (property: format) The date format to use for parsing the value stored in the report. default: yyyy-MM-dd HH:mm:ss
-prefix <java.lang.String> (property: prefix) The prefix to use for the date label printed next to the indicator. default:
-offset-x <int> (property: offsetX) The number of pixels to offset the string from the left of the indicator. default: 10
-offset-y <int> (property: offsetY) The number of pixels to offset the string from the top of the panel. default: 10 minimum: 0
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected DateFormat
m_DateFormat
the date formatter.protected Field[]
m_Fields
the date fields in the report.protected String
m_Format
the date format.protected int
m_OffsetX
the pixel offset from the left.protected int
m_OffsetY
the pixel offset from the top.protected String
m_Prefix
the prefix for the date label.-
Fields inherited from class adams.gui.visualization.core.AbstractPaintlet
m_Enabled, m_Initializing, m_Panel, m_RepaintOnChange
-
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 ReportDateFieldPaintlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.String
fieldsTipText()
Returns the tip text for this property.String
formatTipText()
Returns the tip text for this property.protected DateFormat
getDateFormat()
Returns the formatter/parser.Field[]
getFields()
Returns the currently set date fields in use.String
getFormat()
Returns the currently set date format.int
getOffsetX()
Returns the pixel offset from the left.int
getOffsetY()
Returns the pixel offset from the top.PaintEvent.PaintMoment
getPaintMoment()
Returns when this paintlet is to be executed.String
getPrefix()
Returns the currently set prefix for the date label.TechnicalInformation
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.String
globalInfo()
Returns a string describing the object.String
offsetXTipText()
Returns the tip text for this property.String
offsetYTipText()
Returns the tip text for this property.void
performPaint(Graphics g, PaintEvent.PaintMoment moment)
The paint routine of the paintlet.String
prefixTipText()
Returns the tip text for this property.void
setFields(Field[] value)
Sets the date fields in the report to use.void
setFormat(String value)
Sets the date format.void
setOffsetX(int value)
Sets the pixel offset from the left.void
setOffsetY(int value)
Sets the pixel offset from the top.void
setPanel(PaintablePanel value)
Sets the panel to use, null to disable painting.void
setPrefix(String value)
Sets the prefix for the date label.-
Methods inherited from class adams.gui.visualization.core.AbstractPaintlet
canPaint, finishInit, forCommandLine, forName, getPaintlets, getPanel, getPlot, getRepaintOnChange, hasPanel, initialize, isEnabled, isInitializing, memberChanged, memberChanged, paint, repaint, setEnabled, setPanel, setRepaintOnChange, shallowCopy, shallowCopy, updatePanel
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, getDefaultLoggingLevel, getOptionManager, 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_Fields
protected Field[] m_Fields
the date fields in the report.
-
m_Format
protected String m_Format
the date format.
-
m_Prefix
protected String m_Prefix
the prefix for the date label.
-
m_DateFormat
protected transient DateFormat m_DateFormat
the date formatter.
-
m_OffsetY
protected int m_OffsetY
the pixel offset from the top.
-
m_OffsetX
protected int m_OffsetX
the pixel offset from the left.
-
-
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 classAbstractOptionHandler
-
getTechnicalInformation
public TechnicalInformation getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformation
in interfaceTechnicalInformationHandler
- Returns:
- the technical information about this class
-
setFields
public void setFields(Field[] value)
Sets the date fields in the report to use.- Parameters:
value
- the date fields
-
getFields
public Field[] getFields()
Returns the currently set date fields in use.- Returns:
- the date fields
-
fieldsTipText
public String fieldsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFormat
public void setFormat(String value)
Sets the date format.- Parameters:
value
- the date format
-
getFormat
public String getFormat()
Returns the currently set date format.- Returns:
- the date format
-
formatTipText
public String formatTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPrefix
public void setPrefix(String value)
Sets the prefix for the date label.- Parameters:
value
- the prefix
-
getPrefix
public String getPrefix()
Returns the currently set prefix for the date label.- Returns:
- the prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOffsetX
public void setOffsetX(int value)
Sets the pixel offset from the left.- Parameters:
value
- the offset
-
getOffsetX
public int getOffsetX()
Returns the pixel offset from the left.- Returns:
- the offset
-
offsetXTipText
public String offsetXTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOffsetY
public void setOffsetY(int value)
Sets the pixel offset from the top.- Parameters:
value
- the offset
-
getOffsetY
public int getOffsetY()
Returns the pixel offset from the top.- Returns:
- the offset
-
offsetYTipText
public String offsetYTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPanel
public void setPanel(PaintablePanel value)
Sets the panel to use, null to disable painting.- Specified by:
setPanel
in interfacePaintlet
- Overrides:
setPanel
in classAbstractPaintlet
- Parameters:
value
- the panel to paint on
-
getDateFormat
protected DateFormat getDateFormat()
Returns the formatter/parser.- Returns:
- the formatter/parser
-
getPaintMoment
public PaintEvent.PaintMoment getPaintMoment()
Returns when this paintlet is to be executed.- Specified by:
getPaintMoment
in interfacePaintlet
- Specified by:
getPaintMoment
in classAbstractPaintlet
- Returns:
- when this paintlet is to be executed
-
performPaint
public void performPaint(Graphics g, PaintEvent.PaintMoment moment)
The paint routine of the paintlet.- Specified by:
performPaint
in interfacePaintlet
- Specified by:
performPaint
in classAbstractPaintlet
- Parameters:
g
- the graphics context to use for paintingmoment
- whatPaintEvent.PaintMoment
is currently being painted
-
-