CH.ifa.draw.standard
Class AbstractConnector
- java.lang.Object
-
- CH.ifa.draw.standard.AbstractConnector
-
- Direct Known Subclasses:
- ChopBoxConnector, LocatorConnector, ShortestDistanceConnector
public abstract class AbstractConnector extends java.lang.Object implements Connector
AbstractConnector provides default implementation for the Connector interface.- See Also:
Connector, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description AbstractConnector()Constructs a connector that has no owner.AbstractConnector(Figure owner)Constructs a connector with the given owner figure.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancontainsPoint(int x, int y)Tests if a point is contained in the connector.java.awt.RectangledisplayBox()Gets the display box of the connector.voiddraw(java.awt.Graphics g)Draws this connector.java.awt.PointfindEnd(ConnectionFigure connection)Finds the end point for the connection.java.awt.PointfindStart(ConnectionFigure connection)Finds the start point for the connection.Figureowner()Gets the connector's owner.voidread(StorableInput dr)Reads the connector and its owner from a StorableInput.voidwrite(StorableOutput dw)Stores the connector and its owner to a StorableOutput.
-
-
-
Constructor Detail
-
AbstractConnector
public AbstractConnector()
Constructs a connector that has no owner. It is only used internally to resurrect a connectors from a StorableOutput. It should never be called directly.
-
AbstractConnector
public AbstractConnector(Figure owner)
Constructs a connector with the given owner figure.
-
-
Method Detail
-
findStart
public java.awt.Point findStart(ConnectionFigure connection)
Description copied from interface:ConnectorFinds the start point for the connection.
-
findEnd
public java.awt.Point findEnd(ConnectionFigure connection)
Description copied from interface:ConnectorFinds the end point for the connection.
-
displayBox
public java.awt.Rectangle displayBox()
Gets the display box of the connector.- Specified by:
displayBoxin interfaceConnector
-
containsPoint
public boolean containsPoint(int x, int y)Tests if a point is contained in the connector.- Specified by:
containsPointin interfaceConnector
-
draw
public void draw(java.awt.Graphics g)
Draws this connector. By default connectors are invisible.
-
write
public void write(StorableOutput dw)
Stores the connector and its owner to a StorableOutput.
-
read
public void read(StorableInput dr) throws java.io.IOException
Reads the connector and its owner from a StorableInput.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG