All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class vnet.display.GraphNet

java.lang.Object
   |
   +----java.util.Observable
           |
           +----vnet.display.GraphNet

public class GraphNet
extends Observable
implements Observer
Graphical peer of a NetLayout, managing GraphNodes and GraphLinks This class is Observable: when it considers that must be redrawn, notifys it

Version:
0.2, august-1997
Author:
LuisM Pena
See Also:
GraphGeometry, NetLink

Constructor Index

 o GraphNet(NetLayout, GraphGeometry)
 o GraphNet(NetLayout, GraphGeometry, int)

Method Index

 o draw(Graphics, boolean)
Draws the net, drawing each of the nodes and links
 o setSize(Dimension)
Sets the correct size for the GraphNet.
 o update(Observable, Object)
Observer method.

Constructors

 o GraphNet
 public GraphNet(NetLayout net,
                 GraphGeometry geometry)
Parameters:
net - the netlayout to represent
geometry - the GraphGeometry that gives the right position to the items in the GraphNet
 o GraphNet
 public GraphNet(NetLayout net,
                 GraphGeometry geometry,
                 int periodState)
Parameters:
net - the netlayout to represent
geometry - the GraphGeometry that gives the right position to the items in the GraphNet
periodState - when a NetLink or a NetNode changes its state, the graphLink or the GraphNode will change its color, and the duration of this change is given by this parameter. The duration is given in the number of calls to the draw method

Methods

 o update
 public void update(Observable obs,
                    Object o)
Observer method. It doesn't pay attention to the bindEvents

 o draw
 public void draw(Graphics g,
                  boolean bUpdate)
Draws the net, drawing each of the nodes and links

Parameters:
g - the Graphics where the link will be drawn
bUpdate - is true if the origin of this call has not been a component update method
 o setSize
 public void setSize(Dimension dimension)
Sets the correct size for the GraphNet. The GraphGeometry gives the positions in realite ways, between 0 and 1. These numbers have to be multiplied by the factor given by the setSize method

Parameters:
redimension - the dimension of the area where the net is being drawn

All Packages  Class Hierarchy  This Package  Previous  Next  Index