main
Class DrawableLabel

java.lang.Object
  extended by main.DrawableMapComponent
      extended by 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 main.DrawableMapComponent
getColor, getSize, setColor, setSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

point

private java.awt.Point point

id

private java.lang.Integer id

text

private java.lang.String text
Constructor Detail

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 id
point - a Point representing the pixel coordinates of the object
color - a Color representing the color of the object
size - an int representing the size of the object
text - the text of the object, it will be drawn on the map
Method Detail

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