TextTitle
org.jfree.chart.title

Class TextTitle

    • Field Detail

      • DEFAULT_FONT

        public static final Font DEFAULT_FONT
        The default font.
      • DEFAULT_TEXT_PAINT

        public static final Paint DEFAULT_TEXT_PAINT
        The default text color.
    • Constructor Detail

      • TextTitle

        public TextTitle()
        Creates a new title, using default attributes where necessary.
      • TextTitle

        public TextTitle(String text)
        Creates a new title, using default attributes where necessary.
        Parameters:
        text - the title text (null not permitted).
      • TextTitle

        public TextTitle(String text,         Font font)
        Creates a new title, using default attributes where necessary.
        Parameters:
        text - the title text (null not permitted).
        font - the title font (null not permitted).
      • TextTitle

        public TextTitle(String text,         Font font,         Paint paint,         org.jfree.ui.RectangleEdge position,         org.jfree.ui.HorizontalAlignment horizontalAlignment,         org.jfree.ui.VerticalAlignment verticalAlignment,         org.jfree.ui.RectangleInsets padding)
        Creates a new title.
        Parameters:
        text - the text for the title (null not permitted).
        font - the title font (null not permitted).
        paint - the title paint (null not permitted).
        position - the title position (null not permitted).
        horizontalAlignment - the horizontal alignment (null not permitted).
        verticalAlignment - the vertical alignment (null not permitted).
        padding - the space to leave around the outside of the title.
    • Method Detail

      • getText

        public String getText()
        Returns the title text.
        Returns:
        The text (never null).
        See Also:
        setText(String)
      • setText

        public void setText(String text)
        Sets the title to the specified text and sends a TitleChangeEvent to all registered listeners.
        Parameters:
        text - the text (null not permitted).
      • getTextAlignment

        public org.jfree.ui.HorizontalAlignment getTextAlignment()
        Returns the text alignment. This controls how the text is aligned within the title's bounds, whereas the title's horizontal alignment controls how the title's bounding rectangle is aligned within the drawing space.
        Returns:
        The text alignment.
      • setTextAlignment

        public void setTextAlignment(org.jfree.ui.HorizontalAlignment alignment)
        Sets the text alignment and sends a TitleChangeEvent to all registered listeners.
        Parameters:
        alignment - the alignment (null not permitted).
      • getFont

        public Font getFont()
        Returns the font used to display the title string.
        Returns:
        The font (never null).
        See Also:
        setFont(Font)
      • setFont

        public void setFont(Font font)
        Sets the font used to display the title string. Registered listeners are notified that the title has been modified.
        Parameters:
        font - the new font (null not permitted).
        See Also:
        getFont()
      • getPaint

        public Paint getPaint()
        Returns the paint used to display the title string.
        Returns:
        The paint (never null).
        See Also:
        setPaint(Paint)
      • setPaint

        public void setPaint(Paint paint)
        Sets the paint used to display the title string. Registered listeners are notified that the title has been modified.
        Parameters:
        paint - the new paint (null not permitted).
        See Also:
        getPaint()
      • getBackgroundPaint

        public Paint getBackgroundPaint()
        Returns the background paint.
        Returns:
        The paint (possibly null).
      • setBackgroundPaint

        public void setBackgroundPaint(Paint paint)
        Sets the background paint and sends a TitleChangeEvent to all registered listeners. If you set this attribute to null, no background is painted (which makes the title background transparent).
        Parameters:
        paint - the background paint (null permitted).
      • getToolTipText

        public String getToolTipText()
        Returns the tool tip text.
        Returns:
        The tool tip text (possibly null).
      • setToolTipText

        public void setToolTipText(String text)
        Sets the tool tip text to the specified text and sends a TitleChangeEvent to all registered listeners.
        Parameters:
        text - the text (null permitted).
      • getURLText

        public String getURLText()
        Returns the URL text.
        Returns:
        The URL text (possibly null).
      • setURLText

        public void setURLText(String text)
        Sets the URL text to the specified text and sends a TitleChangeEvent to all registered listeners.
        Parameters:
        text - the text (null permitted).
      • getExpandToFitSpace

        public boolean getExpandToFitSpace()
        Returns the flag that controls whether or not the title expands to fit the available space.
        Returns:
        The flag.
      • setExpandToFitSpace

        public void setExpandToFitSpace(boolean expand)
        Sets the flag that controls whether the title expands to fit the available space, and sends a TitleChangeEvent to all registered listeners.
        Parameters:
        expand - the flag.
      • getMaximumLinesToDisplay

        public int getMaximumLinesToDisplay()
        Returns the maximum number of lines to display.
        Returns:
        The maximum.
        See Also:
        setMaximumLinesToDisplay(int)
      • setMaximumLinesToDisplay

        public void setMaximumLinesToDisplay(int max)
        Sets the maximum number of lines to display and sends a TitleChangeEvent to all registered listeners.
        Parameters:
        max - the maximum.
        See Also:
        getMaximumLinesToDisplay()
      • arrange

        public org.jfree.ui.Size2D arrange(Graphics2D g2,                          RectangleConstraint constraint)
        Arranges the contents of the block, within the given constraints, and returns the block size.
        Specified by:
        arrange in interface Block
        Overrides:
        arrange in class AbstractBlock
        Parameters:
        g2 - the graphics device.
        constraint - the constraint (null not permitted).
        Returns:
        The block size (in Java2D units, never null).
      • draw

        public void draw(Graphics2D g2,        Rectangle2D area)
        Draws the title on a Java 2D graphics device (such as the screen or a printer).
        Specified by:
        draw in interface org.jfree.ui.Drawable
        Specified by:
        draw in class Title
        Parameters:
        g2 - the graphics device.
        area - the area allocated for the title.
      • equals

        public boolean equals(Object obj)
        Tests this title for equality with another object.
        Overrides:
        equals in class Title
        Parameters:
        obj - the object (null permitted).
        Returns:
        true or false.
      • hashCode

        public int hashCode()
        Returns a hash code.
        Overrides:
        hashCode in class Title
        Returns:
        A hash code.

SCaVis 2.1 © jWork.ORG