JHotDraw 7.4.1

org.jhotdraw.samples.pert.figures
Class TaskFigure

java.lang.Object
  extended by org.jhotdraw.beans.AbstractBean
      extended by org.jhotdraw.draw.AbstractFigure
          extended by org.jhotdraw.draw.AbstractCompositeFigure
              extended by org.jhotdraw.draw.GraphicalCompositeFigure
                  extended by org.jhotdraw.samples.pert.figures.TaskFigure
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, CompositeFigure, Figure, DOMStorable

public class TaskFigure
extends GraphicalCompositeFigure

TaskFigure.

Version:
$Id: TaskFigure.java 604 2010-01-09 12:00:29Z rawcoder $
Author:
Werner Randelshofer.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jhotdraw.draw.AbstractCompositeFigure
AbstractCompositeFigure.EventHandler
 
Field Summary
 
Fields inherited from class org.jhotdraw.draw.GraphicalCompositeFigure
attributes
 
Fields inherited from class org.jhotdraw.draw.AbstractCompositeFigure
cachedBounds, cachedDrawingArea, children, eventHandler, layouter
 
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.CompositeFigure
LAYOUT_INSETS
 
Fields inherited from interface org.jhotdraw.draw.Figure
CONNECTABLE_PROPERTY, REMOVABLE_PROPERTY, SELECTABLE_PROPERTY, TRANSFORMABLE_PROPERTY
 
Constructor Summary
TaskFigure()
          Creates a new instance.
 
Method Summary
 void addDependency(DependencyFigure f)
           
 TaskFigure clone()
          Returns a clone of the figure, with clones of all aggregated figures, such as children and decorators.
 java.util.Collection<Handle> createHandles(int detailLevel)
          Return default handles from the presentation figure.
 java.util.Set<DependencyFigure> getDependencies()
           
 int getDuration()
           
 int getLayer()
          Gets the layer number of the figure.
 java.lang.String getName()
           
 java.util.List<TaskFigure> getPredecessors()
          Returns predecessor PertTasks which are directly connected via a PertDependency to this TaskFigure.
 int getStartTime()
           
 java.util.List<TaskFigure> getSuccessors()
          Returns dependent PertTasks which are directly connected via a PertDependency to this TaskFigure.
 boolean isDependentOf(TaskFigure t)
          Returns true, if the current task is a direct or indirect dependent of the specified task.
 void read(DOMInput in)
           
 void removeDependency(DependencyFigure f)
           
 void setDuration(int newValue)
           
 void setName(java.lang.String newValue)
           
 java.lang.String toString()
           
 void updateStartTime()
           
 void write(DOMOutput out)
           
 
Methods inherited from class org.jhotdraw.draw.GraphicalCompositeFigure
addNotify, applyAttributesTo, basicSetPresentationFigureBounds, chop, contains, draw, drawPresentationFigure, get, getAttributeKey, getAttributes, getBounds, getDrawingArea, getPresentationFigure, readAttributes, remap, removeNotify, set, setAttributeEnabled, setBounds, setPresentationFigure, superBasicSetBounds, transform, writeAttributes
 
Methods inherited from class org.jhotdraw.draw.AbstractCompositeFigure
add, add, addAll, addAll, addCompositeFigureListener, basicAdd, basicAdd, basicAddAll, basicRemove, basicRemoveAll, basicRemoveAllChildren, basicRemoveChild, bringToFront, changed, contains, createEventHandler, findChild, findChildIndex, findFigureInside, fireFigureAdded, fireFigureRemoved, getAttributesRestoreData, getChild, getChildCount, getChildren, getChildrenFrontToBack, getDecomposition, getLayouter, getPreferredSize, getTransformRestoreData, indexOf, invalidate, layout, remove, removeAll, removeAllChildren, removeChild, removeCompositeFigureListener, restoreAttributesTo, restoreTransformTo, sendToBack, setLayouter, validate, willChange
 
Methods inherited from class org.jhotdraw.draw.AbstractFigure
addFigureListener, basicClone, findCompatibleConnector, findConnector, fireAreaInvalidated, fireAreaInvalidated, fireAreaInvalidated, fireAttributeChanged, fireFigureAdded, fireFigureChanged, fireFigureChanged, fireFigureChanged, fireFigureHandlesChanged, fireFigureRemoved, fireFigureRequestRemove, fireUndoableEditHappened, getActions, getChangingDepth, getConnectors, getCursor, getDrawing, getEndPoint, getFontRenderContext, getLock, getStartPoint, getTool, getToolTipText, handleDrop, handleMouseClick, includes, isChanging, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, requestRemove, setBounds, setConnectable, setRemovable, setSelectable, setTransformable, setVisible
 
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.Figure
addFigureListener, addPropertyChangeListener, findCompatibleConnector, findConnector, getActions, getConnectors, getCursor, getEndPoint, getStartPoint, getTool, getToolTipText, handleDrop, handleMouseClick, includes, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, removePropertyChangeListener, requestRemove
 

Constructor Detail

TaskFigure

public TaskFigure()
Creates a new instance.

Method Detail

createHandles

public java.util.Collection<Handle> createHandles(int detailLevel)
Description copied from class: GraphicalCompositeFigure
Return default handles from the presentation figure.

Specified by:
createHandles in interface Figure
Overrides:
createHandles in class GraphicalCompositeFigure
Parameters:
detailLevel - The detail level of the handles. Usually this is 0 for bounding box handles and 1 for point handles. The value -1 is used by the SelectAreaTracker and the HandleTracker to highlight figures, over which the mouse pointer is hovering.
Returns:
a Collection of handles
See Also:
Handle

setName

public void setName(java.lang.String newValue)

getName

public java.lang.String getName()

setDuration

public void setDuration(int newValue)

getDuration

public int getDuration()

updateStartTime

public void updateStartTime()

getStartTime

public int getStartTime()

clone

public TaskFigure 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 GraphicalCompositeFigure

read

public void read(DOMInput in)
          throws java.io.IOException
Specified by:
read in interface DOMStorable
Overrides:
read in class GraphicalCompositeFigure
Throws:
java.io.IOException

write

public void write(DOMOutput out)
           throws java.io.IOException
Specified by:
write in interface DOMStorable
Overrides:
write in class GraphicalCompositeFigure
Throws:
java.io.IOException

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

getDependencies

public java.util.Set<DependencyFigure> getDependencies()

addDependency

public void addDependency(DependencyFigure f)

removeDependency

public void removeDependency(DependencyFigure f)

getSuccessors

public java.util.List<TaskFigure> getSuccessors()
Returns dependent PertTasks which are directly connected via a PertDependency to this TaskFigure.


getPredecessors

public java.util.List<TaskFigure> getPredecessors()
Returns predecessor PertTasks which are directly connected via a PertDependency to this TaskFigure.


isDependentOf

public boolean isDependentOf(TaskFigure t)
Returns true, if the current task is a direct or indirect dependent of the specified task. If the dependency is cyclic, then this method returns true if this is passed as a parameter and for every other task in the cycle.


toString

public java.lang.String toString()
Overrides:
toString in class AbstractFigure

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