public class TextBox
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private java.awt.Paint |
backgroundPaint
The background paint.
|
private RectangleInsets |
interiorGap
The interior space.
|
private java.awt.Paint |
outlinePaint
The outline paint.
|
private java.awt.Stroke |
outlineStroke
The outline stroke.
|
private static long |
serialVersionUID
For serialization.
|
private java.awt.Paint |
shadowPaint
The shadow paint.
|
private double |
shadowXOffset
The shadow x-offset.
|
private double |
shadowYOffset
The shadow y-offset.
|
private TextBlock |
textBlock
The text block.
|
Constructor and Description |
---|
TextBox()
Creates an empty text box.
|
TextBox(java.lang.String text)
Creates a text box.
|
TextBox(TextBlock block)
Creates a new text box.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(java.awt.Graphics2D g2,
float x,
float y,
RectangleAnchor anchor)
Draws the text box.
|
boolean |
equals(java.lang.Object obj)
Tests this object for equality with an arbitrary object.
|
java.awt.Paint |
getBackgroundPaint()
Returns the background paint.
|
double |
getHeight(java.awt.Graphics2D g2)
Returns the height of the text box.
|
RectangleInsets |
getInteriorGap()
Returns the interior gap.
|
java.awt.Paint |
getOutlinePaint()
Returns the outline paint.
|
java.awt.Stroke |
getOutlineStroke()
Returns the outline stroke.
|
java.awt.Paint |
getShadowPaint()
Returns the shadow paint.
|
double |
getShadowXOffset()
Returns the x-offset for the shadow effect.
|
double |
getShadowYOffset()
Returns the y-offset for the shadow effect.
|
TextBlock |
getTextBlock()
Returns the text block.
|
int |
hashCode()
Returns a hash code for this object.
|
private void |
readObject(java.io.ObjectInputStream stream)
Provides serialization support.
|
void |
setBackgroundPaint(java.awt.Paint paint)
Sets the background paint.
|
void |
setInteriorGap(RectangleInsets gap)
Sets the interior gap.
|
void |
setOutlinePaint(java.awt.Paint paint)
Sets the outline paint.
|
void |
setOutlineStroke(java.awt.Stroke stroke)
Sets the outline stroke.
|
void |
setShadowPaint(java.awt.Paint paint)
Sets the shadow paint.
|
void |
setShadowXOffset(double offset)
Sets the x-offset for the shadow effect.
|
void |
setShadowYOffset(double offset)
Sets the y-offset for the shadow effect.
|
void |
setTextBlock(TextBlock block)
Sets the text block.
|
private void |
writeObject(java.io.ObjectOutputStream stream)
Provides serialization support.
|
private static final long serialVersionUID
private transient java.awt.Paint outlinePaint
private transient java.awt.Stroke outlineStroke
private RectangleInsets interiorGap
private transient java.awt.Paint backgroundPaint
private transient java.awt.Paint shadowPaint
private double shadowXOffset
private double shadowYOffset
private TextBlock textBlock
public TextBox()
public TextBox(java.lang.String text)
text
- the text.public TextBox(TextBlock block)
block
- the text block.public java.awt.Paint getOutlinePaint()
public void setOutlinePaint(java.awt.Paint paint)
paint
- the paint.public java.awt.Stroke getOutlineStroke()
public void setOutlineStroke(java.awt.Stroke stroke)
stroke
- the stroke.public RectangleInsets getInteriorGap()
public void setInteriorGap(RectangleInsets gap)
gap
- the gap.public java.awt.Paint getBackgroundPaint()
public void setBackgroundPaint(java.awt.Paint paint)
paint
- the paint.public java.awt.Paint getShadowPaint()
public void setShadowPaint(java.awt.Paint paint)
paint
- the paint.public double getShadowXOffset()
public void setShadowXOffset(double offset)
offset
- the offset (in Java2D units).public double getShadowYOffset()
public void setShadowYOffset(double offset)
offset
- the offset (in Java2D units).public TextBlock getTextBlock()
public void setTextBlock(TextBlock block)
block
- the block.public void draw(java.awt.Graphics2D g2, float x, float y, RectangleAnchor anchor)
g2
- the graphics device.x
- the x-coordinate.y
- the y-coordinate.anchor
- the anchor point.public double getHeight(java.awt.Graphics2D g2)
g2
- the graphics device.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to test against (null
permitted).public int hashCode()
hashCode
in class java.lang.Object
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOException
stream
- the output stream.java.io.IOException
- if there is an I/O error.private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundException
stream
- the input stream.java.io.IOException
- if there is an I/O error.java.lang.ClassNotFoundException
- if there is a classpath problem.