Package org.jfree.chart.block
Class BlockBorder
- java.lang.Object
-
- org.jfree.chart.block.BlockBorder
-
- All Implemented Interfaces:
java.io.Serializable,BlockFrame
public class BlockBorder extends java.lang.Object implements BlockFrame, java.io.Serializable
A border for a block. This class is immutable.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private RectangleInsetsinsetsThe space reserved for the border.static BlockBorderNONEAn empty border.private java.awt.PaintpaintThe border color.private static longserialVersionUIDFor serialization.
-
Constructor Summary
Constructors Constructor Description BlockBorder()Creates 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, java.awt.Paint paint)Creates a new border with the specified line widths (in black).BlockBorder(java.awt.Paint paint)Creates a new border with the specified color.BlockBorder(RectangleInsets insets, java.awt.Paint paint)Creates a new border.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddraw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)Draws the border by filling in the reserved space.booleanequals(java.lang.Object obj)Tests this border for equality with an arbitrary instance.RectangleInsetsgetInsets()Returns the space reserved for the border.java.awt.PaintgetPaint()Returns the paint used to draw the border.inthashCode()private voidreadObject(java.io.ObjectInputStream stream)Provides serialization support.private voidwriteObject(java.io.ObjectOutputStream stream)Provides serialization support.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
NONE
public static final BlockBorder NONE
An empty border.
-
insets
private final RectangleInsets insets
The space reserved for the border.
-
paint
private transient java.awt.Paint paint
The border color.
-
-
Constructor Detail
-
BlockBorder
public BlockBorder()
Creates a default border.
-
BlockBorder
public BlockBorder(java.awt.Paint paint)
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
public BlockBorder(double top, double left, double bottom, double right, java.awt.Paint paint)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
public BlockBorder(RectangleInsets insets, java.awt.Paint paint)
Creates a new border.- Parameters:
insets- the border insets (nullnot permitted).paint- the paint (nullnot permitted).
-
-
Method Detail
-
getInsets
public RectangleInsets getInsets()
Returns the space reserved for the border.- Specified by:
getInsetsin interfaceBlockFrame- Returns:
- The space (never
null).
-
getPaint
public java.awt.Paint getPaint()
Returns the paint used to draw the border.- Returns:
- The paint (never
null).
-
draw
public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)Draws the border by filling in the reserved space.- Specified by:
drawin interfaceBlockFrame- Parameters:
g2- the graphics device.area- the area.
-
equals
public boolean equals(java.lang.Object obj)
Tests this border for equality with an arbitrary instance.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOExceptionProvides serialization support.- Parameters:
stream- the output stream.- Throws:
java.io.IOException- if there is an I/O error.
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundExceptionProvides serialization support.- Parameters:
stream- the input stream.- Throws:
java.io.IOException- if there is an I/O error.java.lang.ClassNotFoundException- if there is a classpath problem.
-
-