org.tigris.gef.demo
Class NodeCPU

java.lang.Object
  extended by org.tigris.gef.graph.presentation.NetPrimitive
      extended by org.tigris.gef.graph.presentation.NetNode
          extended by org.tigris.gef.demo.NodeCPU
All Implemented Interfaces:
java.io.Serializable, GraphNodeHooks

public class NodeCPU
extends NetNode
implements java.io.Serializable

An example subclass of NetNode for use in the Example application. This class represents a computer that can be plugged into electrical power and attached to a printer. The Computer has attributes that can be set via the property sheet.

See Also:
Serialized Form

Field Summary
protected  int _busSpeedMHz
           
protected  int _cpuSpeedMHz
           
protected  boolean _hasCDROM
           
protected  int _megsOfRAM
           
protected  java.lang.String _ownerInfo
           
static java.lang.String pBUS_SPEED_MHZ
           
static java.lang.String pCPU_SPEED_MHZ
           
static java.lang.String pHAS_CD_ROM
           
static java.lang.String pMEGS_OF_RAM
           
static java.lang.String pOWNER_INFO
           
 
Fields inherited from class org.tigris.gef.graph.presentation.NetPrimitive
_changeSup, _highlight
 
Constructor Summary
NodeCPU()
           
 
Method Summary
 int getBusSpeedMHz()
           
 int getCPUSpeedMhz()
           
 boolean getHasCDROM()
           
 java.lang.String getId()
           
 int getMegsOfRAM()
           
 java.lang.String getOwnerInfo()
           
 void initialize(java.util.Hashtable args)
          Initialize a new NodeCPU.
 FigNode makePresentation(Layer lay)
          Construct and return a new FigNode to present this NetNode in the given Layer.
 void setBusSpeedMHz(int b)
           
 void setCPUSpeedMhz(int c)
           
 void setHasCDROM(boolean r)
           
 void setMegsOfRAM(int m)
           
 void setOwnerInfo(java.lang.String oi)
           
 
Methods inherited from class org.tigris.gef.graph.presentation.NetNode
addPort, canConnectTo, deleteFromModel, getAttributes, getPort, getPorts, postConnect, postDisconnect, postPlacement, presentationFor, setPorts
 
Methods inherited from class org.tigris.gef.graph.presentation.NetPrimitive
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getHighlight, removePropertyChangeListener, setHighlight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.tigris.gef.graph.GraphNodeHooks
addPropertyChangeListener, removePropertyChangeListener, setHighlight
 

Field Detail

pMEGS_OF_RAM

public static final java.lang.String pMEGS_OF_RAM
See Also:
Constant Field Values

pBUS_SPEED_MHZ

public static final java.lang.String pBUS_SPEED_MHZ
See Also:
Constant Field Values

pCPU_SPEED_MHZ

public static final java.lang.String pCPU_SPEED_MHZ
See Also:
Constant Field Values

pHAS_CD_ROM

public static final java.lang.String pHAS_CD_ROM
See Also:
Constant Field Values

pOWNER_INFO

public static final java.lang.String pOWNER_INFO
See Also:
Constant Field Values

_megsOfRAM

protected int _megsOfRAM

_busSpeedMHz

protected int _busSpeedMHz

_cpuSpeedMHz

protected int _cpuSpeedMHz

_hasCDROM

protected boolean _hasCDROM

_ownerInfo

protected java.lang.String _ownerInfo
Constructor Detail

NodeCPU

public NodeCPU()
Method Detail

initialize

public void initialize(java.util.Hashtable args)
Initialize a new NodeCPU.

Needs-More-Work: for now we construct the FigNode programatically in this class. A more powerful way to do it is to make your own sublcass of FigNode.

Specified by:
initialize in interface GraphNodeHooks
Specified by:
initialize in class NetNode

getId

public java.lang.String getId()
Specified by:
getId in class NetPrimitive

getMegsOfRAM

public int getMegsOfRAM()

getBusSpeedMHz

public int getBusSpeedMHz()

getCPUSpeedMhz

public int getCPUSpeedMhz()

getHasCDROM

public boolean getHasCDROM()

getOwnerInfo

public java.lang.String getOwnerInfo()

setMegsOfRAM

public void setMegsOfRAM(int m)

setBusSpeedMHz

public void setBusSpeedMHz(int b)

setCPUSpeedMhz

public void setCPUSpeedMhz(int c)

setHasCDROM

public void setHasCDROM(boolean r)

setOwnerInfo

public void setOwnerInfo(java.lang.String oi)

makePresentation

public FigNode makePresentation(Layer lay)
Description copied from class: NetNode
Construct and return a new FigNode to present this NetNode in the given Layer. A default implementation is supplied as an example, but all subclasses should override this method. NetPorts of this NetNode should be associated with individual Figs that make up the FigNode.

Specified by:
makePresentation in class NetNode