main
Class DrawableLabel
java.lang.Object
main.DrawableMapComponent
main.DrawableLabel
public class DrawableLabel
- extends DrawableMapComponent
- Author:
- Leo Bosnjak
The
DrawableLabel
class represents a text label
which will be drawn on the map.
Field Summary |
private java.lang.Integer |
id
|
private java.awt.Point |
point
|
private java.lang.String |
text
|
Constructor Summary |
DrawableLabel(java.lang.Integer id,
java.awt.Point point,
java.awt.Color color,
int size,
java.lang.String text)
Creates a new DrawableLabel with the arguments. |
Method Summary |
java.lang.Integer |
getID()
Returns the id of the node. |
java.awt.Point |
getPoint()
Returns the pixel-coordinate point of the node. |
java.lang.String |
getText()
Returns the location of the node. |
void |
setText(java.lang.String text)
|
java.lang.String |
toString()
Returns a string representation of this DrawableNode . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
point
private java.awt.Point point
id
private java.lang.Integer id
text
private java.lang.String text
DrawableLabel
public DrawableLabel(java.lang.Integer id,
java.awt.Point point,
java.awt.Color color,
int size,
java.lang.String text)
- Creates a new
DrawableLabel
with the arguments.
- Parameters:
id
- an Integer
representing the object's idpoint
- a Point
representing the pixel coordinates of
the objectcolor
- a Color
representing the color of the objectsize
- an int
representing the size of the objecttext
- the text of the object, it will be drawn on the map
getPoint
public java.awt.Point getPoint()
- Returns the pixel-coordinate point of the node.
- Returns:
- the point
getID
public java.lang.Integer getID()
- Returns the id of the node.
- Returns:
- the node id
getText
public java.lang.String getText()
- Returns the location of the node.
- Returns:
- the node's city
toString
public java.lang.String toString()
- Returns a string representation of this
DrawableNode
.
This is for debugging purposes only.
- Overrides:
toString
in class java.lang.Object
- Returns:
- a string representation of this
DrawableNode
setText
public void setText(java.lang.String text)
- Parameters:
text
- the text to set