CH.ifa.draw.figures
Class LineConnection
- java.lang.Object
-
- CH.ifa.draw.standard.AbstractFigure
-
- CH.ifa.draw.figures.PolyLineFigure
-
- CH.ifa.draw.figures.LineConnection
-
- All Implemented Interfaces:
- ConnectionFigure, Figure, FigureChangeListener, Storable, java.io.Serializable, java.lang.Cloneable, java.util.EventListener
- Direct Known Subclasses:
- ElbowConnection, LayerConnection, PertDependency
public class LineConnection extends PolyLineFigure implements ConnectionFigure
A LineConnection is a standard implementation of the ConnectionFigure interface. The interface is implemented with PolyLineFigure.- See Also:
ConnectionFigure, Serialized Form
-
-
Field Summary
-
Fields inherited from class CH.ifa.draw.figures.PolyLineFigure
ARROW_TIP_BOTH, ARROW_TIP_END, ARROW_TIP_NONE, ARROW_TIP_START
-
Fields inherited from interface CH.ifa.draw.framework.Figure
POPUP_MENU
-
-
Constructor Summary
Constructors Constructor and Description LineConnection()Constructs a LineConnection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancanConnect()Tests whether a figure can be a connection target.booleancanConnect(Figure start, Figure end)Tests whether two figures can be connected.voidconnectEnd(Connector end)Sets the end figure of the connection.booleanconnectsSame(ConnectionFigure other)Tests whether a connection connects the same figures as another ConnectionFigure.voidconnectStart(Connector start)Sets the start figure of the connection.voiddisconnectEnd()Disconnects the end figure.voiddisconnectStart()Disconnects the start figure.Connectorend()Gets the end figure of the connection.FigureendFigure()Gets the end figure of the connection.java.awt.PointendPoint()Gets the end point.voidendPoint(int x, int y)Sets the end point.voidfigureChanged(FigureChangeEvent e)Sent when a figure changedvoidfigureInvalidated(FigureChangeEvent e)Sent when an area is invalidvoidfigureRemoved(FigureChangeEvent e)Sent when a figure was removedvoidfigureRequestRemove(FigureChangeEvent e)Sent when requesting to remove a figure.voidfigureRequestUpdate(FigureChangeEvent e)Sent when an update should happen.java.util.Vectorhandles()Gets the handles of the figure.voidinsertPointAt(java.awt.Point p, int i)Inserts the point and updates the connection.voidlayoutConnection()Lays out the connection.voidread(StorableInput dr)Reads the Figure from a StorableInput.voidrelease()A figure is released from the drawing.voidremovePointAt(int i)Removes the point and updates the connection.voidsetPointAt(java.awt.Point p, int i)Sets the point and updates the connection.Connectorstart()Gets the start figure of the connection.FigurestartFigure()Gets the start figure of the connection.java.awt.PointstartPoint()Gets the start point.voidstartPoint(int x, int y)Sets the start point.voidupdateConnection()Updates the connection.voidwrite(StorableOutput dw)Stores the Figure to a StorableOutput.-
Methods inherited from class CH.ifa.draw.figures.PolyLineFigure
addPoint, basicDisplayBox, connectorAt, containsPoint, displayBox, draw, findSegment, getAttribute, getEndDecoration, getStartDecoration, isEmpty, joinSegments, locator, pointAt, pointCount, points, setAttribute, setEndDecoration, setStartDecoration, splitSegment
-
Methods inherited from class CH.ifa.draw.standard.AbstractFigure
addFigureChangeListener, addToContainer, center, changed, clone, connectedTextLocator, connectionInsets, connectorVisibility, decompose, displayBox, displayBox, figures, findFigureInside, includes, invalidate, listener, moveBy, removeFigureChangeListener, removeFromContainer, size, willChange
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface CH.ifa.draw.framework.ConnectionFigure
joinSegments, pointAt, pointCount, splitSegment
-
Methods inherited from interface CH.ifa.draw.framework.Figure
addFigureChangeListener, addToContainer, basicDisplayBox, center, changed, clone, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, displayBox, draw, figures, findFigureInside, getAttribute, includes, invalidate, isEmpty, listener, moveBy, removeFigureChangeListener, removeFromContainer, setAttribute, size, willChange
-
-
-
-
Constructor Detail
-
LineConnection
public LineConnection()
Constructs a LineConnection. A connection figure has an arrow decoration at the start and end.
-
-
Method Detail
-
canConnect
public boolean canConnect()
Tests whether a figure can be a connection target. ConnectionFigures cannot be connected and return false.- Specified by:
canConnectin interfaceFigure- Overrides:
canConnectin classAbstractFigure
-
connectStart
public void connectStart(Connector start)
Sets the start figure of the connection.- Specified by:
connectStartin interfaceConnectionFigure
-
connectEnd
public void connectEnd(Connector end)
Sets the end figure of the connection.- Specified by:
connectEndin interfaceConnectionFigure
-
disconnectStart
public void disconnectStart()
Disconnects the start figure.- Specified by:
disconnectStartin interfaceConnectionFigure
-
disconnectEnd
public void disconnectEnd()
Disconnects the end figure.- Specified by:
disconnectEndin interfaceConnectionFigure
-
connectsSame
public boolean connectsSame(ConnectionFigure other)
Tests whether a connection connects the same figures as another ConnectionFigure.- Specified by:
connectsSamein interfaceConnectionFigure
-
startFigure
public Figure startFigure()
Gets the start figure of the connection.
-
endFigure
public Figure endFigure()
Gets the end figure of the connection.
-
start
public Connector start()
Gets the start figure of the connection.- Specified by:
startin interfaceConnectionFigure
-
end
public Connector end()
Gets the end figure of the connection.- Specified by:
endin interfaceConnectionFigure
-
canConnect
public boolean canConnect(Figure start, Figure end)
Tests whether two figures can be connected.- Specified by:
canConnectin interfaceConnectionFigure
-
startPoint
public void startPoint(int x, int y)Sets the start point.- Specified by:
startPointin interfaceConnectionFigure
-
endPoint
public void endPoint(int x, int y)Sets the end point.- Specified by:
endPointin interfaceConnectionFigure
-
startPoint
public java.awt.Point startPoint()
Gets the start point.- Specified by:
startPointin interfaceConnectionFigure
-
endPoint
public java.awt.Point endPoint()
Gets the end point.- Specified by:
endPointin interfaceConnectionFigure
-
handles
public java.util.Vector handles()
Gets the handles of the figure. It returns the normal PolyLineHandles but adds ChangeConnectionHandles at the start and end.- Specified by:
handlesin interfaceFigure- Overrides:
handlesin classPolyLineFigure- Returns:
- a Vector of handles
- See Also:
Handle
-
setPointAt
public void setPointAt(java.awt.Point p, int i)Sets the point and updates the connection.- Specified by:
setPointAtin interfaceConnectionFigure- Overrides:
setPointAtin classPolyLineFigure
-
insertPointAt
public void insertPointAt(java.awt.Point p, int i)Inserts the point and updates the connection.- Overrides:
insertPointAtin classPolyLineFigure
-
removePointAt
public void removePointAt(int i)
Removes the point and updates the connection.- Overrides:
removePointAtin classPolyLineFigure
-
updateConnection
public void updateConnection()
Updates the connection.- Specified by:
updateConnectionin interfaceConnectionFigure
-
layoutConnection
public void layoutConnection()
Lays out the connection. This is called when the connection itself changes. By default the connection is recalculated
-
figureChanged
public void figureChanged(FigureChangeEvent e)
Description copied from interface:FigureChangeListenerSent when a figure changed- Specified by:
figureChangedin interfaceFigureChangeListener
-
figureRemoved
public void figureRemoved(FigureChangeEvent e)
Description copied from interface:FigureChangeListenerSent when a figure was removed- Specified by:
figureRemovedin interfaceFigureChangeListener
-
figureRequestRemove
public void figureRequestRemove(FigureChangeEvent e)
Description copied from interface:FigureChangeListenerSent when requesting to remove a figure.- Specified by:
figureRequestRemovein interfaceFigureChangeListener
-
figureInvalidated
public void figureInvalidated(FigureChangeEvent e)
Description copied from interface:FigureChangeListenerSent when an area is invalid- Specified by:
figureInvalidatedin interfaceFigureChangeListener
-
figureRequestUpdate
public void figureRequestUpdate(FigureChangeEvent e)
Description copied from interface:FigureChangeListenerSent when an update should happen.- Specified by:
figureRequestUpdatein interfaceFigureChangeListener
-
release
public void release()
Description copied from class:AbstractFigureA figure is released from the drawing. You never call this method directly. Release notifies its listeners.- Specified by:
releasein interfaceFigure- Overrides:
releasein classAbstractFigure- See Also:
Figure.release()
-
write
public void write(StorableOutput dw)
Description copied from class:AbstractFigureStores the Figure to a StorableOutput.- Specified by:
writein interfaceStorable- Overrides:
writein classPolyLineFigure
-
read
public void read(StorableInput dr) throws java.io.IOException
Description copied from class:AbstractFigureReads the Figure from a StorableInput.- Specified by:
readin interfaceStorable- Overrides:
readin classPolyLineFigure- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG