java.lang.Objectobjectdraw.ObjectDrawObject
objectdraw.ObjectDrawShape
objectdraw.Text
public class Text
A Text
object displays some text on the screen. The text can have multiple lines
separated by "\n" line breaks, and can be aligned in various different ways. It is also
possible to wrap text within another shape, or align it along a line. The shape that a
Text
is aligned with or wrapped within is called its basis.
The color, font, size, and style of text can be altered. If you want to have text
containing runs of several different styles, you can create many Text
objects
and chain them together by passing along the previous segment as the basis
when you create a new segment.
Field Summary | |
---|---|
static int |
BOTTOM
Alignment value to align the bottom of text with the basis |
static int |
CENTER
Alignment value to center text with respect to the basis. |
static Font |
DEFAULT_FONT
Font used for newly created Text objects |
static int |
LEFT
Alignment value to align the left edge of text with the basis. |
static int |
RIGHT
Alignment value to align the right edge of text with the basis. |
static int |
TOP
Alignment value to align the top of text with the basis. |
Constructor Summary | |
---|---|
Text(boolean text,
double x,
double y,
Color color,
DrawingCanvas canvas)
Create a Text object at (x , y ), displaying the
given text in the given color . |
|
Text(boolean text,
double x,
double y,
DrawingCanvas canvas)
Create a Text object at (x , y ), displaying the
given text . |
|
Text(boolean text,
DrawableInterface basis,
Color color,
DrawingCanvas canvas)
Create a Text object attached to the given basis , displaying the
given text in the given color . |
|
Text(boolean text,
DrawableInterface basis,
DrawingCanvas canvas)
Create a Text object attached to the given basis , displaying the
given text . |
|
Text(boolean text,
Location origin,
Color color,
DrawingCanvas canvas)
Create a Text object at origin , displaying the
given text in the given color . |
|
Text(boolean text,
Location origin,
DrawingCanvas canvas)
Create a Text object at origin , displaying the
given text . |
|
Text(char text,
double x,
double y,
Color color,
DrawingCanvas canvas)
Create a Text object at (x , y ), displaying the
given text in the given color . |
|
Text(char text,
double x,
double y,
DrawingCanvas canvas)
Create a Text object at (x , y ), displaying the
given text . |
|
Text(char text,
DrawableInterface basis,
Color color,
DrawingCanvas canvas)
Create a Text object attached to the given basis , displaying the
given text in the given color . |
|
Text(char text,
DrawableInterface basis,
DrawingCanvas canvas)
Create a Text object attached to the given basis , displaying the
given text . |
|
Text(char text,
Location origin,
Color color,
DrawingCanvas canvas)
Create a Text object at origin , displaying the
given text in the given color . |
|
Text(char text,
Location origin,
DrawingCanvas canvas)
Create a Text object at origin , displaying the
given text . |
|
Text(double text,
double x,
double y,
Color color,
DrawingCanvas canvas)
Create a Text object at (x , y ), displaying the
given text in the given color . |
|
Text(double text,
double x,
double y,
DrawingCanvas canvas)
Create a Text object at (x , y ), displaying the
given text . |
|
Text(double text,
DrawableInterface basis,
Color color,
DrawingCanvas canvas)
Create a Text object attached to the given basis , displaying the
given text in the given color . |
|
Text(double text,
DrawableInterface basis,
DrawingCanvas canvas)
Create a Text object attached to the given basis , displaying the
given text . |
|
Text(double text,
Location origin,
Color color,
DrawingCanvas canvas)
Create a Text object at origin , displaying the
given text in the given color . |
|
Text(double text,
Location origin,
DrawingCanvas canvas)
Create a Text object at origin , displaying the
given text . |
|
Text(long text,
double x,
double y,
Color color,
DrawingCanvas canvas)
Create a Text object at (x , y ), displaying the
given text in the given color . |
|
Text(long text,
double x,
double y,
DrawingCanvas canvas)
Create a Text object at (x , y ), displaying the
given text . |
|
Text(long text,
DrawableInterface basis,
Color color,
DrawingCanvas canvas)
Create a Text object attached to the given basis , displaying the
given text in the given color . |
|
Text(long text,
DrawableInterface basis,
DrawingCanvas canvas)
Create a Text object attached to the given basis , displaying the
given text . |
|
Text(long text,
Location origin,
Color color,
DrawingCanvas canvas)
Create a Text object at origin , displaying the
given text in the given color . |
|
Text(long text,
Location origin,
DrawingCanvas canvas)
Create a Text object at origin , displaying the
given text . |
|
Text(Object text,
double x,
double y,
Color color,
DrawingCanvas canvas)
Create a Text object at (x , y ), displaying the
given text in the given color . |
|
Text(Object text,
double x,
double y,
DrawingCanvas canvas)
Create a Text object at (x , y ), displaying the
given text . |
|
Text(Object text,
DrawableInterface basis,
Color color,
DrawingCanvas canvas)
Create a Text object attached to the given basis , displaying the
given text in the given color . |
|
Text(Object text,
DrawableInterface basis,
DrawingCanvas canvas)
Create a Text object attached to the given basis , displaying the
given text . |
|
Text(Object text,
Location origin,
Color color,
DrawingCanvas canvas)
Create a Text object at origin , displaying the
given text in the given color . |
|
Text(Object text,
Location origin,
DrawingCanvas canvas)
Create a Text object at origin , displaying the
given text . |
Method Summary | |
---|---|
void |
addToCanvas(DrawingCanvas c)
Place this object on the specified canvas. |
boolean |
contains(Location point)
Return true if the given location is inside this object, false
otherwise. |
static String |
formatDecimal(double num)
Format a decimal value as a string, using a maximum of 4 decimal points. |
static String |
formatDecimal(double num,
int places)
Format a decimal value as a string, using a maximum of places decimal points. |
DrawableInterface |
getBasis()
Get the shape that is the basis of this text, or null if this text is simply
placed at a point, with no basis. |
DrawingCanvas |
getCanvas()
Return the canvas that this object is on. |
Color |
getColor()
Return the color of this object |
double |
getDoubleHeight()
Return the height of the rectangle bounding this object, in double precision. |
double |
getDoubleWidth()
Return the height of the rectangle bounding this object, in double precision. |
double |
getDoubleX()
Get this object's x coordinate, in double precision. |
double |
getDoubleY()
Get this object's y coordinate, in double precision. |
Font |
getFont()
Return the Font object representing the font, font size, and style of this
Text . |
int |
getHeight()
Return the width of the rectangle bounding this object. |
double |
getHorizontalAlignment()
Retrieve the horizontal alignment value |
Location |
getLocation()
Get this object's location. |
Text |
getNext()
Get the next Text object in a chain, or null if there is no
more text after this one. |
Text |
getPrevious()
Get the previous Text object in a chain, or null if there is no
more text before this one. |
String |
getText()
Return the text string displayed by this Text . |
double |
getVerticalAlignment()
Retrieve the vertical alignment value |
int |
getWidth()
Return the height of the rectangle bounding this object. |
int |
getX()
Get this object's x coordinate. |
int |
getY()
Get this object's y coordinate. |
void |
hide()
Make this object invisible. |
boolean |
isHidden()
Return true if this object has been rendered invisible with a call to its
hide() method, false if it is still being drawn. |
void |
move(double dx,
double dy)
Shift (translate) this object left or right by an amount dx , and up or
down by an amount dy . |
void |
moveTo(double x,
double y)
Move the reference point of this object to the given location. |
void |
moveTo(Location point)
Move the reference point of this object to the given location. |
boolean |
overlaps(Drawable2DInterface other)
Return true if the rectangle bounding this object overlaps with the
rectangle bounding another object; false otherwise. |
void |
removeFromCanvas()
Remove this object from its canvas. |
void |
sendBackward()
Move this object one step backward in the draw order, causing it to be drawn underneath the objects that are in front of it. |
void |
sendForward()
Move this object one step forward in the draw order, causing it to be drawn on top of the objects that are behind it. |
void |
sendToBack()
Move this object to the very back of the draw order, causing it to be drawn underneath all the other objects. |
void |
sendToFront()
Move this object to the very front of the draw order, causing it to be drawn on top of all the other objects. |
void |
setAlignment(double horizontalAlign,
double verticalAlign)
Set the horizontal and vertical alignment of this text. |
void |
setBold()
Set this text to be bold |
void |
setBold(boolean b)
Set this font to be bold or not, depending on the value of b . |
void |
setColor(Color c)
Change the color of this object. |
void |
setFont(Font f)
Set the Font of this Text . |
void |
setFont(String fname)
Change the font name being used by this Text . |
void |
setFontSize(int size)
Change the font size of this text. |
void |
setItalic()
Set this text to be italic |
void |
setItalic(boolean i)
Set this font to be italic or not, depending on the value of i . |
void |
setPlain()
Set the style of this text to plain (not bold or italic) |
void |
setText(String t)
Change the text string displayed by this Text . |
void |
show()
Make an object visible again after it had been hidden. |
String |
toString()
Return a string describing how this object might be constructed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface objectdraw.TextWrappingLayout.TextRun |
---|
getNextRun, setShape |
Field Detail |
---|
public static final int BOTTOM
public static final int CENTER
public static final Font DEFAULT_FONT
Font
used for newly created Text
objects
public static final int LEFT
public static final int RIGHT
public static final int TOP
Constructor Detail |
---|
public Text(boolean text, double x, double y, Color color, DrawingCanvas canvas)
Text
object at (x
, y
), displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.x
- x coordinate of the Text
's positiony
- y coordinate of the Text
's positioncolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(boolean text, double x, double y, DrawingCanvas canvas)
Text
object at (x
, y
), displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.x
- x coordinate of the Text
's positiony
- y coordinate of the Text
's positioncanvas
- DrawingCanvas
to place this text
onpublic Text(boolean text, DrawableInterface basis, Color color, DrawingCanvas canvas)
Text
object attached to the given basis
, displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.basis
- shape that this text
will be attached tocolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(boolean text, DrawableInterface basis, DrawingCanvas canvas)
Text
object attached to the given basis
, displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.basis
- shape that this text
will be attached tocanvas
- DrawingCanvas
to place this text
onpublic Text(boolean text, Location origin, Color color, DrawingCanvas canvas)
Text
object at origin
, displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.origin
- Location
at which this Text
will be positionedcolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(boolean text, Location origin, DrawingCanvas canvas)
Text
object at origin
, displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.origin
- Location
at which this Text
will be positionedcanvas
- DrawingCanvas
to place this text
onpublic Text(char text, double x, double y, Color color, DrawingCanvas canvas)
Text
object at (x
, y
), displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.x
- x coordinate of the Text
's positiony
- y coordinate of the Text
's positioncolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(char text, double x, double y, DrawingCanvas canvas)
Text
object at (x
, y
), displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.x
- x coordinate of the Text
's positiony
- y coordinate of the Text
's positioncanvas
- DrawingCanvas
to place this text
onpublic Text(char text, DrawableInterface basis, Color color, DrawingCanvas canvas)
Text
object attached to the given basis
, displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.basis
- shape that this text
will be attached tocolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(char text, DrawableInterface basis, DrawingCanvas canvas)
Text
object attached to the given basis
, displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.basis
- shape that this text
will be attached tocanvas
- DrawingCanvas
to place this text
onpublic Text(char text, Location origin, Color color, DrawingCanvas canvas)
Text
object at origin
, displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.origin
- Location
at which this Text
will be positionedcolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(char text, Location origin, DrawingCanvas canvas)
Text
object at origin
, displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.origin
- Location
at which this Text
will be positionedcanvas
- DrawingCanvas
to place this text
onpublic Text(double text, double x, double y, Color color, DrawingCanvas canvas)
Text
object at (x
, y
), displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.x
- x coordinate of the Text
's positiony
- y coordinate of the Text
's positioncolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(double text, double x, double y, DrawingCanvas canvas)
Text
object at (x
, y
), displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.x
- x coordinate of the Text
's positiony
- y coordinate of the Text
's positioncanvas
- DrawingCanvas
to place this text
onpublic Text(double text, DrawableInterface basis, Color color, DrawingCanvas canvas)
Text
object attached to the given basis
, displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.basis
- shape that this text
will be attached tocolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(double text, DrawableInterface basis, DrawingCanvas canvas)
Text
object attached to the given basis
, displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.basis
- shape that this text
will be attached tocanvas
- DrawingCanvas
to place this text
onpublic Text(double text, Location origin, Color color, DrawingCanvas canvas)
Text
object at origin
, displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.origin
- Location
at which this Text
will be positionedcolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(double text, Location origin, DrawingCanvas canvas)
Text
object at origin
, displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.origin
- Location
at which this Text
will be positionedcanvas
- DrawingCanvas
to place this text
onpublic Text(long text, double x, double y, Color color, DrawingCanvas canvas)
Text
object at (x
, y
), displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.x
- x coordinate of the Text
's positiony
- y coordinate of the Text
's positioncolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(long text, double x, double y, DrawingCanvas canvas)
Text
object at (x
, y
), displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.x
- x coordinate of the Text
's positiony
- y coordinate of the Text
's positioncanvas
- DrawingCanvas
to place this text
onpublic Text(long text, DrawableInterface basis, Color color, DrawingCanvas canvas)
Text
object attached to the given basis
, displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.basis
- shape that this text
will be attached tocolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(long text, DrawableInterface basis, DrawingCanvas canvas)
Text
object attached to the given basis
, displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.basis
- shape that this text
will be attached tocanvas
- DrawingCanvas
to place this text
onpublic Text(long text, Location origin, Color color, DrawingCanvas canvas)
Text
object at origin
, displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.origin
- Location
at which this Text
will be positionedcolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(long text, Location origin, DrawingCanvas canvas)
Text
object at origin
, displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.origin
- Location
at which this Text
will be positionedcanvas
- DrawingCanvas
to place this text
onpublic Text(Object text, double x, double y, Color color, DrawingCanvas canvas)
Text
object at (x
, y
), displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.x
- x coordinate of the Text
's positiony
- y coordinate of the Text
's positioncolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(Object text, double x, double y, DrawingCanvas canvas)
Text
object at (x
, y
), displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.x
- x coordinate of the Text
's positiony
- y coordinate of the Text
's positioncanvas
- DrawingCanvas
to place this text
onpublic Text(Object text, DrawableInterface basis, Color color, DrawingCanvas canvas)
Text
object attached to the given basis
, displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.basis
- shape that this text
will be attached tocolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(Object text, DrawableInterface basis, DrawingCanvas canvas)
Text
object attached to the given basis
, displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.basis
- shape that this text
will be attached tocanvas
- DrawingCanvas
to place this text
onpublic Text(Object text, Location origin, Color color, DrawingCanvas canvas)
Text
object at origin
, displaying the
given text
in the given color
. It will start out using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.origin
- Location
at which this Text
will be positionedcolor
- Color
of the Text
canvas
- DrawingCanvas
to place this text
onpublic Text(Object text, Location origin, DrawingCanvas canvas)
Text
object at origin
, displaying the
given text
. It will start out drawn in black, using the
default font and default alignment (bottom left).
text
- value whose String
form will be displayed.origin
- Location
at which this Text
will be positionedcanvas
- DrawingCanvas
to place this text
onMethod Detail |
---|
public void addToCanvas(DrawingCanvas c)
null
the object is simply removed from its current canvas.
addToCanvas
in interface DrawableInterface
addToCanvas
in class objectdraw.ObjectDrawShape
c
- DrawingCanvas
to place this object onpublic boolean contains(Location point)
true
if the given location is inside this object, false
otherwise. Because Line
s and FramedArc
s have no "inside", a
point is considered to be contained in one of them as long as it is within a few pixels
of the line.
contains
in interface DrawableInterface
point
- Location
to test
public static String formatDecimal(double num)
num
- number to format
String
representation of that numberpublic static String formatDecimal(double num, int places)
places
decimal points.
num
- number to formatplaces
- maximum number of decimal places
String
representation of that numberpublic DrawableInterface getBasis()
null
if this text is simply
placed at a point, with no basis.
public DrawingCanvas getCanvas()
null
.
getCanvas
in interface DrawableInterface
getCanvas
in class objectdraw.ObjectDrawShape
DrawingCanvas
that this object is on.public Color getColor()
getColor
in interface DrawableInterface
getColor
in class objectdraw.ObjectDrawShape
Color
of this objectpublic double getDoubleHeight()
getDoubleHeight
in interface Drawable2DInterface
public double getDoubleWidth()
getDoubleWidth
in interface Drawable2DInterface
public double getDoubleX()
getDoubleX
in interface LocatableInterface
public double getDoubleY()
getDoubleY
in interface LocatableInterface
public Font getFont()
Font
object representing the font, font size, and style of this
Text
.
getFont
in interface objectdraw.TextWrappingLayout.TextRun
public int getHeight()
getHeight
in interface Drawable2DInterface
public double getHorizontalAlignment()
public Location getLocation()
Location
object
will have the same effect as moving the object. So, the following two lines
of code are equivalent:
object.move(10, 20);
object.getLocation().translate(10, 20);
Location
offset by some
amount from the Location
of this object, without actually
moving this object, use the offset()
method in Location
,
which creates a new Location
.
getLocation
in interface LocatableInterface
Location
of this object.public Text getNext()
Text
object in a chain, or null
if there is no
more text after this one.
Text
in the chainpublic Text getPrevious()
Text
object in a chain, or null
if there is no
more text before this one.
Text
in the chainpublic String getText()
Text
.
getText
in interface objectdraw.TextWrappingLayout.TextRun
Text
public double getVerticalAlignment()
public int getWidth()
getWidth
in interface Drawable2DInterface
public int getX()
getX
in interface LocatableInterface
public int getY()
getY
in interface LocatableInterface
public void hide()
hide
in interface DrawableInterface
hide
in class objectdraw.ObjectDrawShape
public boolean isHidden()
true
if this object has been rendered invisible with a call to its
hide()
method, false
if it is still being drawn.
isHidden
in interface DrawableInterface
isHidden
in class objectdraw.ObjectDrawShape
public void move(double dx, double dy)
dx
, and up or
down by an amount dy
. A negative dx
indicates a shift to the
left; a negative dy
indicates a shift up
move
in interface DrawableInterface
move
in class objectdraw.ObjectDrawShape
dx
- amount of x translationdy
- amount of y translationpublic void moveTo(double x, double y)
moveTo
in interface DrawableInterface
moveTo
in class objectdraw.ObjectDrawShape
x
- x coordinate to move toy
- y coordinate to move topublic void moveTo(Location point)
moveTo
in interface DrawableInterface
moveTo
in class objectdraw.ObjectDrawShape
point
- Location
to move topublic boolean overlaps(Drawable2DInterface other)
true
if the rectangle bounding this object overlaps with the
rectangle bounding another object; false
otherwise.
overlaps
in interface Drawable2DInterface
other
- another two dimensional object to check for overlapping with
public void removeFromCanvas()
removeFromCanvas
in interface DrawableInterface
removeFromCanvas
in class objectdraw.ObjectDrawShape
public void sendBackward()
sendBackward
in interface DrawableInterface
sendBackward
in class objectdraw.ObjectDrawShape
public void sendForward()
sendForward
in interface DrawableInterface
sendForward
in class objectdraw.ObjectDrawShape
public void sendToBack()
sendToBack
in interface DrawableInterface
sendToBack
in class objectdraw.ObjectDrawShape
public void sendToFront()
sendToFront
in interface DrawableInterface
sendToFront
in class objectdraw.ObjectDrawShape
public void setAlignment(double horizontalAlign, double verticalAlign)
Text.TOP
, Text.BOTTOM
, and so on.
horizontalAlign
- horizontal alignment value, ranging from -1 (align the left
of the text with the basis) to 1 (align the right) of the text with the basis.verticalAlign
- vertical alignment value, ranging from -1 (align the top
of the text with the basis) to 1 (align the bottom) of the text with the basis.public void setBold()
public void setBold(boolean b)
b
.
b
- whether to become bold (true
) or not bold (false
)public void setColor(Color c)
setColor
in interface DrawableInterface
setColor
in class objectdraw.ObjectDrawShape
c
- new Color
for this objectpublic void setFont(Font f)
Font
of this Text
. The Font
object
contains information on the font used, and also the size and style of the text.
f
- new Font
to usepublic void setFont(String fname)
Text
. The new font name should
be a common font, like "Times" or "Courier"; not all computers have all fonts. If that
font does not exist on this computer, another font will be substituted for it.
fname
- name of new font to usepublic void setFontSize(int size)
size
- new font sizepublic void setItalic()
public void setItalic(boolean i)
i
.
i
- whether to become bold (true
) or not bold (false
)public void setPlain()
public void setText(String t)
Text
.
t
- new text to displaypublic void show()
show
in interface DrawableInterface
show
in class objectdraw.ObjectDrawShape
public String toString()
toString
in class objectdraw.ObjectDrawObject