org.tigris.gef.demo
Class EdgePower

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.EdgePower
All Implemented Interfaces:
java.io.Serializable, GraphEdgeHooks

public class EdgePower
extends NetEdge
implements java.io.Serializable

A sample NetEdge subclass for use in the example application. This represents a power cord that can go from the computer to the wall, or from the printer to the wall.

See Also:
Serialized Form

Field Summary
protected  boolean _hasGroundProng
          Some power cords have a third grounding prong, some don't.
protected  int _maxVoltage
          Maximum Voltage that this line can handle.
protected  int _voltage
          Voltage currently on line.
 
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
EdgePower()
           
 
Method Summary
 boolean getHasGroundProng()
           
 java.lang.String getId()
           
 int getMaxVoltage()
           
 int getVoltage()
           
 FigEdge makePresentation(Layer lay)
          Abstract method that returns a FigEdge to represent this edge in a given Layer.
 void setHasGroundProng(boolean hgp)
           
 void setMaxVoltage(int v)
           
 void setVoltage(int v)
           
 
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

_voltage

protected int _voltage
Voltage currently on line.


_maxVoltage

protected int _maxVoltage
Maximum Voltage that this line can handle.


_hasGroundProng

protected boolean _hasGroundProng
Some power cords have a third grounding prong, some don't.

Constructor Detail

EdgePower

public EdgePower()
Method Detail

getId

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

setVoltage

public void setVoltage(int v)

getVoltage

public int getVoltage()

setMaxVoltage

public void setMaxVoltage(int v)

getMaxVoltage

public int getMaxVoltage()

setHasGroundProng

public void setHasGroundProng(boolean hgp)

getHasGroundProng

public boolean getHasGroundProng()

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