org.tigris.gef.demo
Class PortPower
java.lang.Object
org.tigris.gef.graph.presentation.NetPrimitive
org.tigris.gef.graph.presentation.NetPort
org.tigris.gef.demo.PortPower
- All Implemented Interfaces:
- GraphPortHooks, java.io.Serializable
- public class PortPower
- extends NetPort
- implements java.io.Serializable
An example subclass of NetPort for the EquipmentApplet demo. As
part of the example I constrain the ports to only connect to
PortPowers.
- See Also:
EquipmentApplet
,
Serialized Form
Method Summary |
boolean |
canConnectTo(GraphModel gm,
java.lang.Object otherPort)
Add the constraint that PortPowers can only be connected to
other ports of the same type. |
protected java.lang.Class |
defaultEdgeClass(NetPort otherPort)
reply the java Class to be used to make new arcs. |
int |
type()
|
void |
type(int t)
|
Methods inherited from class org.tigris.gef.graph.presentation.NetPort |
addEdge, dispose, getEdges, getId, getParent, getParentEdge, getParentNode, makeEdgeFor, postConnect, postDisconnect, removeEdge |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SOCKET
public static final int SOCKET
- See Also:
- Constant Field Values
RECEPTICAL
public static final int RECEPTICAL
- See Also:
- Constant Field Values
_type
protected int _type
PortPower
public PortPower(NetNode parent,
int type)
type
public int type()
type
public void type(int t)
defaultEdgeClass
protected java.lang.Class defaultEdgeClass(NetPort otherPort)
- Description copied from class:
NetPort
- reply the java Class to be used to make new arcs. This is a
utility function called from NetPort#makeEdgeFor
- Overrides:
defaultEdgeClass
in class NetPort
canConnectTo
public boolean canConnectTo(GraphModel gm,
java.lang.Object otherPort)
- Add the constraint that PortPowers can only be connected to
other ports of the same type. And SOCKETs can only be connected
to RECEPTICALs.
- Specified by:
canConnectTo
in interface GraphPortHooks
- Overrides:
canConnectTo
in class NetPort