webmngr.web
Class NetMap

java.lang.Object
  |
  +--webmngr.web.DefaultMapElement
        |
        +--webmngr.web.MapImage
              |
              +--webmngr.web.NetMap
All Implemented Interfaces:
java.awt.image.ImageObserver, MapElement, NavigationMap

public class NetMap
extends MapImage
implements NavigationMap, java.awt.image.ImageObserver

A NetMap is at the same time a Map with elements to be drawn and also a DefaultMapElement, that is, a sub-map, that has a representation to be displayed on the screen.

Since:
01/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.MapImage
DOWN, image, label, LEFT, margin, OTHER, RIGHT, UP
 
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
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
NetMap()
          Default Constructor
 
Method Summary
 void addMapElement(MapElement newElement)
          Add a new MapElement to the list of elements that are part of this DefaultMapElement
 java.awt.Image draw()
          Draws all the elements of this Map
 void draw(java.awt.Image img)
          Draws this netMap representation in another map
 java.util.Vector getAllElements()
           
 java.util.Iterator getAllMapElements()
           
 java.awt.Color getBackgroundColor()
          Sets the color of this Map background
 java.awt.Image getBackgroundImage()
          Returns the background Image of this NetMap
 java.awt.Dimension getBackgroundSize()
          Gets the size of this NetMap background image
 int getHeight()
          Gets this NetMap Height
 int getPropagationLevel()
          Returns the propagation Level of this NetMap.
 int getStatus()
          Gets the status of this NetMap, comparing the criticalities of its sub-elements with problems, discovering what is the worst case and then seeing if this criticality is greater than the propagation level of this NetMap
 int getWidth()
          Gets this NetMap Width
 boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)
          Provides an image Update on this Map
 void setBackgroundColor(java.lang.String c)
          Sets the color of this Map background
 void setBackgroundSize(java.awt.Dimension size)
          Sets the size of this Map background image
 void setHeight(int height)
          Sets this NetMap Height
 void setPropagationLevel(int newValue)
          Sets a new propagation Level for this NetMap.
 void setStatusImage(StatusImage si)
          Sets this NetMap StatusImage
 void setWidth(int width)
          Sets this NetMap Width
 
Methods inherited from class webmngr.web.MapImage
getDimension, getImage, setDefMapImage, setImageFile, setLabel
 
Methods inherited from class webmngr.web.DefaultMapElement
addLabel, addManagedElement, addMapImage, addMapLine, addSubMap, getCriticality, getDrawPlane, getID, getImageObserver, getLink, getMapElements, getParent, getPixelPosition, getPosition, 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
 
Methods inherited from interface webmngr.web.NavigationMap
getMapElements
 

Constructor Detail

NetMap

public NetMap()
Default Constructor
Method Detail

addMapElement

public void addMapElement(MapElement newElement)
Add a new MapElement to the list of elements that are part of this DefaultMapElement
Overrides:
addMapElement in class DefaultMapElement
Parameters:
newElement - the new MapElement to be added

getPropagationLevel

public int getPropagationLevel()
Returns the propagation Level of this NetMap. The propagation level tells what is the maximum value of criticality of an element with problems that must not be passed to a superior map.
Returns:
the propagation level of thi NetMap.

setPropagationLevel

public void setPropagationLevel(int newValue)
Sets a new propagation Level for this NetMap. The propagation level tells what is the maximum value of criticality of an element with problems that must not be passed to a superior map.
Parameters:
newValue - the new value for the propagationLevel.

getBackgroundImage

public java.awt.Image getBackgroundImage()
Returns the background Image of this NetMap
Returns:
the background Image

getBackgroundSize

public java.awt.Dimension getBackgroundSize()
Gets the size of this NetMap background image
Returns:
the dimensions of this NetMap image

setWidth

public void setWidth(int width)
Sets this NetMap Width
Parameters:
width - Width value

getWidth

public int getWidth()
Gets this NetMap Width
Returns:
this NetMap width value

setHeight

public void setHeight(int height)
Sets this NetMap Height
Parameters:
width - height value

getHeight

public int getHeight()
Gets this NetMap Height
Returns:
this NetMap height value

setStatusImage

public void setStatusImage(StatusImage si)
Sets this NetMap StatusImage
Parameters:
si - this NetMap StatusImage

setBackgroundSize

public void setBackgroundSize(java.awt.Dimension size)
Sets the size of this Map background image
Parameters:
newSize - the new size of the background

setBackgroundColor

public void setBackgroundColor(java.lang.String c)
Sets the color of this Map background
Parameters:
c - new color

getBackgroundColor

public java.awt.Color getBackgroundColor()
Sets the color of this Map background
Parameters:
c - new color

draw

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

draw

public java.awt.Image draw()
Draws all the elements of this Map
Specified by:
draw in interface NavigationMap
Returns:
the map image with all of its components

getStatus

public int getStatus()
Gets the status of this NetMap, comparing the criticalities of its sub-elements with problems, discovering what is the worst case and then seeing if this criticality is greater than the propagation level of this NetMap
Specified by:
getStatus in interface NavigationMap
Overrides:
getStatus in class DefaultMapElement
Returns:
status of this NetMap

getAllElements

public java.util.Vector getAllElements()
Overrides:
getAllElements in class DefaultMapElement

getAllMapElements

public java.util.Iterator getAllMapElements()
Specified by:
getAllMapElements in interface NavigationMap

imageUpdate

public boolean imageUpdate(java.awt.Image img,
                           int infoflags,
                           int x,
                           int y,
                           int width,
                           int height)
Provides an image Update on this Map
Specified by:
imageUpdate in interface java.awt.image.ImageObserver
See Also:
ImageObserver