| 
JHotDraw 7.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jhotdraw.beans.AbstractBean
org.jhotdraw.draw.AbstractFigure
org.jhotdraw.draw.AbstractAttributedFigure
org.jhotdraw.draw.BezierFigure
org.jhotdraw.draw.LineFigure
org.jhotdraw.draw.LineConnectionFigure
public class LineConnectionFigure
A LineConnection is a standard implementation of the ConnectionFigure interface. The interface is implemented with BezierFigure.
| Field Summary | 
|---|
| Fields inherited from class org.jhotdraw.draw.BezierFigure | 
|---|
path | 
| Fields inherited from class org.jhotdraw.draw.AbstractFigure | 
|---|
changingDepth, listenerList | 
| Fields inherited from class org.jhotdraw.beans.AbstractBean | 
|---|
propertySupport | 
| Constructor Summary | |
|---|---|
LineConnectionFigure()
Creates a new instance.  | 
|
| Method Summary | |
|---|---|
 void | 
addNotify(Drawing drawing)
This method is invoked, when the Figure is being removed from a Drawing.  | 
 boolean | 
canConnect()
Tests whether a figure can be a connection target.  | 
 boolean | 
canConnect(Connector start)
Checks if this ConnectionFigure can be connect to the specified
 Connector. | 
 boolean | 
canConnect(Connector start,
           Connector end)
Returns true, if this ConnectionFigure can connect the specified Connectors. | 
 LineConnectionFigure | 
clone()
Returns a clone of the figure, with clones of all aggregated figures, such as chilrend and decorators.  | 
 java.util.Collection<Handle> | 
createHandles(int detailLevel)
Gets the handles of the figure.  | 
 BezierPath | 
getBezierPath()
FIXME - Liner must work with API of LineConnection!  | 
 Connector | 
getEndConnector()
Gets the end Connector.  | 
 Figure | 
getEndFigure()
Gets the end figure of the connection.  | 
 Liner | 
getLiner()
Get a Liner object which encapsulated a lineout algorithm for this figure.  | 
 Connector | 
getStartConnector()
Gets the start Connector. | 
 Figure | 
getStartFigure()
Gets the start figure of the connection.  | 
protected  void | 
handleConnect(Connector start,
              Connector end)
Handles the connection of a connection.  | 
protected  void | 
handleDisconnect(Connector start,
                 Connector end)
Handles the disconnection of a connection.  | 
 boolean | 
handleMouseClick(java.awt.geom.Point2D.Double p,
                 java.awt.event.MouseEvent evt,
                 DrawingView view)
Handles a mouse click.  | 
 void | 
lineout()
A lineout algorithm is used to define how the child components should be laid out in relation to each other.  | 
 void | 
read(DOMInput in)
 | 
protected  void | 
readLiner(DOMInput in)
 | 
protected  void | 
readPoints(DOMInput in)
 | 
 void | 
remap(java.util.Map oldToNew)
After cloning a collection of figures, the ConnectionFigures contained in this collection still connect to the original figures instead of to the clones.  | 
 void | 
removeNotify(Drawing drawing)
This method is invoked, when the Figure is being removed from a Drawing.  | 
 void | 
reverseConnection()
 | 
 void | 
setEndConnector(Connector newEnd)
Sets the end Connector of the connection.  | 
 void | 
setEndPoint(java.awt.geom.Point2D.Double p)
Convenience method for setting the point coordinate of the end point.  | 
 void | 
setLiner(Liner newValue)
Set a Liner object which encapsulated a lineout algorithm for this figure.  | 
 void | 
setNode(int index,
        BezierPath.Node p)
Sets a control point.  | 
 void | 
setPoint(int index,
         java.awt.geom.Point2D.Double p)
Sets the point coordinate of control point 0 at the specified node.  | 
 void | 
setStartConnector(Connector newStart)
Sets the start Connector of the connection. | 
 void | 
setStartPoint(java.awt.geom.Point2D.Double p)
Convenience method for setting the point coordinate of the start point.  | 
 void | 
transform(java.awt.geom.AffineTransform tx)
Ensures that a connection is updated if the connection was moved.  | 
 void | 
updateConnection()
Updates the start and end point of the figure and fires figureChanged events.  | 
 void | 
validate()
 | 
 void | 
write(DOMOutput out)
 | 
protected  void | 
writeLiner(DOMOutput out)
 | 
protected  void | 
writePoints(DOMOutput out)
 | 
| Methods inherited from class org.jhotdraw.draw.BezierFigure | 
|---|
addNode, addNode, chop, contains, drawCaps, drawFill, drawStroke, findCompatibleConnector, findConnector, findNode, findSegment, getBounds, getCappedPath, getCenter, getDrawingArea, getEndPoint, getNode, getNodeCount, getOutermostPoint, getPoint, getPoint, getPointOnPath, getStartPoint, getTransformRestoreData, invalidate, isClosed, joinSegments, joinSegments, layout, removeAllNodes, removeNode, restoreTransformTo, setAttribute, setBezierPath, setBounds, setClosed, setPoint, splitSegment, splitSegment | 
| Methods inherited from class org.jhotdraw.draw.AbstractAttributedFigure | 
|---|
applyAttributesTo, draw, drawText, getAttribute, getAttributeKey, getAttributes, getAttributesRestoreData, getStroke, getStrokeMiterLimitFactor, hasAttribute, isAttributeEnabled, readAttributes, removeAttribute, restoreAttributesTo, setAttributeEnabled, setAttributes, writeAttributes | 
| Methods inherited from class org.jhotdraw.beans.AbstractBean | 
|---|
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener | 
| Methods inherited from class java.lang.Object | 
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Methods inherited from interface org.jhotdraw.draw.ConnectionFigure | 
|---|
getEndPoint, getNode, getNodeCount, getPoint, getStartPoint | 
| Methods inherited from interface org.jhotdraw.draw.Figure | 
|---|
addFigureListener, changed, contains, draw, findCompatibleConnector, findConnector, findFigureInside, getActions, getAttribute, getAttributes, getAttributesRestoreData, getBounds, getConnectors, getCursor, getDecomposition, getDrawingArea, getLayer, getPreferredSize, getTool, getToolTipText, getTransformRestoreData, handleDrop, includes, isRemovable, isSelectable, isTransformable, isVisible, removeFigureListener, requestRemove, restoreAttributesTo, restoreTransformTo, setAttribute, setBounds, willChange | 
| Constructor Detail | 
|---|
public LineConnectionFigure()
| Method Detail | 
|---|
public void transform(java.awt.geom.AffineTransform tx)
transform in interface Figuretransform in class BezierFiguretx - The transformation.Figure.getTransformRestoreData(), 
Figure.restoreTransformTo(java.lang.Object)public java.util.Collection<Handle> createHandles(int detailLevel)
createHandles in interface FigurecreateHandles in class LineFiguredetailLevel - The detail level of the handles. Usually this is 0 for
 bounding box handles and 1 for point handles.
Handlepublic boolean canConnect()
canConnect in interface FigurecanConnect in class LineFigurepublic void updateConnection()
ConnectionFigure
updateConnection in interface ConnectionFigurepublic void validate()
validate in class BezierFigure
public boolean canConnect(Connector start,
                          Connector end)
ConnectionFigureConnectors.
 Implement this method to constrain the allowed connections between figures.
canConnect in interface ConnectionFigurepublic Connector getEndConnector()
ConnectionFigure
getEndConnector in interface ConnectionFigurepublic Figure getEndFigure()
ConnectionFigure
getEndFigure in interface ConnectionFigurepublic Connector getStartConnector()
ConnectionFigureConnector.
 Returns null, if there is no start connection.
getStartConnector in interface ConnectionFigurepublic Figure getStartFigure()
ConnectionFigure
getStartFigure in interface ConnectionFigurepublic void setEndConnector(Connector newEnd)
ConnectionFigure
setEndConnector in interface ConnectionFigurenewEnd - the end Connector of the connectionpublic void setStartConnector(Connector newStart)
ConnectionFigureConnector of the connection.
 Set this to null to disconnect the start connection.
setStartConnector in interface ConnectionFigurenewStart - the start Connector of the connectionpublic void addNotify(Drawing drawing)
addNotify in interface FigureaddNotify in class AbstractFigurehandleConnect(org.jhotdraw.draw.Connector, org.jhotdraw.draw.Connector)public void removeNotify(Drawing drawing)
removeNotify in interface FigureremoveNotify in class AbstractFigurehandleDisconnect(org.jhotdraw.draw.Connector, org.jhotdraw.draw.Connector)
protected void handleDisconnect(Connector start,
                                Connector end)
Note: This method is only invoked, when the Figure is part of a Drawing. If the Figure is removed from a Drawing, this method is invoked on behalf of the removeNotify call to the Figure.
removeNotify(org.jhotdraw.draw.Drawing)
protected void handleConnect(Connector start,
                             Connector end)
Note: This method is only invoked, when the Figure is part of a Drawing. If the Figure is added to a Drawing this method is invoked on behalf of the addNotify call to the Figure.
public LineConnectionFigure clone()
Figure
clone in interface Figureclone in class BezierFigurepublic void remap(java.util.Map oldToNew)
Figure
remap in interface Figureremap in class AbstractFigurepublic boolean canConnect(Connector start)
ConnectionFigureConnectionFigure can be connect to the specified
 Connector.
 This is used to provide an early feedback to the user, when he/she
 creates a new connection.
canConnect in interface ConnectionFigure
public boolean handleMouseClick(java.awt.geom.Point2D.Double p,
                                java.awt.event.MouseEvent evt,
                                DrawingView view)
handleMouseClick in interface FigurehandleMouseClick in class LineFigurep - The location of the mouse event.evt - The mouse event.view - The drawing view which is the source of the mouse event.
protected void readPoints(DOMInput in)
                   throws java.io.IOException
readPoints in class BezierFigurejava.io.IOException
public void read(DOMInput in)
          throws java.io.IOException
read in interface DOMStorableread in class BezierFigurejava.io.IOException
protected void readLiner(DOMInput in)
                  throws java.io.IOException
java.io.IOException
public void write(DOMOutput out)
           throws java.io.IOException
write in interface DOMStorablewrite in class BezierFigurejava.io.IOException
protected void writeLiner(DOMOutput out)
                   throws java.io.IOException
java.io.IOException
protected void writePoints(DOMOutput out)
                    throws java.io.IOException
writePoints in class BezierFigurejava.io.IOExceptionpublic void setLiner(Liner newValue)
ConnectionFigure
setLiner in interface ConnectionFigurenewValue - encapsulation of a lineout algorithm.
public void setNode(int index,
                    BezierPath.Node p)
BezierFigure
setNode in interface ConnectionFiguresetNode in class BezierFigurepublic void lineout()
ConnectionFigure
lineout in interface ConnectionFigurepublic BezierPath getBezierPath()
getBezierPath in class BezierFigurepublic Liner getLiner()
ConnectionFigure
getLiner in interface ConnectionFigurepublic void setStartPoint(java.awt.geom.Point2D.Double p)
BezierFigure
setStartPoint in interface ConnectionFiguresetStartPoint in class BezierFigure
public void setPoint(int index,
                     java.awt.geom.Point2D.Double p)
BezierFigure
setPoint in interface ConnectionFiguresetPoint in class BezierFigurepublic void setEndPoint(java.awt.geom.Point2D.Double p)
BezierFigure
setEndPoint in interface ConnectionFiguresetEndPoint in class BezierFigurepublic void reverseConnection()
  | 
Copyright 1996-2007 (c) JHotDraw.org. Some rights reserved.  | 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||