webmngr.web
Class MapImage
java.lang.Object
|
+--webmngr.web.DefaultMapElement
|
+--webmngr.web.MapImage
- All Implemented Interfaces:
- MapElement
- Direct Known Subclasses:
- NetMap
- public class MapImage
- extends DefaultMapElement
A MapLabel is a String that can be printed on a map.
It can be a link or not.
- Since:
- 03/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 |
MapImage()
Default Constructor |
Method Summary |
void |
draw(java.awt.Image img)
Draws this MapImage and its label |
java.awt.Dimension |
getDimension()
Returns the dimension of this MapElement's image |
java.awt.Image |
getImage()
Gets this MapElement's image |
void |
setDefMapImage(MapImage def)
Sets a DefaultMapImage to this one, copying its propertis |
void |
setImageFile(java.lang.String fileName)
Sets the file of the image that will represent this
mapElement |
void |
setLabel(MapLabel l,
int pos)
Sets this MapImage associated label |
Methods inherited from class webmngr.web.DefaultMapElement |
addLabel, addManagedElement, addMapElement, addMapImage, addMapLine, addSubMap, getAllElements, getCriticality, getDrawPlane, getID, getImageObserver, getLink, getMapElements, getParent, getPixelPosition, 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 |
UP
public static final int UP
RIGHT
public static final int RIGHT
DOWN
public static final int DOWN
LEFT
public static final int LEFT
OTHER
public static final int OTHER
label
protected java.util.Map label
image
protected java.awt.Image image
margin
protected int margin
MapImage
public MapImage()
- Default Constructor
setLabel
public void setLabel(MapLabel l,
int pos)
- Sets this MapImage associated label
- Parameters:
l
- the new label
setImageFile
public void setImageFile(java.lang.String fileName)
- Sets the file of the image that will represent this
mapElement
- Parameters:
fileName
- the file name of a file present on the
images directory (/Webmngr/web/images)
getImage
public java.awt.Image getImage()
- Gets this MapElement's image
- Returns:
- an image that represents this element on the map
draw
public void draw(java.awt.Image img)
- Draws this MapImage and its label
- Overrides:
draw
in class DefaultMapElement
- Parameters:
img
- Source image where this MapImage must be drawncomp
- A component, e.g, a frame, from where the image was obtained
getDimension
public java.awt.Dimension getDimension()
- Returns the dimension of this MapElement's image
- Overrides:
getDimension
in class DefaultMapElement
- Returns:
- the dimension of this element's image
setDefMapImage
public void setDefMapImage(MapImage def)
- Sets a DefaultMapImage to this one, copying its propertis
- Parameters:
def
- Default MapImage