Class ChartTitle

  • All Implemented Interfaces:
    java.io.Serializable

    public class ChartTitle
    extends java.lang.Object
    implements java.io.Serializable
    A chart title that displays a text string with defined font and color.
    Since:
    8.0
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String TOKEN_AXIS
      The XML token for an axis title.
      static java.lang.String TOKEN_FOOTNOTE
      The XML token for a footnote title.
      static java.lang.String TOKEN_HEADER
      The XML token for a header title.
      static java.lang.String TOKEN_SUBTITLE
      The XML token for a subtitle.
    • Constructor Summary

      Constructors 
      Constructor Description
      ChartTitle​(java.awt.Font titleFont, int color)
      Creates a chart title with the given properties.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ChartTitle clone()
      int getColor()
      Returns the ABGR value of color for this title.
      java.awt.Font getFont()
      Returns the font of the label.
      java.lang.String getTitle()
      Returns this title's text.
      FormulaField getTitleFormula()
      Returns the property formula for the chart title, if it is specified.
      boolean isEqualToDefault​(ChartTitle defaultTitle)
      Returns true if this title is equal to default.
      boolean isShowAutoTitle()
      Returns whether or not this title is to be an automatically generated label.
      void readProperties​(org.w3c.dom.Element element, Chart2 chart)
      Reads the XML properties of a chart title.
      void saveProperties​(java.lang.StringBuilder buffer, java.lang.String type, int depth)
      Writes the properties of the title to PrintWriter.
      void setColor​(int titleColor)
      Sets the ABGR value of color for this title.
      void setFont​(java.awt.Font titleFont)
      Sets the font of the label.
      void setShowAutoTitle​(boolean showAutoTitle)
      Sets whether or not this title is to be an automatically generated label.
      void setTitle​(java.lang.String title)
      Sets this title.
      Note: to use this property turn off the showing of auto title.
      void setTitleFormula​(FormulaField titleFormula)
      Sets the formula which returns the title.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TOKEN_HEADER

        public static final java.lang.String TOKEN_HEADER
        The XML token for a header title.
        See Also:
        Constant Field Values
      • TOKEN_SUBTITLE

        public static final java.lang.String TOKEN_SUBTITLE
        The XML token for a subtitle.
        See Also:
        Constant Field Values
      • TOKEN_FOOTNOTE

        public static final java.lang.String TOKEN_FOOTNOTE
        The XML token for a footnote title.
        See Also:
        Constant Field Values
      • TOKEN_AXIS

        public static final java.lang.String TOKEN_AXIS
        The XML token for an axis title.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ChartTitle

        public ChartTitle​(java.awt.Font titleFont,
                          int color)
        Creates a chart title with the given properties.
        Parameters:
        titleFont - the title font
        color - the title color
        Since:
        8.0
    • Method Detail

      • isShowAutoTitle

        public boolean isShowAutoTitle()
        Returns whether or not this title is to be an automatically generated label.
        Returns:
        whether or not this title is to be an automatically generated label
        Since:
        8.0
        See Also:
        setShowAutoTitle(boolean)
      • setShowAutoTitle

        public void setShowAutoTitle​(boolean showAutoTitle)
        Sets whether or not this title is to be an automatically generated label.
        Parameters:
        showAutoTitle - whether or not the title is to be automatically generated
        Since:
        8.0
        See Also:
        isShowAutoTitle()
      • getTitle

        public java.lang.String getTitle()
        Returns this title's text. If this title has been set to show an automatically generated label, this will show the automatically generated text, otherwise this will show the title set with setTitle.
        Returns:
        the title text
        Since:
        8.0
        See Also:
        setTitle(String), setShowAutoTitle(boolean), setAutoTitle(String)
      • setTitle

        public void setTitle​(java.lang.String title)
        Sets this title.
        Note: to use this property turn off the showing of auto title.
        Parameters:
        title - the label (null not permitted)
        Since:
        8.0
        See Also:
        getTitle(), setShowAutoTitle(boolean)
      • getColor

        public int getColor()
        Returns the ABGR value of color for this title.
        Returns:
        the ABGR value representing the label color.
        Since:
        8.0
        See Also:
        ColorUtils.toJavaColor(int), setColor(int)
      • setColor

        public void setColor​(int titleColor)
        Sets the ABGR value of color for this title.
        Parameters:
        titleColor - ABGR components of the color
        Throws:
        java.lang.IllegalArgumentException - by RDC.COLOR_NO_COLOR.
        Since:
        8.0
        See Also:
        ColorUtils.toCcColor(Color), getColor()
      • getFont

        public java.awt.Font getFont()
        Returns the font of the label.
        Returns:
        the font.
        Since:
        8.0
        See Also:
        setFont(Font)
      • setFont

        public void setFont​(java.awt.Font titleFont)
        Sets the font of the label.
        Parameters:
        titleFont - the label font (null not permitted)
        Since:
        8.0
        See Also:
        getFont()
      • isEqualToDefault

        public boolean isEqualToDefault​(ChartTitle defaultTitle)
        Returns true if this title is equal to default.
        Parameters:
        defaultTitle - the default title
        Returns:
        true if equal to default.
        Since:
        8.0
      • saveProperties

        public void saveProperties​(java.lang.StringBuilder buffer,
                                   java.lang.String type,
                                   int depth)
        Writes the properties of the title to PrintWriter.
        Parameters:
        buffer - the output
        type - the type of this title: header, footer or subtitle
        depth - the depth of XML indent
        Since:
        8.0
        See Also:
        TOKEN_HEADER, TOKEN_FOOTNOTE, TOKEN_SUBTITLE
      • readProperties

        public void readProperties​(org.w3c.dom.Element element,
                                   Chart2 chart)
        Reads the XML properties of a chart title.
        Parameters:
        element - DOM element
        chart - the current chart
        Since:
        8.0
        See Also:
        saveProperties(StringBuilder, String, int)
      • clone

        public ChartTitle clone()
        Overrides:
        clone in class java.lang.Object
      • setTitleFormula

        public void setTitleFormula​(FormulaField titleFormula)
        Sets the formula which returns the title. Note that this formula is only used when showAutoTitle is off.
        Parameters:
        titleFormula - the formula foe the title
        Since:
        i-net Clear Reports 12.0
      • getTitleFormula

        public FormulaField getTitleFormula()
        Returns the property formula for the chart title, if it is specified.
        Returns:
        the formula or can be null.
        Since:
        i-net Clear Reports 12.0