|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ijchart.xychart.title.AbstractTitle
com.ijchart.xychart.title.TextTitle
public class TextTitle
Title: IJChart
Description: a chart library for the Java(tm) platform.
A chart title that displays a text string with automatic wrapping as required.Copyright: Copyright (c) 2013
Company:
Field Summary | |
---|---|
static boolean |
DEFAULT_EXPAND_TO_FIT_SPACE
A default flag that controls whether the title expands to fit the available space. |
static java.awt.Font |
DEFAULT_FONT
The default font. |
static java.awt.Paint |
DEFAULT_TEXT_PAINT
The default text color. |
Fields inherited from class com.ijchart.xychart.title.AbstractTitle |
---|
DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_BORDER_VISIBLE, DEFAULT_FILL_BACKGROUND, DEFAULT_HORIZONTAL_ALIGNMENT, DEFAULT_NOTIFY, DEFAULT_PADDING, DEFAULT_TITLE_POSITION, DEFAULT_VERTICAL_ALIGNMENT |
Constructor Summary | |
---|---|
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,
java.awt.Paint textPaint,
RectangleEdge position,
HorizontalAlignment horizontalAlignment,
VerticalAlignment verticalAlignment,
RectangleInsets padding)
Creates a new title, using default attributes where necessary. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a clone of this object. |
Rectangle |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D chartArea,
ChartShapeCollection shapeCollection)
Draw the title on chart area(chartArea).All title shape is stored in shapeCollection. |
boolean |
equals(java.lang.Object obj)
Tests this title for equality with another object. |
boolean |
getExpandToFitSpace()
Returns the flag that controls whether the title expands to fit the available space. |
java.lang.String |
getText()
Returns the title text. |
java.awt.Font |
getTextFont()
Returns the font used to display the title string. |
java.awt.Paint |
getTextPaint()
Returns the paint used to display the title string. |
int |
hashCode()
Returns a hash code. |
void |
setExpandToFitSpace(boolean flag)
Sets a flag that controls whether the title expands to fit the available space and sends a TitleChangeEvent to all registered listeners. |
void |
setText(java.lang.String text)
Sets the title to the specified text and sends a TitleChangeEvent to all registered listeners. |
void |
setTextFont(java.awt.Font font)
Sets the font used to display the title string. |
void |
setTextPaint(java.awt.Paint paint)
Sets the paint used to display the title string.Registered listeners are notified that the title has been modified. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, 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
public static final boolean DEFAULT_EXPAND_TO_FIT_SPACE
Constructor Detail |
---|
public TextTitle(java.lang.String text)
text
- String
The title text (null not permitted).public TextTitle(java.lang.String text, java.awt.Font font)
text
- String
The title text (null not permitted).font
- Font
The title font (null not permitted).public TextTitle(java.lang.String text, java.awt.Font font, java.awt.Paint textPaint, RectangleEdge position, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, RectangleInsets padding)
text
- String
The title text (null not permitted).font
- Font
The title font (null not permitted).textPaint
- Paint
The title paint (null not permitted).position
- RectangleEdge
The title position (null not permitted).horizontalAlignment
- HorizontalAlignment
The horizontal alignment (null not permitted).verticalAlignment
- VerticalAlignment
The vertical alignment (null not permitted).padding
- RectangleInsets
The space to leave around the outside of the title (null not permitted).Method Detail |
---|
public java.lang.String getText()
public void setText(java.lang.String text)
TitleChangeEvent
to all registered listeners.
text
- String
The text (null not permitted).public java.awt.Font getTextFont()
public void setTextFont(java.awt.Font font)
font
- Font
The new font (null not permitted).public java.awt.Paint getTextPaint()
public void setTextPaint(java.awt.Paint paint)
paint
- Paint
The new paint (null not permitted).public boolean getExpandToFitSpace()
public void setExpandToFitSpace(boolean flag)
TitleChangeEvent
to all registered listeners.
flag
- boolean
A boolean.public Rectangle draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D chartArea, ChartShapeCollection shapeCollection)
draw
in interface ITitle
g2
- Graphics2D
The graphics device (null not permitted).chartArea
- Rectangle2D
The area within which the chart should be drawn.shapeCollection
- ChartShapeCollection
Collects information about the plot (null permitted).
public boolean equals(java.lang.Object obj)
equals
in class AbstractTitle
obj
- the object (null permitted).
public int hashCode()
hashCode
in class AbstractTitle
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractTitle
java.lang.CloneNotSupportedException
- never.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |