Method Summary |
|
public Size2D | arrange(Graphics2D g2) Arranges the contents of the block, with no constraints, and returns
the block size.
Parameters: g2 - the graphics device. |
public Size2D | arrange(Graphics2D g2, RectangleConstraint constraint) Arranges the contents of the block, within the given constraints, and
returns the block size.
Parameters: g2 - the graphics device. Parameters: constraint - the constraint (null not permitted). |
protected double | calculateTotalHeight(double contentHeight) Adds the margin, border and padding to the specified content height.
Parameters: contentHeight - the content height. |
protected double | calculateTotalWidth(double contentWidth) Adds the margin, border and padding to the specified content width.
Parameters: contentWidth - the content width. |
public 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. |
public boolean | equals(Object obj) Tests this block for equality with an arbitrary object.
Parameters: obj - the object (null permitted). |
public BlockBorder | getBorder() Returns the border. |
public Rectangle2D | getBounds() Returns the current bounds of the block. |
public double | getContentXOffset() Returns the x-offset for the content within the block. |
public double | getContentYOffset() Returns the y-offset for the content within the block. |
public BlockFrame | getFrame() Returns the current frame (border). |
public double | getHeight() Returns the natural height of the block, if this is known in advance.
The actual height of the block may be overridden if layout constraints
make this necessary. |
public String | getID() Returns the id. |
public RectangleInsets | getMargin() Returns the margin. |
public RectangleInsets | getPadding() Returns the padding. |
public double | getWidth() Returns the natural width of the block, if this is known in advance.
The actual width of the block may be overridden if layout constraints
make this necessary. |
public void | setBorder(BlockBorder border) Sets the border for the block (use
BlockBorder.NONE for
no border). |
public void | setBorder(double top, double left, double bottom, double right) Sets a black border with the specified line widths. |
public void | setBounds(Rectangle2D bounds) Sets the bounds of the block. |
public void | setFrame(BlockFrame frame) Sets the frame (or border). |
public void | setHeight(double height) Sets the natural width of the block, if this is known in advance. |
public void | setID(String id) Sets the id for the block. |
public void | setMargin(RectangleInsets margin) Sets the margin (use
RectangleInsets.ZERO_INSETS for no
padding). |
public void | setMargin(double top, double left, double bottom, double right) Sets the margin. |
public void | setPadding(RectangleInsets padding) Sets the padding (use
RectangleInsets.ZERO_INSETS for no
padding). |
public void | setPadding(double top, double left, double bottom, double right) Sets the padding. |
public 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.
Parameters: c - the outer constraint (null not permitted). |
protected Rectangle2D | trimBorder(Rectangle2D area) Reduces the specified area by the amount of space consumed
by the border.
Parameters: area - the area (null not permitted). |
protected Rectangle2D | trimMargin(Rectangle2D area) Reduces the specified area by the amount of space consumed
by the margin.
Parameters: area - the area (null not permitted). |
protected Rectangle2D | trimPadding(Rectangle2D area) Reduces the specified area by the amount of space consumed
by the padding.
Parameters: area - the area (null not permitted). |
protected double | trimToContentHeight(double fixedHeight) Calculate the height available for content after subtracting
the margin, border and padding space from the specified fixed
height.
Parameters: fixedHeight - the 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: fixedWidth - the fixed width. |