org.jfree.chart.title
public class TextTitle extends Title implements Serializable, Cloneable, PublicCloneable
Field Summary | |
---|---|
static Font | DEFAULT_FONT The default font. |
static Paint | DEFAULT_TEXT_PAINT The default text color. |
Constructor Summary | |
---|---|
TextTitle()
Creates a new title, using default attributes where necessary. | |
TextTitle(String text)
Creates a new title, using default attributes where necessary.
| |
TextTitle(String text, Font font)
Creates a new title, using default attributes where necessary.
| |
TextTitle(String text, Font font, Paint paint, RectangleEdge position, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, RectangleInsets padding)
Creates a new title.
|
Method Summary | |
---|---|
Size2D | arrange(Graphics2D g2, RectangleConstraint constraint)
Arranges the contents of the block, within the given constraints, and
returns the block size.
|
protected Size2D | arrangeFN(Graphics2D g2, double w)
Arranges the content for this title assuming a fixed width and no bounds
on the height, and returns the required size. |
protected Size2D | arrangeNN(Graphics2D g2)
Arranges the content for this title assuming no bounds on the width
or the height, and returns the required size. |
protected Size2D | arrangeRN(Graphics2D g2, Range widthRange)
Arranges the content for this title assuming a range constraint for the
width and no bounds on the height, and returns the required size. |
protected Size2D | arrangeRR(Graphics2D g2, Range widthRange, Range heightRange)
Returns the content size for the title. |
Object | clone()
Returns a clone of this object.
|
void | draw(Graphics2D g2, Rectangle2D area)
Draws the title on a Java 2D graphics device (such as the screen or a
printer).
|
Object | draw(Graphics2D g2, Rectangle2D area, Object params)
Draws the block within the specified area.
|
protected void | drawHorizontal(Graphics2D g2, Rectangle2D area)
Draws a the title horizontally within the specified area. |
protected void | drawVertical(Graphics2D g2, Rectangle2D area)
Draws a the title vertically within the specified area. |
boolean | equals(Object obj)
Tests this title for equality with another object.
|
Paint | getBackgroundPaint()
Returns the background paint.
|
boolean | getExpandToFitSpace()
Returns the flag that controls whether or not the title expands to fit
the available space.
|
Font | getFont()
Returns the font used to display the title string.
|
int | getMaximumLinesToDisplay()
Returns the maximum number of lines to display.
|
Paint | getPaint()
Returns the paint used to display the title string.
|
String | getText()
Returns the title text.
|
HorizontalAlignment | getTextAlignment()
Returns the text alignment. |
String | getToolTipText()
Returns the tool tip text.
|
String | getURLText()
Returns the URL text.
|
int | hashCode()
Returns a hash code.
|
void | setBackgroundPaint(Paint paint)
Sets the background paint and sends a TitleChangeEvent to all
registered listeners. |
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.
|
void | setFont(Font font)
Sets the font used to display the title string. |
void | setMaximumLinesToDisplay(int max)
Sets the maximum number of lines to display and sends a
TitleChangeEvent to all registered listeners.
|
void | setPaint(Paint paint)
Sets the paint used to display the title string. |
void | setText(String text)
Sets the title to the specified text and sends a
TitleChangeEvent to all registered listeners.
|
void | setTextAlignment(HorizontalAlignment alignment)
Sets the text alignment and sends a TitleChangeEvent to
all registered listeners.
|
void | setToolTipText(String text)
Sets the tool tip text to the specified text and sends a
TitleChangeEvent to all registered listeners.
|
void | setURLText(String text)
Sets the URL text to the specified text and sends a
TitleChangeEvent to all registered listeners.
|
Parameters: text the title text (null
not permitted).
Parameters: text the title text (null
not permitted). font the title font (null
not permitted).
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.
Parameters: g2 the graphics device. constraint the constraint (null
not permitted).
Returns: The block size (in Java2D units, never null
).
Parameters: g2 the graphics target. w the width.
Returns: The content size.
Since: 1.0.9
Parameters: g2 the graphics target.
Returns: The content size.
Since: 1.0.9
Parameters: g2 the graphics target. widthRange the range for the width.
Returns: The content size.
Since: 1.0.9
Parameters: g2 the graphics device. widthRange the width range. heightRange the height range.
Returns: The content size.
Returns: A clone.
Throws: CloneNotSupportedException never.
Parameters: g2 the graphics device. area the area allocated for the title.
Parameters: g2 the graphics device. area the area. params if this is an instance of EntityBlockParams it is used to determine whether or not an EntityCollection is returned by this method.
Returns: An EntityCollection containing a chart entity for the
title, or null
.
draw
method.
Parameters: g2 the graphics device. area the area for the title.
draw
method.
Parameters: g2 the graphics device. area the area for the title.
Parameters: obj the object (null
permitted).
Returns: true
or false
.
Returns: The paint (possibly null
).
Returns: The flag.
Returns: The font (never null
).
See Also: setFont
Returns: The maximum.
Since: 1.0.10
See Also: TextTitle
Returns: The paint (never null
).
See Also: setPaint
Returns: The text (never null
).
See Also: setText
Returns: The text alignment.
Returns: The tool tip text (possibly null
).
Returns: The URL text (possibly null
).
Returns: A hash code.
null
,
no background is painted (which makes the title background transparent).
Parameters: paint the background paint (null
permitted).
Parameters: expand the flag.
Parameters: font the new font (null
not permitted).
See Also: getFont
Parameters: max the maximum.
Since: 1.0.10.
See Also: getMaximumLinesToDisplay
Parameters: paint the new paint (null
not permitted).
See Also: getPaint
Parameters: text the text (null
not permitted).
Parameters: alignment the alignment (null
not permitted).
Parameters: text the text (null
permitted).
Parameters: text the text (null
permitted).