Class EdgePower

  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:, GraphEdgeHooks

public class EdgePower
extends NetEdge

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
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


protected int _voltage
Voltage currently on line.


protected int _maxVoltage
Maximum Voltage that this line can handle.


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

Constructor Detail


public EdgePower()
Method Detail


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


public void setVoltage(int v)


public int getVoltage()


public void setMaxVoltage(int v)


public int getMaxVoltage()


public void setHasGroundProng(boolean hgp)


public boolean getHasGroundProng()


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