webmngr.web
Class StatusImage

java.lang.Object
  |
  +--webmngr.web.StatusImage

public class StatusImage
extends java.lang.Object

Class that associates status values to images

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

Constructor Summary
StatusImage()
          Default Constructor
StatusImage(MapElement parent, java.awt.image.ImageObserver imgObserver)
          Constructor
 
Method Summary
 void draw(int status, java.awt.Image img)
          Draws this StatusImage on its parent
 java.awt.Dimension getDefDimension()
          Gets this statusImage defautl dimension
 java.awt.Dimension getDimension(int status)
          Gets the dimension of the image used to represent a certain status
 java.awt.Image getImage(int status)
          Gets the image which represents this element on the map according to its status
 java.awt.image.ImageObserver getImageObserver()
          Gets this MapElement ImageObserver
 MapElement getParent()
          Gets this StatusImage parent
 MapPoint getPosition()
          Gets this StatusImage position relative to its parent
 void setDefDimension(java.awt.Dimension def)
          Sets a default dimension to this StatusImage
 void setImageFile(java.lang.String fileName, int status)
          Sets an image that represents one of the status of an element.
 void setImageObserver(java.awt.image.ImageObserver io)
          Sets this MapElement ImageObserver
 void setParent(MapElement parent)
          Sets this StatusImage parent
 void setPosition(MapPoint pos)
          Sets this StatusImage position relative to its parent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatusImage

public StatusImage()
Default Constructor

StatusImage

public StatusImage(MapElement parent,
                   java.awt.image.ImageObserver imgObserver)
Constructor
Parameters:
parent - the element where this StatusImage must be placed
imgObserver - imageObserver to be used to draw this statusImage
Method Detail

setImageFile

public void setImageFile(java.lang.String fileName,
                         int status)
Sets an image that represents one of the status of an element.
Parameters:
img - The image to be associated with this status
status - the status value that will be represented by img

getImage

public java.awt.Image getImage(int status)
Gets the image which represents this element on the map according to its status
Returns:
an image object representing this element

getDimension

public java.awt.Dimension getDimension(int status)
Gets the dimension of the image used to represent a certain status
Parameters:
status - the status associated with an image whose dimension is wanted

setParent

public void setParent(MapElement parent)
Sets this StatusImage parent
Parameters:
parent - MapElement that owns this StatusImage

getParent

public MapElement getParent()
Gets this StatusImage parent
Returns:
MapElement that owns this StatusImage

setImageObserver

public void setImageObserver(java.awt.image.ImageObserver io)
Sets this MapElement ImageObserver
Parameters:
io - ImageObserver used to draw this image

getImageObserver

public java.awt.image.ImageObserver getImageObserver()
Gets this MapElement ImageObserver
Returns:
ImageObserver used to draw this image

setDefDimension

public void setDefDimension(java.awt.Dimension def)
Sets a default dimension to this StatusImage
Parameters:
def - Default Dimension

getDefDimension

public java.awt.Dimension getDefDimension()
Gets this statusImage defautl dimension
Returns:
Default Dimension

setPosition

public void setPosition(MapPoint pos)
Sets this StatusImage position relative to its parent
Parameters:
pos - relative position

getPosition

public MapPoint getPosition()
Gets this StatusImage position relative to its parent
Returns:
MapPoint representing this elements relative Position

draw

public void draw(int status,
                 java.awt.Image img)
Draws this StatusImage on its parent
Parameters:
status - an status value
img - Image associated with "status"