com.approximatrix.charting
Class Title

java.lang.Object
  extended by com.approximatrix.charting.render.AbstractRenderer
      extended by com.approximatrix.charting.Title
All Implemented Interfaces:
Renderer

public class Title
extends AbstractRenderer

This class contains the Chart Title. It's also a Renderer object with some extra properties.

Version:
1.0
Author:
mueller

Field Summary
protected  java.awt.Font font
           
protected  java.lang.String text
           
 
Constructor Summary
Title()
          Creates a new Title with the default settings
Title(java.lang.String text)
          Creates a new Title with the given text.
Title(java.lang.String text, java.awt.Font font)
          Creates a new Title with the given text and font.
 
Method Summary
 java.awt.Font getFont()
          Returns this title's Font.
 java.awt.Dimension getPreferredSize()
          Returns the preferred size needed for the renderer.
 java.lang.String getText()
          Returns this title's text.
 void paintDefault(java.awt.Graphics2D g)
          This method is called by the paint method to do the actual painting.
 void setFont(java.awt.Font f)
          Sets the Font that is used to render the title.
 void setText(java.lang.String text)
          Sets this title's text.
 
Methods inherited from class com.approximatrix.charting.render.AbstractRenderer
getBounds, getDirectRender, render, setBounds, setDirectRender
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

text

protected java.lang.String text

font

protected java.awt.Font font
Constructor Detail

Title

public Title()
Creates a new Title with the default settings


Title

public Title(java.lang.String text)
Creates a new Title with the given text.

Parameters:
text - the Title content

Title

public Title(java.lang.String text,
             java.awt.Font font)
Creates a new Title with the given text and font.

Parameters:
text - the Title content
font - the Title format
Method Detail

setText

public void setText(java.lang.String text)
Sets this title's text.

Parameters:
text - the new text

getText

public java.lang.String getText()
Returns this title's text.

Returns:
the String object containing the Title's text

setFont

public void setFont(java.awt.Font f)
Sets the Font that is used to render the title.

Parameters:
f - Sets the new font.

getFont

public java.awt.Font getFont()
Returns this title's Font.

Returns:
the Title's font

paintDefault

public void paintDefault(java.awt.Graphics2D g)
This method is called by the paint method to do the actual painting. The painting is supposed to start at point (0,0) and the size is always the same as the preferred size. The paint method performs the possible scaling.

Specified by:
paintDefault in class AbstractRenderer
Parameters:
g - the Graphics2D object to paint in

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the preferred size needed for the renderer.

Returns:
a non-null Dimension object