JHotDraw 7.5.1

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:
$Id: DependencyFigure.java 647 2010-01-24 22:52:59Z rawcoder $
Author:
Werner Randelshofer.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jhotdraw.draw.LineConnectionFigure
LINER_PROPERTY
 
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
 
Fields inherited from interface org.jhotdraw.draw.Figure
CONNECTABLE_PROPERTY, REMOVABLE_PROPERTY, SELECTABLE_PROPERTY, TRANSFORMABLE_PROPERTY
 
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 children and decorators.
 int getLayer()
          AbstractFigure always returns 0.
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, createHandles, getBezierPath, getEndConnector, getEndFigure, getLiner, getStartConnector, getStartFigure, handleMouseClick, lineout, read, readLiner, readPoints, remap, reverseConnection, setConnectable, 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, set, setBezierPath, setBounds, setClosed, setPoint, splitSegment, splitSegment
 
Methods inherited from class org.jhotdraw.draw.AbstractAttributedFigure
applyAttributesTo, draw, drawText, get, 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, isConnectable, 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, getPropertyChangeListeners, 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, addPropertyChangeListener, changed, contains, draw, findCompatibleConnector, findConnector, findFigureInside, get, getActions, getAttributes, getAttributesRestoreData, getBounds, getConnectors, getCursor, getDecomposition, getDrawingArea, getPreferredSize, getTool, getToolTipText, getTransformRestoreData, handleDrop, includes, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, removeFigureListener, removePropertyChangeListener, requestRemove, restoreAttributesTo, restoreTransformTo, set, 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 children 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 class: AbstractFigure
AbstractFigure always returns 0. Override this method if your figure needs to be on a different layer.

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.Connector, org.jhotdraw.draw.connector.Connector)

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