org.tigris.gef.demo
Class EdgeData

java.lang.Object
  extended by org.tigris.gef.graph.presentation.NetPrimitive
      extended by org.tigris.gef.graph.presentation.NetEdge
          extended by org.tigris.gef.demo.EdgeData
All Implemented Interfaces:
java.io.Serializable, GraphEdgeHooks

public class EdgeData
extends NetEdge
implements java.io.Serializable

A sample NetEdge subclass for use in the Example application. There are no real details here yet. If I was to expand this example more the Edge could have more attributes, e.g. bandwidth... and it could have its own subclasses of FigEdge to make it look a certain way.

See Also:
Serialized Form

Field Summary
protected  int _bitsPerSecond
          Speed of this data line
protected  java.lang.String _cableType
          Type of cable, choosen from the constants above: SCSI, FireWire, etc.
static java.util.Vector _PossibleCableTypes
           
static java.lang.String CABLE_ETHERNET
           
static java.lang.String CABLE_FDDI
           
static java.lang.String CABLE_FIREWIRE
           
static java.lang.String CABLE_SCSI
           
static java.lang.String pBITS_PER_SECOND
           
static java.lang.String pCABLE_TYPE
           
 
Fields inherited from class org.tigris.gef.graph.presentation.NetEdge
_destPort, _ports, _sourcePort
 
Fields inherited from class org.tigris.gef.graph.presentation.NetPrimitive
_changeSup, _highlight
 
Constructor Summary
EdgeData()
           
 
Method Summary
 int getBitsPerSecond()
           
 java.lang.String getCableType()
           
 java.lang.String getId()
           
 FigEdge makePresentation(Layer lay)
          Abstract method that returns a FigEdge to represent this edge in a given Layer.
 void setBitsPerSecond(int bps)
           
 void setCableType(java.lang.String ct)
           
 
Methods inherited from class org.tigris.gef.graph.presentation.NetEdge
connect, deleteFromModel, getDestPort, getPorts, getSourcePort, otherEnd, presentationFor, setDestPort, setPorts, setSourcePort
 
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.GraphEdgeHooks
addPropertyChangeListener, removePropertyChangeListener, setHighlight
 

Field Detail

pCABLE_TYPE

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

pBITS_PER_SECOND

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

CABLE_SCSI

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

CABLE_ETHERNET

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

CABLE_FIREWIRE

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

CABLE_FDDI

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

_bitsPerSecond

protected int _bitsPerSecond
Speed of this data line


_cableType

protected java.lang.String _cableType
Type of cable, choosen from the constants above: SCSI, FireWire, etc.


_PossibleCableTypes

public static java.util.Vector _PossibleCableTypes
Constructor Detail

EdgeData

public EdgeData()
Method Detail

getId

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

getCableType

public java.lang.String getCableType()

setCableType

public void setCableType(java.lang.String ct)

getBitsPerSecond

public int getBitsPerSecond()

setBitsPerSecond

public void setBitsPerSecond(int bps)

makePresentation

public FigEdge makePresentation(Layer lay)
Description copied from class: NetEdge
Abstract method that returns a FigEdge to represent this edge in a given Layer. This is just a quick and simple way to do it if you use a DefaultGraphModel because DefaultgraphEdgeRenderer calls this. Override this method if you want your Edge subclasses to have a different look. The better way to do it is to implement your own GraphEdgeRenderer.

Specified by:
makePresentation in class NetEdge