org.jfree.chart.block
public class AbstractBlock extends Object implements Cloneable, Serializable
Constructor Summary | |
---|---|
protected | AbstractBlock()
Creates a new block. |
Method Summary | |
---|---|
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.
|
protected double | calculateTotalHeight(double contentHeight)
Adds the margin, border and padding to the specified content height.
|
protected double | calculateTotalWidth(double contentWidth)
Adds the margin, border and padding to the specified content width.
|
Object | clone()
Returns a clone of this block.
|
protected void | drawBorder(Graphics2D g2, Rectangle2D area)
Draws the border around the perimeter of the specified area.
|
boolean | equals(Object obj)
Tests this block for equality with an arbitrary object.
|
BlockBorder | getBorder()
Returns the border.
|
Rectangle2D | getBounds()
Returns the current bounds of the block.
|
double | getContentXOffset()
Returns the x-offset for the content within the block.
|
double | getContentYOffset()
Returns the y-offset for the content within the block.
|
BlockFrame | getFrame()
Returns the current frame (border).
|
double | getHeight()
Returns the natural height of the block, if this is known in advance.
|
String | getID()
Returns the id.
|
RectangleInsets | getMargin()
Returns the margin.
|
RectangleInsets | getPadding()
Returns the padding.
|
double | getWidth()
Returns the natural width of the block, if this is known in advance.
|
void | setBorder(BlockBorder border)
Sets the border for the block (use NONE for
no border).
|
void | setBorder(double top, double left, double bottom, double right)
Sets a black border with the specified line widths.
|
void | setBounds(Rectangle2D bounds)
Sets the bounds of the block.
|
void | setFrame(BlockFrame frame)
Sets the frame (or border).
|
void | setHeight(double height)
Sets the natural width of the block, if this is known in advance.
|
void | setID(String id)
Sets the id for the block.
|
void | setMargin(RectangleInsets margin)
Sets the margin (use RectangleInsets#ZERO_INSETS for no
padding).
|
void | setMargin(double top, double left, double bottom, double right)
Sets the margin.
|
void | setPadding(RectangleInsets padding)
Sets the padding (use RectangleInsets#ZERO_INSETS for no
padding).
|
void | setPadding(double top, double left, double bottom, double right)
Sets the padding.
|
void | setWidth(double width)
Sets the natural width of the block, if this is known in advance.
|
protected RectangleConstraint | toContentConstraint(RectangleConstraint c)
Returns a constraint for the content of this block that will result in
the bounds of the block matching the specified constraint.
|
protected Rectangle2D | trimBorder(Rectangle2D area)
Reduces the specified area by the amount of space consumed
by the border.
|
protected Rectangle2D | trimMargin(Rectangle2D area)
Reduces the specified area by the amount of space consumed
by the margin.
|
protected Rectangle2D | trimPadding(Rectangle2D area)
Reduces the specified area by the amount of space consumed
by the padding.
|
protected double | trimToContentHeight(double fixedHeight)
Calculate the height available for content after subtracting
the margin, border and padding space from the specified fixed
height.
|
protected double | trimToContentWidth(double fixedWidth)
Calculate the width available for content after subtracting
the margin, border and padding space from the specified fixed
width.
|
Parameters: g2 the graphics device.
Returns: The block size (in Java2D units, never null
).
Parameters: g2 the graphics device. constraint the constraint (null
not permitted).
Returns: The block size (in Java2D units, never null
).
Parameters: contentHeight the content height.
Returns: The adjusted height.
Parameters: contentWidth the content width.
Returns: The adjusted width.
Returns: A clone.
Throws: CloneNotSupportedException if there is a problem creating the clone.
Parameters: g2 the graphics device. area the area.
Parameters: obj the object (null
permitted).
Returns: A boolean.
Deprecated: Use getFrame instead.
Returns the border.Returns: The border (never null
).
Returns: The bounds.
See Also: setBounds
Returns: The x-offset.
See Also: getContentYOffset
Returns: The y-offset.
See Also: getContentXOffset
Returns: The height.
See Also: AbstractBlock
Returns: The id (possibly null
).
See Also: setID
Returns: The margin (never null
).
See Also: getMargin
Returns: The padding (never null
).
See Also: setPadding
Returns: The width.
See Also: AbstractBlock
Deprecated: Use setFrame instead.
Sets the border for the block (use NONE for no border).Parameters: border the border (null
not permitted).
Parameters: top the top border line width. left the left border line width. bottom the bottom border line width. right the right border line width.
Parameters: bounds the bounds (null
not permitted).
See Also: getBounds
Parameters: frame the frame (null
not permitted).
Since: 1.0.5
See Also: getFrame
Parameters: height the width (in Java2D units)
See Also: getHeight
Parameters: id the id (null
permitted).
See Also: getID
Parameters: margin the margin (null
not permitted).
See Also: getMargin
Parameters: top the top margin. left the left margin. bottom the bottom margin. right the right margin.
See Also: getMargin
Parameters: padding the padding (null
not permitted).
See Also: getPadding
Parameters: top the top padding. left the left padding. bottom the bottom padding. right the right padding.
Parameters: width the width (in Java2D units)
See Also: getWidth
Parameters: c the outer constraint (null
not permitted).
Returns: The content constraint.
Parameters: area the area (null
not permitted).
Returns: The trimmed area.
Parameters: area the area (null
not permitted).
Returns: The trimmed area.
Parameters: area the area (null
not permitted).
Returns: The trimmed area.
Parameters: fixedHeight the fixed height.
Returns: The available space.
See Also: AbstractBlock
Parameters: fixedWidth the fixed width.
Returns: The available space.
See Also: AbstractBlock