org.tigris.gef.demo
Class EdgePower
java.lang.Object
org.tigris.gef.graph.presentation.NetPrimitive
org.tigris.gef.graph.presentation.NetEdge
org.tigris.gef.demo.EdgePower
- All Implemented Interfaces:
- GraphEdgeHooks, java.io.Serializable
- 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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_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.
EdgePower
public EdgePower()
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 org.tigris.gef.presentation.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