org.fopps.model
Class ProjectItem

java.lang.Object
  |
  +--org.fopps.model.AbstractItem
        |
        +--org.fopps.model.ProjectItem
All Implemented Interfaces:
java.lang.Cloneable, ModelListener
Direct Known Subclasses:
CoreAsset, Product

public abstract class ProjectItem
extends AbstractItem
implements java.lang.Cloneable, ModelListener

ProjectItem is the base class for all project entries. It provides informations regarding time, status and contains relations to other projects.


Field Summary
static double DEFAULT_CAPACITY
           
static int DEFAULT_DURATION
           
 
Fields inherited from class org.fopps.model.AbstractItem
ADDED_EVENT, CHANGE_EVENT, name, REMOVED_EVENT
 
Constructor Summary
ProjectItem(java.lang.String name)
          Constructor
ProjectItem(java.lang.String name, int start, int end)
          Constructor
 
Method Summary
 java.lang.Object clone()
          Clones this instance including listeners
protected  AbstractItem copyAttributes(AbstractItem pItem)
          Copy all attributes into a given instance
 void delete()
          Drops project item
 void extendEnd(int pDelta)
           
 void extendStart(int pDelta)
           
 void fixTimimg()
          Same as fixTiming(0, false).
 void fixTimimg(int pTimeBuffer, boolean pDoNotSucessors)
          Shifts this project in a way that the project starts not until all previous tasks are finished.
 ProjectContainer getContainer()
          Getter of association Container
 java.util.Collection getDependendProjects()
          Returns all dependend projects
 int getDuration()
          Returns the duration of the project
 int getEnd()
          Returns the end (counted in months from the start year of the container) of the project
 Feature getRootFeature()
          Returns the root feature of the project.
 int getStart()
          Returns the start of the project, counted from the start year of the project in months.
 ProjectStatus getStatus()
          Returns the current status of the project
 java.util.Collection getSuppliedProjects()
          Returns all supplied projects
 int getTotalDuration()
          Returns the total duration of the project (including the duration of subsequent projects)
 void modelChanged(ModelEvent ev)
          Invoked on model changes.
 void move(int pDelta)
           
 void setContainer(ProjectContainer pContainer)
          Setter of association Container
 void setDescription(java.lang.String pDescription)
          Sets a new project description.
 void setEnd(int pEnd)
          Sets a new value for end.
 void setName(java.lang.String pName)
          Sets the new name of the project and the root feature
 void setRootFeature(Feature pRootFeature)
          Sets the root feature.
 void setStart(int pStart)
          Sets a new value for start.
 void setStatus(ProjectStatus pStatus)
          Sets a new value for the project status.
 java.lang.String toString()
           
 
Methods inherited from class org.fopps.model.AbstractItem
addIncoming, addListener, addOutgoing, commitGhostRelations, containsType, filterElements, fireItemAdded, fireItemChanged, fireItemRemoved, getConstraints, getDescription, getIncoming, getIncomingConstraints, getListeners, getName, getOutgoing, getOutgoingConstraints, getRelationTo, hasConstraints, isBlockEvents, isConnectedWith, notifyListeners, removeAllConstraints, removeAllIncoming, removeAllListener, removeAllOutgoing, removeAllRelations, removeGhostRelations, removeIncoming, removeListener, removeOutgoing, removeRelationTo, setBlockEvents, setIncoming, setOutgoing
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_CAPACITY

public static final double DEFAULT_CAPACITY
See Also:
Constant Field Values

DEFAULT_DURATION

public static final int DEFAULT_DURATION
See Also:
Constant Field Values
Constructor Detail

ProjectItem

public ProjectItem(java.lang.String name)
Constructor

Parameters:
name - Name of project

ProjectItem

public ProjectItem(java.lang.String name,
                   int start,
                   int end)
Constructor

Parameters:
name - Name of project
start - Start point of the project in months (counted from the time baseline)
end - End point of the project in months (counted from the baseline)
Method Detail

setName

public void setName(java.lang.String pName)
Sets the new name of the project and the root feature

Overrides:
setName in class AbstractItem

getStatus

public ProjectStatus getStatus()
Returns the current status of the project


setStatus

public void setStatus(ProjectStatus pStatus)
Sets a new value for the project status. If the current value is the same as the given parameter, no change event will be emitted.

Parameters:
pStatus - New value for project status

setDescription

public void setDescription(java.lang.String pDescription)
Sets a new project description. If the current value is the same as the given parameter, no change event will be emitted. The descriptio if also applied to the root feature, if it doesn't have a description yet.

Overrides:
setDescription in class AbstractItem
Parameters:
pDescription - New value for description

getRootFeature

public Feature getRootFeature()
Returns the root feature of the project. All 'incoming' projects may add some additional features

Returns:
Root feature of project item

setRootFeature

public void setRootFeature(Feature pRootFeature)
Sets the root feature. If the current value is the same as the given parameter, no change event will be emitted.

Parameters:
pRootFeature - New root feature

getStart

public int getStart()
Returns the start of the project, counted from the start year of the project in months.

Example: Start year is 1998, the project is scheduled for May 1999. In this case this method would return 17.

Returns:
Start of the project

setStart

public void setStart(int pStart)
Sets a new value for start. If the current value is the same as the given parameter, no change event will be emitted.

Parameters:
pStart - New value for start
See Also:
setEnd(int)

getEnd

public int getEnd()
Returns the end (counted in months from the start year of the container) of the project

Returns:
End of project

setEnd

public void setEnd(int pEnd)
Sets a new value for end. If the current value is the same as the given parameter, no change event will be emitted.

Parameters:
pEnd - New value for end
See Also:
setStart(int)

getDuration

public int getDuration()
Returns the duration of the project

Returns:
Duration in months

getTotalDuration

public int getTotalDuration()
Returns the total duration of the project (including the duration of subsequent projects)

Returns:
Duration in months

fixTimimg

public void fixTimimg()
Same as fixTiming(0, false).

See Also:
#fixTiming(int,boolean)

fixTimimg

public void fixTimimg(int pTimeBuffer,
                      boolean pDoNotSucessors)
Shifts this project in a way that the project starts not until all previous tasks are finished. Negative buffer values are accepted.

Parameters:
pTimeBuffer - Optional buffer in months
pDoNotSucessors - If false, subsequent projects are not moved

move

public void move(int pDelta)

extendEnd

public void extendEnd(int pDelta)

extendStart

public void extendStart(int pDelta)

setContainer

public void setContainer(ProjectContainer pContainer)
Setter of association Container


getContainer

public ProjectContainer getContainer()
Getter of association Container


delete

public void delete()
Drops project item

Overrides:
delete in class AbstractItem

modelChanged

public void modelChanged(ModelEvent ev)
Description copied from interface: ModelListener
Invoked on model changes.

Specified by:
modelChanged in interface ModelListener
Parameters:
ev - Model event
See Also:
ModelEvent

copyAttributes

protected AbstractItem copyAttributes(AbstractItem pItem)
Copy all attributes into a given instance

Overrides:
copyAttributes in class AbstractItem

getSuppliedProjects

public java.util.Collection getSuppliedProjects()
Returns all supplied projects


getDependendProjects

public java.util.Collection getDependendProjects()
Returns all dependend projects


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones this instance including listeners

Overrides:
clone in class java.lang.Object
java.lang.CloneNotSupportedException

toString

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


Fopps 0.19 - Copyright © 2002 Oliver Wieland. All Rights Reserved.