|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.chart.block.AbstractBlock
A convenience class for creating new classes that implement
the Block
interface.
Constructor Summary | |
protected |
AbstractBlock()
Creates a new block. |
Method Summary | |
Size2D |
arrange(java.awt.Graphics2D g2)
Arranges the contents of the block, with no constraints, and returns the block size. |
Size2D |
arrange(java.awt.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. |
protected void |
drawBorder(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
Draws the border around the perimeter of the specified area. |
boolean |
equals(java.lang.Object obj)
Tests this block for equality with an arbitrary object. |
BlockBorder |
getBorder()
Returns the border. |
java.awt.geom.Rectangle2D |
getBounds()
Returns the current bounds of the block. |
double |
getHeight()
Returns the natural height of the block, if this is known in advance. |
java.lang.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. |
void |
setBounds(java.awt.geom.Rectangle2D bounds)
Sets the bounds of the block. |
void |
setHeight(double height)
Sets the natural width of the block, if this is known in advance. |
void |
setID(java.lang.String id)
Sets the id for the block. |
void |
setMargin(RectangleInsets margin)
Sets the margin. |
void |
setPadding(RectangleInsets padding)
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 java.awt.geom.Rectangle2D |
trimBorder(java.awt.geom.Rectangle2D area)
Reduces the specified area by the amount of space consumed by the border. |
protected java.awt.geom.Rectangle2D |
trimMargin(java.awt.geom.Rectangle2D area)
Reduces the specified area by the amount of space consumed by the margin. |
protected java.awt.geom.Rectangle2D |
trimPadding(java.awt.geom.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. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected AbstractBlock()
Method Detail |
public java.lang.String getID()
null
).public void setID(java.lang.String id)
id
- the id (null
permitted).public double getWidth()
public void setWidth(double width)
width
- the width (in Java2D units)public double getHeight()
public void setHeight(double height)
height
- the width (in Java2D units)public RectangleInsets getMargin()
null
).public void setMargin(RectangleInsets margin)
RectangleInsets#ZERO_INSETS
for no
padding.
margin
- the margin (null
not permitted).public BlockBorder getBorder()
null
).public void setBorder(BlockBorder border)
BlockBorder.NONE
for
no border.
border
- the border (null
not permitted).public RectangleInsets getPadding()
null
).public void setPadding(RectangleInsets padding)
RectangleInsets#ZERO_INSETS
for no
padding.
padding
- the padding (never null
).public Size2D arrange(java.awt.Graphics2D g2)
g2
- the graphics device.
null
).public Size2D arrange(java.awt.Graphics2D g2, RectangleConstraint constraint)
g2
- the graphics device.constraint
- the constraint (null
not permitted).
null
).public java.awt.geom.Rectangle2D getBounds()
public void setBounds(java.awt.geom.Rectangle2D bounds)
bounds
- the bounds (null
not permitted).protected double trimToContentWidth(double fixedWidth)
fixedWidth
- the fixed width.
protected double trimToContentHeight(double fixedHeight)
fixedHeight
- the fixed height.
protected RectangleConstraint toContentConstraint(RectangleConstraint c)
c
- the outer constraint (null
not permitted).
protected double calculateTotalWidth(double contentWidth)
contentWidth
- the content width.
protected double calculateTotalHeight(double contentHeight)
contentHeight
- the content height.
protected java.awt.geom.Rectangle2D trimMargin(java.awt.geom.Rectangle2D area)
area
- the area (null
not permitted).
protected java.awt.geom.Rectangle2D trimBorder(java.awt.geom.Rectangle2D area)
area
- the area (null
not permitted).
protected java.awt.geom.Rectangle2D trimPadding(java.awt.geom.Rectangle2D area)
area
- the area (null
not permitted).
protected void drawBorder(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
g2
- the graphics device.area
- the area.public boolean equals(java.lang.Object obj)
obj
- the object (null
permitted).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |