Class 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 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.
    • Constructor Detail

      • ReportDateFieldPaintlet

        public ReportDateFieldPaintlet()
    • Method Detail

      • 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 interface TechnicalInformationHandler
        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.
      • getDateFormat

        protected DateFormat getDateFormat()
        Returns the formatter/parser.
        Returns:
        the formatter/parser