java.lang.Object
org.jfree.chart.block.AbstractBlock
org.jfree.chart.block.LabelBlock
- All Implemented Interfaces:
Serializable
,Cloneable
,Block
,Drawable
,PublicCloneable
A block containing a label.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLabelBlock
(String label) Creates a new label block.LabelBlock
(String text, Font font) Creates a new label block.LabelBlock
(String text, Font font, Paint paint) Creates a new label block. -
Method Summary
Modifier and TypeMethodDescriptionarrange
(Graphics2D g2, RectangleConstraint constraint) Arranges the contents of the block, within the given constraints, and returns the block size.clone()
Returns a clone of thisLabelBlock
instance.void
draw
(Graphics2D g2, Rectangle2D area) Draws the block.draw
(Graphics2D g2, Rectangle2D area, Object params) Draws the block within the specified area.boolean
Tests thisLabelBlock
for equality with an arbitrary object.Returns the content alignment point.getFont()
Returns the font.getPaint()
Returns the paint.Returns the text anchor (nevernull
).Returns the tool tip text.Returns the URL text.void
Sets the content alignment point.void
Sets the font and regenerates the label.void
Sets the paint and regenerates the label.void
setTextAnchor
(RectangleAnchor anchor) Sets the text anchor.void
setToolTipText
(String text) Sets the tool tip text.void
setURLText
(String text) Sets the URL text.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
-
Field Details
-
DEFAULT_PAINT
The default color.
-
-
Constructor Details
-
LabelBlock
Creates a new label block.- Parameters:
label
- the label (null
not permitted).
-
LabelBlock
Creates a new label block.- Parameters:
text
- the text for the label (null
not permitted).font
- the font (null
not permitted).
-
LabelBlock
Creates a new label block.- Parameters:
text
- the text for the label (null
not permitted).font
- the font (null
not permitted).paint
- the paint (null
not permitted).
-
-
Method Details
-
getFont
Returns the font.- Returns:
- The font (never
null
). - See Also:
-
setFont
Sets the font and regenerates the label.- Parameters:
font
- the font (null
not permitted).- See Also:
-
getPaint
Returns the paint.- Returns:
- The paint (never
null
). - See Also:
-
setPaint
Sets the paint and regenerates the label.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getToolTipText
Returns the tool tip text.- Returns:
- The tool tip text (possibly
null
). - See Also:
-
setToolTipText
Sets the tool tip text.- Parameters:
text
- the text (null
permitted).- See Also:
-
getURLText
Returns the URL text.- Returns:
- The URL text (possibly
null
). - See Also:
-
setURLText
Sets the URL text.- Parameters:
text
- the text (null
permitted).- See Also:
-
getContentAlignmentPoint
Returns the content alignment point.- Returns:
- The content alignment point (never
null
).
-
setContentAlignmentPoint
Sets the content alignment point.- Parameters:
anchor
- the anchor used to determine the alignment point (nevernull
).
-
getTextAnchor
Returns the text anchor (nevernull
).- Returns:
- The text anchor.
-
setTextAnchor
Sets the text anchor.- Parameters:
anchor
- the anchor (null
not permitted).
-
arrange
Arranges the contents of the block, within the given constraints, and returns the block size.- Specified by:
arrange
in interfaceBlock
- Overrides:
arrange
in classAbstractBlock
- Parameters:
g2
- the graphics device.constraint
- the constraint (null
not permitted).- Returns:
- The block size (in Java2D units, never
null
).
-
draw
Draws the block. -
draw
Draws the block within the specified area. -
equals
Tests thisLabelBlock
for equality with an arbitrary object.- Overrides:
equals
in classAbstractBlock
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-
clone
Returns a clone of thisLabelBlock
instance.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classAbstractBlock
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if there is a problem cloning.
-