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 DateFormatm_DateFormatthe date formatter.protected Field[]m_Fieldsthe date fields in the report.protected Stringm_Formatthe date format.protected intm_OffsetXthe pixel offset from the left.protected intm_OffsetYthe pixel offset from the top.protected Stringm_Prefixthe 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 voiddefineOptions()Adds options to the internal list of options.StringfieldsTipText()Returns the tip text for this property.StringformatTipText()Returns the tip text for this property.protected DateFormatgetDateFormat()Returns the formatter/parser.Field[]getFields()Returns the currently set date fields in use.StringgetFormat()Returns the currently set date format.intgetOffsetX()Returns the pixel offset from the left.intgetOffsetY()Returns the pixel offset from the top.PaintEvent.PaintMomentgetPaintMoment()Returns when this paintlet is to be executed.StringgetPrefix()Returns the currently set prefix for the date label.TechnicalInformationgetTechnicalInformation()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.StringglobalInfo()Returns a string describing the object.StringoffsetXTipText()Returns the tip text for this property.StringoffsetYTipText()Returns the tip text for this property.voidperformPaint(Graphics g, PaintEvent.PaintMoment moment)The paint routine of the paintlet.StringprefixTipText()Returns the tip text for this property.voidsetFields(Field[] value)Sets the date fields in the report to use.voidsetFormat(String value)Sets the date format.voidsetOffsetX(int value)Sets the pixel offset from the left.voidsetOffsetY(int value)Sets the pixel offset from the top.voidsetPanel(PaintablePanel value)Sets the panel to use, null to disable painting.voidsetPrefix(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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin 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:
getTechnicalInformationin 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:
setPanelin interfacePaintlet- Overrides:
setPanelin 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:
getPaintMomentin interfacePaintlet- Specified by:
getPaintMomentin 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:
performPaintin interfacePaintlet- Specified by:
performPaintin classAbstractPaintlet- Parameters:
g- the graphics context to use for paintingmoment- whatPaintEvent.PaintMomentis currently being painted
-
-