org.jhotdraw.draw.connector
Class StickyRectangleConnector
- java.lang.Object
-
- org.jhotdraw.draw.connector.AbstractConnector
-
- org.jhotdraw.draw.connector.ChopRectangleConnector
-
- org.jhotdraw.draw.connector.StickyRectangleConnector
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Connector, DOMStorable
public class StickyRectangleConnector extends ChopRectangleConnector
A StickyRectangleConnector locates connection points by choping the connection between the centers of the two figures at the display box.The location of the connection point is computed once, when the user connects the figure. Moving the figure around will not change the location.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description StickyRectangleConnector()Creates a new instance.StickyRectangleConnector(Figure owner)StickyRectangleConnector(Figure owner, java.awt.geom.Point2D.Double p)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddraw(java.awt.Graphics2D g)Draws the connector.java.awt.geom.Point2D.DoublegetAnchor()Gets the anchor of the connector.doublegetAngle()java.lang.StringgetParameters()voidread(DOMInput in)voidsetAngle(float angle)voidupdateAnchor(java.awt.geom.Point2D.Double p)Updates the anchor of the connector.voidwrite(DOMOutput out)-
Methods inherited from class org.jhotdraw.draw.connector.ChopRectangleConnector
findEnd, findStart
-
Methods inherited from class org.jhotdraw.draw.connector.AbstractConnector
clone, contains, getBounds, getDrawingArea, getOwner, isConnectToDecorator, setConnectToDecorator, updateEndLocation, updateStartLocation
-
-
-
-
Constructor Detail
-
StickyRectangleConnector
public StickyRectangleConnector()
Creates a new instance. Only used for storable.
-
StickyRectangleConnector
public StickyRectangleConnector(Figure owner)
-
StickyRectangleConnector
public StickyRectangleConnector(Figure owner, java.awt.geom.Point2D.Double p)
-
-
Method Detail
-
draw
public void draw(java.awt.Graphics2D g)
Description copied from interface:ConnectorDraws the connector.- Specified by:
drawin interfaceConnector- Overrides:
drawin classAbstractConnector
-
setAngle
public void setAngle(float angle)
-
getAngle
public double getAngle()
-
updateAnchor
public void updateAnchor(java.awt.geom.Point2D.Double p)
Description copied from interface:ConnectorUpdates the anchor of the connector. This method is called when the user manually changes the end point of the ConnectionFigure. The Connector uses this as a hint for choosing a new anchor position.- Specified by:
updateAnchorin interfaceConnector- Overrides:
updateAnchorin classAbstractConnector
-
getAnchor
public java.awt.geom.Point2D.Double getAnchor()
Description copied from interface:ConnectorGets the anchor of the connector. This is a point at the center or at the bounds of the figure, where the start or the end point will most likely be attached. The purpose of this method is to give the user a hint, where the connector will most likely be attached to the owner of the connector.- Specified by:
getAnchorin interfaceConnector- Overrides:
getAnchorin classAbstractConnector
-
getParameters
public java.lang.String getParameters()
-
read
public void read(DOMInput in) throws java.io.IOException
- Specified by:
readin interfaceDOMStorable- Overrides:
readin classAbstractConnector- Throws:
java.io.IOException
-
write
public void write(DOMOutput out) throws java.io.IOException
- Specified by:
writein interfaceDOMStorable- Overrides:
writein classAbstractConnector- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG