Package org.jfree.chart.text
Class TextBox
- java.lang.Object
-
- org.jfree.chart.text.TextBox
-
- All Implemented Interfaces:
java.io.Serializable
public class TextBox extends java.lang.Object implements java.io.SerializableA box containing a text block.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.PaintbackgroundPaintThe background paint.private RectangleInsetsinteriorGapThe interior space.private java.awt.PaintoutlinePaintThe outline paint.private java.awt.StrokeoutlineStrokeThe outline stroke.private static longserialVersionUIDFor serialization.private java.awt.PaintshadowPaintThe shadow paint.private doubleshadowXOffsetThe shadow x-offset.private doubleshadowYOffsetThe shadow y-offset.private TextBlocktextBlockThe text block.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddraw(java.awt.Graphics2D g2, float x, float y, RectangleAnchor anchor)Draws the text box.booleanequals(java.lang.Object obj)Tests this object for equality with an arbitrary object.java.awt.PaintgetBackgroundPaint()Returns the background paint.doublegetHeight(java.awt.Graphics2D g2)Returns the height of the text box.RectangleInsetsgetInteriorGap()Returns the interior gap.java.awt.PaintgetOutlinePaint()Returns the outline paint.java.awt.StrokegetOutlineStroke()Returns the outline stroke.java.awt.PaintgetShadowPaint()Returns the shadow paint.doublegetShadowXOffset()Returns the x-offset for the shadow effect.doublegetShadowYOffset()Returns the y-offset for the shadow effect.TextBlockgetTextBlock()Returns the text block.inthashCode()Returns a hash code for this object.private voidreadObject(java.io.ObjectInputStream stream)Provides serialization support.voidsetBackgroundPaint(java.awt.Paint paint)Sets the background paint.voidsetInteriorGap(RectangleInsets gap)Sets the interior gap.voidsetOutlinePaint(java.awt.Paint paint)Sets the outline paint.voidsetOutlineStroke(java.awt.Stroke stroke)Sets the outline stroke.voidsetShadowPaint(java.awt.Paint paint)Sets the shadow paint.voidsetShadowXOffset(double offset)Sets the x-offset for the shadow effect.voidsetShadowYOffset(double offset)Sets the y-offset for the shadow effect.voidsetTextBlock(TextBlock block)Sets the text block.private voidwriteObject(java.io.ObjectOutputStream stream)Provides serialization support.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
outlinePaint
private transient java.awt.Paint outlinePaint
The outline paint.
-
outlineStroke
private transient java.awt.Stroke outlineStroke
The outline stroke.
-
interiorGap
private RectangleInsets interiorGap
The interior space.
-
backgroundPaint
private transient java.awt.Paint backgroundPaint
The background paint.
-
shadowPaint
private transient java.awt.Paint shadowPaint
The shadow paint.
-
shadowXOffset
private double shadowXOffset
The shadow x-offset.
-
shadowYOffset
private double shadowYOffset
The shadow y-offset.
-
textBlock
private TextBlock textBlock
The text block.
-
-
Constructor Detail
-
TextBox
public TextBox()
Creates an empty text box.
-
TextBox
public TextBox(java.lang.String text)
Creates a text box.- Parameters:
text- the text.
-
TextBox
public TextBox(TextBlock block)
Creates a new text box.- Parameters:
block- the text block.
-
-
Method Detail
-
getOutlinePaint
public java.awt.Paint getOutlinePaint()
Returns the outline paint.- Returns:
- The outline paint.
-
setOutlinePaint
public void setOutlinePaint(java.awt.Paint paint)
Sets the outline paint.- Parameters:
paint- the paint.
-
getOutlineStroke
public java.awt.Stroke getOutlineStroke()
Returns the outline stroke.- Returns:
- The outline stroke.
-
setOutlineStroke
public void setOutlineStroke(java.awt.Stroke stroke)
Sets the outline stroke.- Parameters:
stroke- the stroke.
-
getInteriorGap
public RectangleInsets getInteriorGap()
Returns the interior gap.- Returns:
- The interior gap.
-
setInteriorGap
public void setInteriorGap(RectangleInsets gap)
Sets the interior gap.- Parameters:
gap- the gap.
-
getBackgroundPaint
public java.awt.Paint getBackgroundPaint()
Returns the background paint.- Returns:
- The background paint.
-
setBackgroundPaint
public void setBackgroundPaint(java.awt.Paint paint)
Sets the background paint.- Parameters:
paint- the paint.
-
getShadowPaint
public java.awt.Paint getShadowPaint()
Returns the shadow paint.- Returns:
- The shadow paint.
-
setShadowPaint
public void setShadowPaint(java.awt.Paint paint)
Sets the shadow paint.- Parameters:
paint- the paint.
-
getShadowXOffset
public double getShadowXOffset()
Returns the x-offset for the shadow effect.- Returns:
- The offset.
-
setShadowXOffset
public void setShadowXOffset(double offset)
Sets the x-offset for the shadow effect.- Parameters:
offset- the offset (in Java2D units).
-
getShadowYOffset
public double getShadowYOffset()
Returns the y-offset for the shadow effect.- Returns:
- The offset.
-
setShadowYOffset
public void setShadowYOffset(double offset)
Sets the y-offset for the shadow effect.- Parameters:
offset- the offset (in Java2D units).
-
getTextBlock
public TextBlock getTextBlock()
Returns the text block.- Returns:
- The text block.
-
setTextBlock
public void setTextBlock(TextBlock block)
Sets the text block.- Parameters:
block- the block.
-
draw
public void draw(java.awt.Graphics2D g2, float x, float y, RectangleAnchor anchor)Draws the text box.- Parameters:
g2- the graphics device.x- the x-coordinate.y- the y-coordinate.anchor- the anchor point.
-
getHeight
public double getHeight(java.awt.Graphics2D g2)
Returns the height of the text box.- Parameters:
g2- the graphics device.- Returns:
- The height (in Java2D units).
-
equals
public boolean equals(java.lang.Object obj)
Tests this object for equality with an arbitrary object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object to test against (nullpermitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
Returns a hash code for this object.- Overrides:
hashCodein classjava.lang.Object- Returns:
- A hash code.
-
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.
-
-