warthman.network
Class Node

java.lang.Object
  |
  +--java.awt.Component
        |
        +--warthman.network.Node

public class Node
extends java.awt.Component
implements ActorNodeListener, java.awt.event.MouseListener

Class Node

See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
Node()
           
Node(int x, int y)
           
Node(java.awt.Point p)
           
 
Method Summary
 void actorArrive(ActorNodeEvent e)
           
 void actorDepart(ActorNodeEvent e)
           
 void addActorNodeListener(ActorNodeListener l)
           
 void addArrivalAction(ActorNodeEvent a)
          Adds the specified action as an action to be performed when this actor arrives at a node.
 void addDepartureAction(ActorNodeEvent a)
          Adds the specified action as an action to be performed when this actor departs from a node.
 void connectPath(Path p)
          Connects a Path object to this node.
 boolean disconnectPath(Path p)
          Disconnects a specified Path object from this node.
protected  void fireActorArrive(ActorNodeEvent e)
           
protected  void fireActorDepart(ActorNodeEvent e)
           
 java.util.Vector getActors()
           
 java.util.Vector getPaths()
           
 int getX()
           
 int getY()
           
 void removeActorNodeListener(ActorNodeListener l)
           
 void removeArrivalAction(ActorNodeEvent a)
          Removes the specified action as an action to be performed when this actor arrives at a node.
 void removeDepartureAction(ActorNodeEvent a)
          Removes the specified action as an action to be performed when this actor departs from a node.
 void setActors(java.util.Vector newActors)
           
 void setPaths(java.util.Vector newPaths)
           
 void setX(int newX)
           
 void setY(int newY)
           
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Node

public Node()

Node

public Node(int x,
            int y)

Node

public Node(java.awt.Point p)
Method Detail

getX

public int getX()
Overrides:
getX in class java.awt.Component

setX

public void setX(int newX)

setY

public void setY(int newY)

getY

public int getY()
Overrides:
getY in class java.awt.Component

setActors

public void setActors(java.util.Vector newActors)

getActors

public java.util.Vector getActors()

connectPath

public void connectPath(Path p)
Connects a Path object to this node.
Parameters:
p - the path that's to be connected to this node.

disconnectPath

public boolean disconnectPath(Path p)
Disconnects a specified Path object from this node.
Parameters:
p - the Path object to be disconnected.
Returns:
true if path p was connected to this node and was removed. false is returned if path p was not connected to this node.

removeActorNodeListener

public void removeActorNodeListener(ActorNodeListener l)

addActorNodeListener

public void addActorNodeListener(ActorNodeListener l)

fireActorArrive

protected void fireActorArrive(ActorNodeEvent e)

fireActorDepart

protected void fireActorDepart(ActorNodeEvent e)

actorArrive

public void actorArrive(ActorNodeEvent e)
Specified by:
actorArrive in interface ActorNodeListener

actorDepart

public void actorDepart(ActorNodeEvent e)
Specified by:
actorDepart in interface ActorNodeListener

setPaths

public void setPaths(java.util.Vector newPaths)

getPaths

public java.util.Vector getPaths()

addArrivalAction

public void addArrivalAction(ActorNodeEvent a)
Adds the specified action as an action to be performed when this actor arrives at a node.
Parameters:
a - the action to be performed.

addDepartureAction

public void addDepartureAction(ActorNodeEvent a)
Adds the specified action as an action to be performed when this actor departs from a node.
Parameters:
a - the action to be performed.

removeArrivalAction

public void removeArrivalAction(ActorNodeEvent a)
Removes the specified action as an action to be performed when this actor arrives at a node.
Parameters:
a - the action to be performed.

removeDepartureAction

public void removeDepartureAction(ActorNodeEvent a)
Removes the specified action as an action to be performed when this actor departs from a node.
Parameters:
a - the action to be performed.