org.jfree.chart.block
Interface Block
- Drawable
- BlockContainer, ColorBlock, CompositeTitle, DateTitle, EmptyBlock, ImageTitle, LabelBlock, LegendGraphic, LegendItemBlockContainer, LegendTitle, PaintScaleLegend, TextTitle, Title
A block is an arbitrary item that can be drawn (in Java2D space) within a
rectangular area, has a preferred size, and can be arranged by an
Arrangement
manager.
Size2D | arrange(Graphics2D g2) - Arranges the contents of the block, with no constraints, and returns
the block size.
|
Size2D | arrange(Graphics2D g2, RectangleConstraint constraint) - Arranges the contents of the block, within the given constraints, and
returns the block size.
|
Object | draw(Graphics2D g2, Rectangle2D area, Object params) - Draws the block within the specified area.
|
Rectangle2D | getBounds() - Returns the current bounds of the block.
|
String | getID() - Returns an ID for the block.
|
void | setBounds(Rectangle2D bounds) - Sets the bounds of the block.
|
void | setID(String id) - Sets the ID for the block.
|
arrange
public Size2D arrange(Graphics2D g2)
Arranges the contents of the block, with no constraints, and returns
the block size.
g2
- the graphics device.
arrange
public Size2D arrange(Graphics2D g2,
RectangleConstraint constraint)
Arranges the contents of the block, within the given constraints, and
returns the block size.
g2
- the graphics device.constraint
- the constraint (null
not permitted).
- The block size (in Java2D units, never
null
).
draw
public Object draw(Graphics2D g2,
Rectangle2D area,
Object params)
Draws the block within the specified area. Refer to the documentation
for the implementing class for information about the params
and return value supported.
g2
- the graphics device.area
- the area.params
- optional parameters (null
permitted).
- An optional return value (possibly
null
).
getBounds
public Rectangle2D getBounds()
Returns the current bounds of the block.
getID
public String getID()
Returns an ID for the block.
setBounds
public void setBounds(Rectangle2D bounds)
Sets the bounds of the block.
setID
public void setID(String id)
Sets the ID for the block.