JHotDraw 7.0.6

org.jhotdraw.samples.pert.figures
Class DependencyFigure

java.lang.Object
  extended by org.jhotdraw.draw.AbstractFigure
      extended by org.jhotdraw.draw.AttributedFigure
          extended by org.jhotdraw.draw.BezierFigure
              extended by org.jhotdraw.draw.LineFigure
                  extended by org.jhotdraw.draw.LineConnectionFigure
                      extended by org.jhotdraw.samples.pert.figures.DependencyFigure
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ConnectionFigure, Figure, DOMStorable

public class DependencyFigure
extends LineConnectionFigure

DependencyFigure.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jhotdraw.draw.BezierFigure
CLOSED, path
 
Fields inherited from class org.jhotdraw.draw.AbstractFigure
changingDepth, decorator, listenerList
 
Constructor Summary
DependencyFigure()
          Creates a new instance.
 
Method Summary
 boolean canConnect(Figure start)
          Checks if this ConnectionFigure can be attached to the provided start figure.
 boolean canConnect(Figure start, Figure end)
          Checks if two figures can be connected.
 DependencyFigure clone()
          Returns a clone of the figure.
 int getLayer()
          Gets the layer of the figure.
protected  void handleConnect(Figure start, Figure end)
          Handles the connection of a connection.
protected  void handleDisconnect(Figure start, Figure end)
          Handles the disconnection of a connection.
 void removeNotify(Drawing d)
          Informs a figure, that it has been removed from the specified drawing.
 
Methods inherited from class org.jhotdraw.draw.LineConnectionFigure
addNotify, basicSetEndConnector, basicSetNode, basicSetStartConnector, basicTransform, canConnect, connectsSame, createHandles, getBezierPath, getEndConnector, getEndFigure, getLiner, getStartConnector, getStartFigure, handleMouseClick, lineout, read, readLiner, readPoints, remap, reverseConnection, setEndConnector, setEndPoint, setLiner, setPoint, setStartConnector, setStartPoint, updateConnection, validate, write, writeLiner, writePoints
 
Methods inherited from class org.jhotdraw.draw.BezierFigure
addNode, addNode, basicAddNode, basicAddNode, basicJoinSegments, basicJoinSegments, basicRemoveAllNodes, basicRemoveNode, basicSetAttribute, basicSetBezierPath, basicSetBounds, basicSetEndPoint, basicSetPoint, basicSetPoint, basicSetStartPoint, basicSplitSegment, basicSplitSegment, chop, contains, drawCaps, drawFill, drawStroke, findCompatibleConnector, findConnector, findNode, findSegment, getBounds, getCappedPath, getCenter, getEndPoint, getFigureDrawBounds, getNode, getNodeCount, getOutermostPoint, getPoint, getPoint, getPointCount, getPointOnPath, getRestoreData, getStartPoint, invalidate, invalidateCappedPath, isClosed, layout, removeAllNodes, removeNode, restoreTo, setClosed, setNode, setPoint
 
Methods inherited from class org.jhotdraw.draw.AttributedFigure
applyAttributesTo, drawConnectors, drawFigure, drawText, getAttribute, getAttributeKey, getAttributes, getStroke, getStrokeMiterLimitFactor, hasAttribute, isAttributeEnabled, readAttributes, removeAttribute, setAttribute, setAttributeEnabled, setAttributes, writeAttributes
 
Methods inherited from class org.jhotdraw.draw.AbstractFigure
addFigureListener, addUndoableEditListener, basicClone, changed, draw, drawDecorator, findFigureInside, fireAreaInvalidated, fireAreaInvalidated, fireAttributeChanged, fireFigureAdded, fireFigureChanged, fireFigureChanged, fireFigureChanged, fireFigureRemoved, fireFigureRequestRemove, fireUndoableEditHappened, getActions, getChangingDepth, getCourtingConnection, getCursor, getDecomposition, getDecorator, getDrawBounds, getDrawing, getFontRenderContext, getLock, getPreferredSize, getTool, getTooltip, handleDrop, includes, isChanging, isConnectorsVisible, isDrawDecoratorFirst, isInteractive, isVisible, remap, removeFigureListener, removeUndoableEditListener, requestRemove, setBounds, setBounds, setConnectorsVisible, setDecorator, setDrawDecoratorFirst, setInteractive, setVisible, toString, transform, updateDecoratorBounds, willChange
 
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, getPoint, getPointCount, getStartPoint
 
Methods inherited from interface org.jhotdraw.draw.Figure
addFigureListener, addUndoableEditListener, basicSetAttribute, basicSetBounds, changed, contains, draw, findCompatibleConnector, findConnector, findFigureInside, getActions, getAttribute, getAttributes, getBounds, getCursor, getDecomposition, getDecorator, getDrawBounds, getPreferredSize, getRestoreData, getTool, getTooltip, handleDrop, includes, invalidate, isConnectorsVisible, isInteractive, isVisible, removeFigureListener, removeUndoableEditListener, requestRemove, restoreTo, setAttribute, setConnectorsVisible, setDecorator, setVisible, willChange
 

Constructor Detail

DependencyFigure

public DependencyFigure()
Creates a new instance.

Method Detail

canConnect

public boolean canConnect(Figure start,
                          Figure end)
Checks if two figures can be connected. Implement this method to constrain the allowed connections between figures.

Specified by:
canConnect in interface ConnectionFigure
Overrides:
canConnect in class LineConnectionFigure

canConnect

public boolean canConnect(Figure start)
Description copied from interface: ConnectionFigure
Checks if this ConnectionFigure can be attached to the provided start figure. This is used to provide an early feedback to the user, when he/she creates a new connection.

Specified by:
canConnect in interface ConnectionFigure
Overrides:
canConnect in class LineConnectionFigure

handleDisconnect

protected void handleDisconnect(Figure start,
                                Figure end)
Handles the disconnection of a connection. Override this method to handle this event.

Overrides:
handleDisconnect in class LineConnectionFigure

handleConnect

protected void handleConnect(Figure start,
                             Figure end)
Handles the connection of a connection. Override this method to handle this event.

Overrides:
handleConnect in class LineConnectionFigure

clone

public DependencyFigure clone()
Description copied from interface: Figure
Returns a clone of the figure.

Specified by:
clone in interface Figure
Overrides:
clone in class LineConnectionFigure

getLayer

public int getLayer()
Description copied from interface: Figure
Gets the layer of the figure. The layer is used to determine the z-ordering of a figure inside of a drawing. Figures with a higher layer number are drawn after figures with a lower number. The z-order of figures within the same layer is determined by the sequence the figures were added to a drawing. Figures added later to a drawn after figures which have been added before. If a figure changes its layer, it must fire a FigureListener.figureChanged event to its figure listeners. FIXME - Replace int value by a Layer object.

Specified by:
getLayer in interface Figure
Overrides:
getLayer in class AbstractFigure

removeNotify

public void removeNotify(Drawing d)
Description copied from interface: Figure
Informs a figure, that it has been removed from the specified drawing. The figure must inform all FigureListeners that it has been removed.

Specified by:
removeNotify in interface Figure
Overrides:
removeNotify in class LineConnectionFigure

Copyright 1996-2006 © JHotDraw.org