Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.chart.block.AbstractBlock
org.jfree.chart.title.Title
org.jfree.chart.title.TextTitle
Field Summary | |
static Font |
|
static Paint |
|
Fields inherited from class org.jfree.chart.title.Title | |
DEFAULT_HORIZONTAL_ALIGNMENT , DEFAULT_PADDING , DEFAULT_POSITION , DEFAULT_VERTICAL_ALIGNMENT |
Constructor Summary | |
| |
| |
| |
|
Method Summary | |
Size2D |
|
protected Size2D | |
Object |
|
void |
|
Object |
|
protected void |
|
protected void |
|
boolean |
|
Paint |
|
boolean |
|
Font |
|
Paint |
|
String |
|
HorizontalAlignment |
|
String |
|
String |
|
int |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from class org.jfree.chart.title.Title | |
addChangeListener , clone , draw , equals , getHorizontalAlignment , getNotify , getPosition , getVerticalAlignment , hashCode , notifyListeners , removeChangeListener , setHorizontalAlignment , setNotify , setPosition , setVerticalAlignment |
Methods inherited from class org.jfree.chart.block.AbstractBlock | |
arrange , arrange , calculateTotalHeight , calculateTotalWidth , clone , drawBorder , equals , getBorder , getBounds , getContentXOffset , getContentYOffset , getFrame , getHeight , getID , getMargin , getPadding , getWidth , setBorder , setBorder , setBounds , setFrame , setHeight , setID , setMargin , setMargin , setPadding , setPadding , setWidth , toContentConstraint , trimBorder , trimMargin , trimPadding , trimToContentHeight , trimToContentWidth |
public TextTitle(String text)
Creates a new title, using default attributes where necessary.
- Parameters:
text
- the title text (null
not permitted).
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).
public TextTitle(String text, Font font, Paint paint, RectangleEdge position, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, 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.
public Size2D arrange(Graphics2D g2, RectangleConstraint constraint)
Arranges the contents of the block, within the given constraints, and returns the block size.
- Overrides:
- arrange in interface AbstractBlock
- Parameters:
g2
- the graphics device.constraint
- the constraint (null
not permitted).
- Returns:
- The block size (in Java2D units, never
null
).
protected Size2D arrangeRR(Graphics2D g2, Range widthRange, Range heightRange)
Returns the content size for the title. This will reflect the fact that a text title positioned on the left or right of a chart will be rotated 90 degrees.
- Parameters:
g2
- the graphics device.widthRange
- the width range.heightRange
- the height range.
- Returns:
- The content size.
public Object clone() throws CloneNotSupportedException
Returns a clone of this object.
- Returns:
- A clone.
public void draw(Graphics2D g2, Rectangle2D area)
Draws the title on a Java 2D graphics device (such as the screen or a printer).
- Parameters:
g2
- the graphics device.area
- the area allocated for the title.
public Object draw(Graphics2D g2, Rectangle2D area, Object params)
Draws the block within the specified area.
- Parameters:
g2
- the graphics device.area
- the area.params
- if this is an instance ofEntityBlockParams
it is used to determine whether or not anEntityCollection
is returned by this method.
- Returns:
- An
EntityCollection
containing a chart entity for the title, ornull
.
protected void drawHorizontal(Graphics2D g2, Rectangle2D area)
Draws a the title horizontally within the specified area. This method will be called from thedraw
method.
- Parameters:
g2
- the graphics device.area
- the area for the title.
protected void drawVertical(Graphics2D g2, Rectangle2D area)
Draws a the title vertically within the specified area. This method will be called from thedraw
method.
- Parameters:
g2
- the graphics device.area
- the area for the title.
public boolean equals(Object obj)
Tests this title for equality with another object.
- Parameters:
obj
- the object (null
permitted).
- Returns:
true
orfalse
.
public Paint getBackgroundPaint()
Returns the background paint.
- Returns:
- The paint (possibly
null
).
public boolean getExpandToFitSpace()
Returns the flag that controls whether or not the title expands to fit the available space.
- Returns:
- The flag.
public Font getFont()
Returns the font used to display the title string.
- Returns:
- The font (never
null
).
public Paint getPaint()
Returns the paint used to display the title string.
- Returns:
- The paint (never
null
).
public 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.
public String getToolTipText()
Returns the tool tip text.
- Returns:
- The tool tip text (possibly
null
).
public void setBackgroundPaint(Paint paint)
Sets the background paint and sends aTitleChangeEvent
to all registered listeners. If you set this attribute tonull
, no background is painted (which makes the title background transparent).
- Parameters:
paint
- the background paint (null
permitted).
public void setExpandToFitSpace(boolean expand)
Sets the flag that controls whether the title expands to fit the available space, and sends aTitleChangeEvent
to all registered listeners.
- Parameters:
expand
- the flag.
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).
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).
public void setText(String text)
Sets the title to the specified text and sends aTitleChangeEvent
to all registered listeners.
- Parameters:
text
- the text (null
not permitted).
public void setTextAlignment(HorizontalAlignment alignment)
Sets the text alignment.
- Parameters:
alignment
- the alignment (null
not permitted).
public void setToolTipText(String text)
Sets the tool tip text to the specified text and sends aTitleChangeEvent
to all registered listeners.
- Parameters:
text
- the text (null
permitted).
public void setURLText(String text)
Sets the URL text to the specified text and sends aTitleChangeEvent
to all registered listeners.
- Parameters:
text
- the text (null
permitted).