Package org.jfree.chart.block
Class BlockBorder
java.lang.Object
org.jfree.chart.block.BlockBorder
- All Implemented Interfaces:
Serializable,BlockFrame
A border for a block. This class is immutable.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RectangleInsetsThe space reserved for the border.static final BlockBorderAn empty border.private PaintThe border color.private static final longFor serialization. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a default border.BlockBorder(double top, double left, double bottom, double right) Creates a new border with the specified line widths (in black).BlockBorder(double top, double left, double bottom, double right, Paint paint) Creates a new border with the specified line widths (in black).BlockBorder(Paint paint) Creates a new border with the specified color.BlockBorder(RectangleInsets insets, Paint paint) Creates a new border. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(Graphics2D g2, Rectangle2D area) Draws the border by filling in the reserved space.booleanTests this border for equality with an arbitrary instance.Returns the space reserved for the border.getPaint()Returns the paint used to draw the border.inthashCode()private voidreadObject(ObjectInputStream stream) Provides serialization support.private voidwriteObject(ObjectOutputStream stream) Provides serialization support.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor serialization.- See Also:
-
NONE
An empty border. -
insets
The space reserved for the border. -
paint
The border color.
-
-
Constructor Details
-
BlockBorder
public BlockBorder()Creates a default border. -
BlockBorder
Creates a new border with the specified color.- Parameters:
paint- the color (nullnot permitted).
-
BlockBorder
public BlockBorder(double top, double left, double bottom, double right) Creates a new border with the specified line widths (in black).- Parameters:
top- the width of the top border.left- the width of the left border.bottom- the width of the bottom border.right- the width of the right border.
-
BlockBorder
Creates a new border with the specified line widths (in black).- Parameters:
top- the width of the top border.left- the width of the left border.bottom- the width of the bottom border.right- the width of the right border.paint- the border paint (nullnot permitted).
-
BlockBorder
Creates a new border.- Parameters:
insets- the border insets (nullnot permitted).paint- the paint (nullnot permitted).
-
-
Method Details
-
getInsets
Returns the space reserved for the border.- Specified by:
getInsetsin interfaceBlockFrame- Returns:
- The space (never
null).
-
getPaint
Returns the paint used to draw the border.- Returns:
- The paint (never
null).
-
draw
Draws the border by filling in the reserved space.- Specified by:
drawin interfaceBlockFrame- Parameters:
g2- the graphics device.area- the area.
-
equals
Tests this border for equality with an arbitrary instance. -
hashCode
public int hashCode() -
writeObject
Provides serialization support.- Parameters:
stream- the output stream.- Throws:
IOException- if there is an I/O error.
-
readObject
Provides serialization support.- Parameters:
stream- the input stream.- Throws:
IOException- if there is an I/O error.ClassNotFoundException- if there is a classpath problem.
-