webmngr.web
Class MapLine

java.lang.Object
  |
  +--webmngr.web.DefaultMapElement
        |
        +--webmngr.web.MapLine
All Implemented Interfaces:
MapElement

public class MapLine
extends DefaultMapElement

A MapLine is any kind of line linking two positions in a map. It can be a link or not.

Since:
02/07/2000
Author:
Ayla Débora Dantas de Souza (ayla@dsc.ufpb.br),
Rodrigo Rebouças de Almeida (rodrigor@dsc.ufpb.br)

Fields inherited from class webmngr.web.DefaultMapElement
BACKGROUND, BOTTOM, CRITIC_HIGH, CRITIC_LITTLE, CRITIC_MAXIMUM, CRITIC_MEDIUM, CRITIC_MINIMAL, CRITIC_NONE, criticality, DEFAULT_ID, dimension, drawPlane, id, idCount, imgObserver, link, mapElements, MIDDLE, parent, position, status, STATUS_DOWN, STATUS_INDEFINITE, STATUS_UP, tmpObs, TOP, visited
 
Constructor Summary
MapLine()
          Default Constructor
 
Method Summary
 void draw(java.awt.Image img)
          Draws this MapLine
 java.awt.Color getColor()
          Gets the color of the line to be drawn, the default color is black
 java.awt.Dimension getDimension()
          Gets this line dimension
This dimension is calculated according to the littlest rectangle that contains this line target and source
 java.awt.Point getPixelPosition()
          Gets this line PixelPosition, with its lowest x and y coordinates
 MapPoint getSource()
          Gets one of the endings of this MapLine
 float getStrokeWidth()
          Gets the line width
 MapPoint getTarget()
          Gets one of the endings of this MapLine
 void setColor(java.lang.String c)
          Sets the color of the line to be drawn
 void setSourceID(java.lang.String sourceID)
           
 void setStrokeWidth(float width)
          Sets the line width
 void setTargetID(java.lang.String targetID)
           
 
Methods inherited from class webmngr.web.DefaultMapElement
addLabel, addManagedElement, addMapElement, addMapImage, addMapLine, addSubMap, getAllElements, getCriticality, getDrawPlane, getID, getImageObserver, getLink, getMapElements, getParent, getPosition, getStatus, setCriticality, setDefault, setDrawPlane, setID, setImageObserver, setLink, setParent, setPosition, setStatus, setVisited, setX, setY, visited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapLine

public MapLine()
Default Constructor
Method Detail

getTarget

public MapPoint getTarget()
Gets one of the endings of this MapLine
Returns:
a point representing one of the endings of this line

getSource

public MapPoint getSource()
Gets one of the endings of this MapLine
Returns:
a point representing one of the endings of this line

setTargetID

public void setTargetID(java.lang.String targetID)

setSourceID

public void setSourceID(java.lang.String sourceID)

getColor

public java.awt.Color getColor()
Gets the color of the line to be drawn, the default color is black
Returns:
this MapLine color

setColor

public void setColor(java.lang.String c)
Sets the color of the line to be drawn
Parameters:
c - the new color

getStrokeWidth

public float getStrokeWidth()
Gets the line width
Returns:
the line width

setStrokeWidth

public void setStrokeWidth(float width)
Sets the line width
Parameters:
width - the new line width

getPixelPosition

public java.awt.Point getPixelPosition()
Gets this line PixelPosition, with its lowest x and y coordinates
Overrides:
getPixelPosition in class DefaultMapElement
Returns:
Point representing this line PixelPosition

getDimension

public java.awt.Dimension getDimension()
Gets this line dimension
This dimension is calculated according to the littlest rectangle that contains this line target and source
Overrides:
getDimension in class DefaultMapElement
Following copied from class: webmngr.web.DefaultMapElement
Returns:
the dimension of this element's image

draw

public void draw(java.awt.Image img)
Draws this MapLine
Overrides:
draw in class DefaultMapElement
Parameters:
img - Source image where this NetMap must be drawn
comp - A component, e.g, a frame, from where the image was obtained