All Packages Class Hierarchy This Package Previous Next Index
Class att.grappa.TextLabel
java.lang.Object
|
+----att.grappa.TextLabel
- public class TextLabel
- extends Object
Essentially a structure for storing labelling info.
- Version:
- 1.1, 30 Sep 1999; Copyright 1996 - 1999 by AT&T Corp.
- Author:
- John Mocenigo, Research @ AT&T Labs
-
constantFontwidth
- Rough font sizing information for the courier (or constant) font.
-
helveticaFontwidth
- Rough font sizing information for the helvetica (or sansserif) font.
-
JUSTIFY_BOTTOM
- Indicates that text should be bottom justified.
-
JUSTIFY_CENTER
- Indicates that text should be center justified.
-
JUSTIFY_LEFT
- Indicates that text should be left justified.
-
JUSTIFY_MIDDLE
- Indicates that text should be middle justified.
-
JUSTIFY_RIGHT
- Indicates that text should be right justified.
-
JUSTIFY_TOP
- Indicates that text should be top justified.
-
NBSP
- The Unicode no-break space character.
-
romanFontwidth
- Rough font sizing information for the roman (or serif) font.
-
TextLabel(DrawObject, String, GraphicContext, Point)
- Create a new
TextLabel
instance associated with a DrawObject
.
-
equals(Object)
- Determines whether two text labels are equal.
-
getBounds()
- Get the bounding box of this text label.
-
getDrawObject()
- Get the draw object associated with this object.
-
getGraphicContext()
- Get the graphic context supplied when this object was created.
-
getPosition()
- Get the position of the text label.
-
getSetupGC()
- Get the graphic context used for setting up this object.
-
getSize()
- Get the size of the text label.
-
getText()
- Get the label text.
-
hasText()
- Check if this object has text associated with it.
-
lineCount()
- Return a count of the lines of text.
-
lines()
- Return an enumeration of the lines of text.
-
resetSetupFlag()
- Set the value of the setup indicator to false.
-
sameText(String)
- Checks if the supplied text
is the same as the text in this label.
-
sameText(TextLabel)
- Checks if the supplied TextLabel
contains the same text and this one.
-
setSetupFlag()
- Set the value of the setup indicator to true.
-
setText(String)
- Change the text of the label.
-
setupNeeded()
- Check if it appears that this object needs to be set-up
NBSP
public static final char NBSP
- The Unicode no-break space character.
JUSTIFY_LEFT
public static final int JUSTIFY_LEFT
- Indicates that text should be left justified.
JUSTIFY_CENTER
public static final int JUSTIFY_CENTER
- Indicates that text should be center justified.
JUSTIFY_RIGHT
public static final int JUSTIFY_RIGHT
- Indicates that text should be right justified.
JUSTIFY_TOP
public static final int JUSTIFY_TOP
- Indicates that text should be top justified.
JUSTIFY_MIDDLE
public static final int JUSTIFY_MIDDLE
- Indicates that text should be middle justified.
JUSTIFY_BOTTOM
public static final int JUSTIFY_BOTTOM
- Indicates that text should be bottom justified.
romanFontwidth
public static final double romanFontwidth[]
- Rough font sizing information for the roman (or serif) font.
helveticaFontwidth
public static final double helveticaFontwidth[]
- Rough font sizing information for the helvetica (or sansserif) font.
constantFontwidth
public static final double constantFontwidth
- Rough font sizing information for the courier (or constant) font.
TextLabel
public TextLabel(DrawObject drwObj,
String str,
GraphicContext context,
Point pos)
- Create a new
TextLabel
instance associated with a DrawObject
.
- Parameters:
- drwObj - the
DrawObject
associated with this TextLabel
- str - the text of the label
- context - the graohic context to use with the label
- pos - the label position (in graph co-ordinates)
getSize
public Dimension getSize()
- Get the size of the text label.
- Returns:
- the size
getPosition
public Point getPosition()
- Get the position of the text label.
- Returns:
- the position
setText
public void setText(String str)
- Change the text of the label.
- Parameters:
- str - the new label text
getText
public String getText()
- Get the label text.
- Returns:
- the label text.
hasText
public boolean hasText()
- Check if this object has text associated with it.
- Returns:
- true is there is associated text of length greater than zero; false otherwise.
getGraphicContext
public GraphicContext getGraphicContext()
- Get the graphic context supplied when this object was created.
- Returns:
- the creation graphic context.
getSetupGC
public GraphicContext getSetupGC()
- Get the graphic context used for setting up this object.
- Returns:
- the setup graphic context.
lines
public Enumeration lines()
- Return an enumeration of the lines of text.
- Returns:
- an enumeration of
TextLine
objects.
lineCount
public int lineCount()
- Return a count of the lines of text.
- Returns:
- a count of lines of text in the label.
getBounds
public Rectangle getBounds()
- Get the bounding box of this text label.
- Returns:
- the bounding box.
sameText
public boolean sameText(TextLabel tl)
- Checks if the supplied TextLabel
contains the same text and this one.
- Returns:
- true if text labels in each
TextLabel
are equal; false otherwise.
sameText
public boolean sameText(String txt)
- Checks if the supplied text
is the same as the text in this label.
- Returns:
- true if text equals the text in this label; false otherwise.
equals
public boolean equals(Object obj)
- Determines whether two text labels are equal. Two instances of
TextLabel
are equal if their text, position and
graphic context are equal.
- Parameters:
- obj - an object to be compared with this point.
- Returns:
-
true
if the object to be compared is
an instance of TextLabel
and has
the same values; false
otherwise.
- Overrides:
- equals in class Object
- See Also:
- sameText, getPosition, getGraphicContext
getDrawObject
public DrawObject getDrawObject()
- Get the draw object associated with this object.
- Returns:
- the associated
DrawObject
.
setupNeeded
public boolean setupNeeded()
- Check if it appears that this object needs to be set-up
- Returns:
- true if setup is required, false otherwise
setSetupFlag
public void setSetupFlag()
- Set the value of the setup indicator to true.
- See Also:
- setupNeeded
resetSetupFlag
public void resetSetupFlag()
- Set the value of the setup indicator to false.
- See Also:
- setupNeeded
All Packages Class Hierarchy This Package Previous Next Index