|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.chart.title.Title
org.jfree.chart.title.TextTitle
A standard chart title.
Field Summary | |
static java.awt.Font |
DEFAULT_FONT
The default font. |
static java.awt.Paint |
DEFAULT_TEXT_PAINT
The default text color. |
Fields inherited from class org.jfree.chart.title.Title |
BOTTOM, CENTER, DEFAULT_HORIZONTAL_ALIGNMENT, DEFAULT_POSITION, DEFAULT_SPACER, DEFAULT_VERTICAL_ALIGNMENT, EAST, LEFT, MIDDLE, NORTH, RIGHT, SOUTH, TOP, WEST |
Constructor Summary | |
TextTitle()
Creates a new title, using default attributes where necessary. |
|
TextTitle(java.lang.String text)
Creates a new title, using default attributes where necessary. |
|
TextTitle(java.lang.String text,
java.awt.Font font)
Creates a new title, using default attributes where necessary. |
|
TextTitle(java.lang.String text,
java.awt.Font font,
org.jfree.ui.HorizontalAlignment horizontalAlignment)
Creates a new title, using default attributes where necessary. |
|
TextTitle(java.lang.String text,
java.awt.Font font,
java.awt.Paint paint)
Creates a new title, using default attributes where necessary. |
|
TextTitle(java.lang.String text,
java.awt.Font font,
java.awt.Paint paint,
org.jfree.ui.RectangleEdge position,
org.jfree.ui.HorizontalAlignment horizontalAlignment,
org.jfree.ui.VerticalAlignment verticalAlignment,
Spacer spacer)
Constructs a TextTitle with the specified properties. |
Method Summary | |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
Draws the title on a Java 2D graphics device (such as the screen or a printer). |
void |
drawHorizontal(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
Draws a horizontal title. |
void |
drawVertical(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
Draws a horizontal title. |
boolean |
equals(java.lang.Object obj)
Tests this title for equality with another object. |
java.awt.Paint |
getBackgroundPaint()
Returns the background paint. |
java.awt.Font |
getFont()
Returns the font used to display the title string. |
java.awt.Paint |
getPaint()
Returns the paint used to display the title string. |
float |
getPreferredHeight(java.awt.Graphics2D g2,
float width)
Returns the preferred height of the title. |
float |
getPreferredWidth(java.awt.Graphics2D g2,
float height)
Returns the preferred width of the title. |
java.lang.String |
getText()
Returns the title text. |
void |
setBackgroundPaint(java.awt.Paint paint)
Sets the background paint. |
void |
setFont(java.awt.Font font)
Sets the font used to display the title string. |
void |
setPaint(java.awt.Paint paint)
Sets the paint used to display the title string. |
void |
setText(java.lang.String text)
Sets the title to the specified text. |
Methods inherited from class org.jfree.chart.title.Title |
addChangeListener, clone, getHorizontalAlignment, getNotify, getPosition, getSpacer, getVerticalAlignment, notifyListeners, removeChangeListener, setHorizontalAlignment, setNotify, setPosition, setSpacer, setVerticalAlignment |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.awt.Font DEFAULT_FONT
public static final java.awt.Paint DEFAULT_TEXT_PAINT
Constructor Detail |
public TextTitle()
public TextTitle(java.lang.String text)
text
- the title text.public TextTitle(java.lang.String text, java.awt.Font font)
text
- the title text.font
- the title font.public TextTitle(java.lang.String text, java.awt.Font font, java.awt.Paint paint)
text
- the title text.font
- the title font.paint
- the title color.public TextTitle(java.lang.String text, java.awt.Font font, org.jfree.ui.HorizontalAlignment horizontalAlignment)
For the horizontal alignment, use the constants (LEFT, RIGHT and CENTER) defined in the Title class.
text
- the title text.font
- the title font.horizontalAlignment
- the horizontal alignment.public TextTitle(java.lang.String text, java.awt.Font font, java.awt.Paint paint, org.jfree.ui.RectangleEdge position, org.jfree.ui.HorizontalAlignment horizontalAlignment, org.jfree.ui.VerticalAlignment verticalAlignment, Spacer spacer)
For the titlePosition, horizontalAlignment and verticalAlignment, use the constants defined in the Title class.
text
- the text for the title (not null).font
- the title font (not null).paint
- the title color (not null).position
- the title position.horizontalAlignment
- the horizontal alignment.verticalAlignment
- the vertical alignment.spacer
- the space to leave around the outside of the title.Method Detail |
public java.lang.String getText()
public void setText(java.lang.String text)
text
- the new text.public java.awt.Font getFont()
public void setFont(java.awt.Font font)
font
- the new font (null
not permitted).public java.awt.Paint getPaint()
public void setPaint(java.awt.Paint paint)
paint
- the new paint (null
not permitted).public java.awt.Paint getBackgroundPaint()
public void setBackgroundPaint(java.awt.Paint paint)
paint
- the new background paint.public float getPreferredWidth(java.awt.Graphics2D g2, float height)
getPreferredWidth
in class Title
g2
- the graphics device.height
- the height.
public float getPreferredHeight(java.awt.Graphics2D g2, float width)
getPreferredHeight
in class Title
g2
- the graphics device.width
- the width.
public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
draw
in class Title
g2
- the graphics device.area
- the area allocated for the title.public void drawHorizontal(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
g2
- the graphics device.area
- the area for the title.public void drawVertical(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
g2
- the graphics device.area
- the area for the title.public boolean equals(java.lang.Object obj)
equals
in class Title
obj
- the object.
true
or false
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |