com.ibm.rules.studio.projectmap.model

Class ProjectMapModel

  • java.lang.Object
    • com.ibm.rules.studio.projectmap.model.ProjectMapModel


  • public class ProjectMapModel
    extends java.lang.Object
    ProjectMapModel is a model for describing a project map which is a sort of task flow to help the user to walk on the happy path of project implementation.
    • Constructor Detail

      • ProjectMapModel

        public ProjectMapModel(java.util.UUID id,
                       IProjectMapModelInfoProvider provider)
        Creates a ProjectMapModel
        Parameters:
        id - a unique identifier for the model
        provider - an interface providing feedback to the model
    • Method Detail

      • addChangedListener

        public void addChangedListener(IProjectMapChangedListener listener)
        Add a changed listener to the model
        Parameters:
        listener - the listener to be added
      • removeChangedListener

        public void removeChangedListener(IProjectMapChangedListener listener)
        Remove a changed listener to the model
        Parameters:
        listener - the listener to be removed
      • beginUpdate

        public void beginUpdate()
        enable the quiet mode, no events are generated till endUpdate is called
      • endUpdate

        public void endUpdate()
        disable the quiet mode
      • refresh

        public boolean refresh()
        refresh the model by calling canExecute and isComplete on each IProjectMapActivityInfoProvider in the model
        Returns:
        true if the model has changed, false otherwise
      • newBox

        public ProjectMapBox newBox(java.util.UUID id,
                           java.lang.String title,
                           java.lang.String tooltip,
                           boolean optional)
        Creates a new box in the model
        Parameters:
        id - an unique identifier for the set in the model
        title - label of the set
        tooltip -
        optional -
        Returns:
        the new created set
      • newActivity

        public ProjectMapActivity newActivity(java.util.UUID id,
                                     ProjectMapBox box,
                                     IProjectMapDependency dependency,
                                     IProjectMapActivityInfoProvider provider)
                                       throws java.lang.IllegalArgumentException,
                                              java.lang.NullPointerException
        Creates a new activity in the model
        Throws:
        java.lang.IllegalArgumentException - provider should be not null and set, parents should be of the current model
        java.lang.NullPointerException
        Parameters:
        id - an unique identifier for the activity in the model
        box - the box container of the activity
        dependency - a set of (at least one) activity which have to be completed before this activity is runnable
        provider - an object which provides current status of the activity
        Returns:
        the created activity
      • newActivity

        public ProjectMapActivity newActivity(java.util.UUID id,
                                     ProjectMapBox box,
                                     IProjectMapActivityInfoProvider provider)
                                       throws java.lang.IllegalArgumentException,
                                              java.lang.NullPointerException
        Creates a new activity in the model
        Throws:
        java.security.InvalidParameterException - set, provider should be not null and set, parents should be of the current model
        java.lang.IllegalArgumentException
        java.lang.NullPointerException
        Parameters:
        id - an unique identifier for the activity in the model
        box - the container of the activity
        provider - an object which provides current status of the activity
        Returns:
        the created activity
      • newLink

        public ProjectMapLink newLink(java.util.UUID id,
                             ProjectMapBox sourceBox,
                             ProjectMapBox targetBox,
                             ProjectMapLinkArrowType arrow,
                             ProjectMapLinkStyle style)
                               throws java.lang.IllegalArgumentException,
                                      java.lang.NullPointerException
        Factory for links
        Throws:
        java.lang.NullPointerException - when sourceSet or targetSet are null
        java.lang.IllegalArgumentException - when sourceSet or targetSet are not in this instance of the model
        Parameters:
        id - a UUID to reference the link
        sourceBox - a ProjectMapSet source of the link
        targetBox - a ProjectMapSet target of the link
        arrow - a ProjectMapLinkArrowEnum value
        style - a ProjectMapLinkStyleEnum value
        Returns:
        a ProjectMapLink if successfully created
      • getModelId

        public java.util.UUID getModelId()
        returns the model identifier
        Returns:
        a UUID
      • validate

        public java.util.Collection<java.lang.String> validate()
      • getLinks

        public java.util.Collection<ProjectMapLink> getLinks()
        returns a read only collection of links defined in the model
        Returns:
        a Collection object
      • getBoxes

        public java.util.Collection<ProjectMapBox> getBoxes()
        returns a read only collection of boxes defined in the model
        Returns:
        a Collection object
      • getBox

        public ProjectMapBox getBox(java.util.UUID boxId)
        returns the ProjectMapBox referenced with the provided id, null if not found
        Parameters:
        boxId - a UUID object
        Returns:
        a ProjectMapSet
      • getActivity

        public ProjectMapActivity getActivity(java.util.UUID actId)
        returns the ProjectMapActivity referenced with the provided id null if not found
        Parameters:
        actId - a UUID object
        Returns:
        a ProjectMapActivity
      • getLink

        public ProjectMapLink getLink(java.util.UUID actId)
        returns the ProjectMapLink referenced with the provided id null if not found
        Parameters:
        actId - a UUID object
        Returns:
        a ProjectMapLink
      • toString

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

        public boolean removeActivity(java.util.UUID actId)
        Removes activity matching the provided id from the model Returns true on success, false on failure
        Parameters:
        actId - a UUID
        Returns:
        a boolean value
      • removeActivity

        public boolean removeActivity(ProjectMapActivity activity)
        Removes the activity provided from the model Returns true on success, false on failure
        Parameters:
        activity - a ProjectMapActivity object
        Returns:
        a boolean value
      • removeLink

        public boolean removeLink(java.util.UUID lnkId)
        Removes link matching the provided id from the model Returns true on success, false on failure
        Parameters:
        lnkId - a UUID
        Returns:
        a boolean value
      • removeLink

        public boolean removeLink(ProjectMapLink link)
        Removes the link provided from the model Returns true on success, false on failure
        Parameters:
        link - a ProjectMapLink object
        Returns:
        a boolean value
      • removeBox

        public boolean removeBox(java.util.UUID boxId)
        Removes box matching the provided id from the model Returns true on success, false on failure
        Parameters:
        boxId - a UUID
        Returns:
        a boolean value
      • removeBox

        public boolean removeBox(ProjectMapBox box)
        Removes the box provided from the model Returns true on success, false on failure
        Parameters:
        box - a ProjectMapBox object
        Returns:
        a boolean value
      • getShortDescription

        public java.lang.String getShortDescription()
        returns a short description to display at the top left of the view
        Returns:
        a String value
      • getWarningCount

        public int getWarningCount()
        returns the warning count of the current scope
        Returns:
        an int value
      • getErrorCount

        public int getErrorCount()
        returns the error count of the current scope
        Returns:
        an int value
      • isVisible

        public boolean isVisible()
        Returns if the project map should be visible at this time
        Returns:
        a boolean value

© Copyright IBM Corp. 1987, 2017