- java.lang.Object
-
- org.jfree.chart.block.AbstractBlock
-
- org.jfree.chart.title.Title
-
- org.jfree.chart.title.CompositeTitle
-
- All Implemented Interfaces:
Serializable,Cloneable,org.jfree.chart.block.Block,ChartElement,Drawable
public class CompositeTitle extends Title implements Cloneable, Serializable
A title that contains multiple titles within aBlockContainer.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.jfree.chart.title.Title
DEFAULT_HORIZONTAL_ALIGNMENT, DEFAULT_PADDING, DEFAULT_POSITION, DEFAULT_VERTICAL_ALIGNMENT, visible
-
-
Constructor Summary
Constructors Constructor Description CompositeTitle()Creates a new composite title with a default border arrangement.CompositeTitle(org.jfree.chart.block.BlockContainer container)Creates a new title using the specified container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jfree.chart.block.Size2Darrange(Graphics2D g2, org.jfree.chart.block.RectangleConstraint constraint)Arranges the contents of the block, within the given constraints, and returns the block size.voiddraw(Graphics2D g2, Rectangle2D area)Draws the title on a Java 2D graphics device (such as the screen or a printer).Objectdraw(Graphics2D g2, Rectangle2D area, Object params)Draws the block within the specified area.booleanequals(Object obj)Tests this title for equality with an arbitrary object.PaintgetBackgroundPaint()Returns the background paint.org.jfree.chart.block.BlockContainergetContainer()Returns the container holding the titles.voidreceive(ChartElementVisitor visitor)Receives a chart element visitor.voidsetBackgroundPaint(Paint paint)Sets the background paint and sends aTitleChangeEventto all registered listeners.voidsetTitleContainer(org.jfree.chart.block.BlockContainer container)Sets the title container.-
Methods inherited from class org.jfree.chart.title.Title
addChangeListener, clone, getHorizontalAlignment, getNotify, getPosition, getVerticalAlignment, hashCode, isVisible, notifyListeners, removeChangeListener, setHorizontalAlignment, setNotify, setPosition, setVerticalAlignment, setVisible
-
Methods inherited from class org.jfree.chart.block.AbstractBlock
arrange, calculateTotalHeight, calculateTotalWidth, drawBorder, getBounds, getContentXOffset, getContentYOffset, getFrame, getHeight, getID, getMargin, getPadding, getWidth, setBorder, setBounds, setFrame, setHeight, setID, setMargin, setMargin, setPadding, setPadding, setWidth, toContentConstraint, trimBorder, trimMargin, trimPadding, trimToContentHeight, trimToContentWidth
-
-
-
-
Constructor Detail
-
CompositeTitle
public CompositeTitle()
Creates a new composite title with a default border arrangement.
-
CompositeTitle
public CompositeTitle(org.jfree.chart.block.BlockContainer container)
Creates a new title using the specified container.- Parameters:
container- the container (nullnot permitted).
-
-
Method Detail
-
getBackgroundPaint
public Paint getBackgroundPaint()
Returns the background paint.- Returns:
- The paint (possibly
null).
-
setBackgroundPaint
public void setBackgroundPaint(Paint paint)
Sets the background paint and sends aTitleChangeEventto all registered listeners. If you set this attribute tonull, no background is painted (which makes the title background transparent).- Parameters:
paint- the background paint (nullpermitted).
-
getContainer
public org.jfree.chart.block.BlockContainer getContainer()
Returns the container holding the titles.- Returns:
- The title container (never
null).
-
setTitleContainer
public void setTitleContainer(org.jfree.chart.block.BlockContainer container)
Sets the title container.- Parameters:
container- the container (nullnot permitted).
-
arrange
public org.jfree.chart.block.Size2D arrange(Graphics2D g2, org.jfree.chart.block.RectangleConstraint constraint)
Arranges the contents of the block, within the given constraints, and returns the block size.- Specified by:
arrangein interfaceorg.jfree.chart.block.Block- Overrides:
arrangein classorg.jfree.chart.block.AbstractBlock- Parameters:
g2- the graphics device.constraint- the constraint (nullnot permitted).- Returns:
- The block size (in Java2D units, never
null).
-
receive
public void receive(ChartElementVisitor visitor)
Receives a chart element visitor.- Specified by:
receivein interfaceChartElement- Overrides:
receivein classTitle- Parameters:
visitor- the visitor (nullnot permitted).
-
draw
public void draw(Graphics2D g2, Rectangle2D area)
Draws the title on a Java 2D graphics device (such as the screen or a printer).
-
draw
public Object draw(Graphics2D g2, Rectangle2D area, Object params)
Draws the block within the specified area.- Specified by:
drawin interfaceorg.jfree.chart.block.Block- Parameters:
g2- the graphics device.area- the area.params- ignored (nullpermitted).- Returns:
- Always
null.
-
-