JHotDraw 7.2

org.jhotdraw.samples.pert.figures
Class DependencyFigure

java.lang.Object
  extended by org.jhotdraw.beans.AbstractBean
      extended by org.jhotdraw.draw.AbstractFigure
          extended by org.jhotdraw.draw.AbstractAttributedFigure
              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.

Version:
1.0 18. Juni 2006 Created.
Author:
Werner Randelshofer.
See Also:
Serialized Form

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
DependencyFigure()
          Creates a new instance.
 
Method Summary
 boolean canConnect(Connector start)
          Checks if this ConnectionFigure can be connect to the specified Connector.
 boolean canConnect(Connector start, Connector end)
          Checks if two figures can be connected.
 DependencyFigure clone()
          Returns a clone of the figure, with clones of all aggregated figures, such as chilrend and decorators.
 int getLayer()
          Gets the layer number of the figure.
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.
 void removeNotify(Drawing d)
          This method is invoked, when the Figure is being removed from a Drawing.
 
Methods inherited from class org.jhotdraw.draw.LineConnectionFigure
addNotify, canConnect, createHandles, getBezierPath, getEndConnector, getEndFigure, getLiner, getStartConnector, getStartFigure, handleMouseClick, lineout, read, readLiner, readPoints, remap, reverseConnection, setEndConnector, setEndPoint, setLiner, setNode, setPoint, setStartConnector, setStartPoint, transform, updateConnection, validate, write, writeLiner, writePoints
 
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.draw.AbstractFigure
addFigureListener, basicClone, changed, findFigureInside, fireAreaInvalidated, fireAreaInvalidated, fireAreaInvalidated, fireAttributeChanged, fireFigureAdded, fireFigureChanged, fireFigureChanged, fireFigureChanged, fireFigureHandlesChanged, fireFigureRemoved, fireFigureRequestRemove, fireUndoableEditHappened, getActions, getChangingDepth, getConnectors, getCursor, getDecomposition, getDrawing, getFontRenderContext, getLock, getPreferredSize, getTool, getToolTipText, handleDrop, includes, isChanging, isRemovable, isSelectable, isTransformable, isVisible, removeFigureListener, requestRemove, setBounds, setRemovable, setSelectable, setTransformable, setVisible, toString, willChange
 
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, getPreferredSize, getTool, getToolTipText, getTransformRestoreData, handleDrop, includes, isRemovable, isSelectable, isTransformable, isVisible, removeFigureListener, requestRemove, restoreAttributesTo, restoreTransformTo, setAttribute, setBounds, willChange
 

Constructor Detail

DependencyFigure

public DependencyFigure()
Creates a new instance.

Method Detail

canConnect

public boolean canConnect(Connector start,
                          Connector 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(Connector start)
Description copied from interface: ConnectionFigure
Checks if this ConnectionFigure 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.

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

handleDisconnect

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

Overrides:
handleDisconnect in class LineConnectionFigure
See Also:
LineConnectionFigure.removeNotify(org.jhotdraw.draw.Drawing)

handleConnect

protected void handleConnect(Connector start,
                             Connector 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, with clones of all aggregated figures, such as chilrend and decorators. The cloned figure does not clone the list of FigureListeners from its original.

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

getLayer

public int getLayer()
Description copied from interface: Figure
Gets the layer number 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.

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

removeNotify

public void removeNotify(Drawing d)
Description copied from class: LineConnectionFigure
This method is invoked, when the Figure is being removed from a Drawing. This method invokes handleDisconnect, if the Figure is connected.

Specified by:
removeNotify in interface Figure
Overrides:
removeNotify in class LineConnectionFigure
See Also:
LineConnectionFigure.handleDisconnect(org.jhotdraw.draw.Connector, org.jhotdraw.draw.Connector)

Copyright 1996-2009 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.