org.wizard4j.flowchart
Class Flowchart

java.lang.Object
  extended by org.wizard4j.flowchart.Flowchart

public class Flowchart
extends java.lang.Object

This is a container class to store (static and dynamic) information about a certain flowchart.

It contains:

  1. a java presentation of the flowchart tree:
  2. a pointer to the expanded tree: the expanded tree is used to:
  3. some general flowchart info in a propertyMap

The tree and expanded tree use similar elements, but for clarity they are split over 2 subpackages 'tree' and 'expandedtree'. The 'expandedtree' elements will contain extra attributes for ease of navigation and to store flowchart state.


Constructor Summary
Flowchart(org.w3c.dom.Document flowchartDoc)
          Create a flowchart starting from a flowchart DOM document.
 
Method Summary
 void expand()
          Creates the expanded tree.
 java.lang.String getBuiltInPresentation(EBuiltInFlowchartPresentationMode mode)
           
 ExBranch getExpandedRoot()
           
 java.util.HashMap<java.lang.String,java.lang.Object> getPropertyMap()
           
 ResultNode getResult()
          Gets the result of the flowchart execution as a result node tree.
 boolean isSelectedOnly()
           
 void setSelectedOnly(boolean selectedOnly)
          Allows to toggle the selectedOnly bit before calling a presentation of the expanded tree.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Flowchart

public Flowchart(org.w3c.dom.Document flowchartDoc)
          throws ValidationException
Create a flowchart starting from a flowchart DOM document.

During this step some extra validation is done (next to the schema validation):

Parameters:
flowchartDoc -
Throws:
ValidationException
Method Detail

getPropertyMap

public java.util.HashMap<java.lang.String,java.lang.Object> getPropertyMap()
Returns:
propertyMap with flowchart properties

expand

public void expand()
Creates the expanded tree.

This method is called when a flowchart is 'started', so for normal purposes it is not necessary to call it explicitly. Calling it explicitly is only needed in case one wants to present the expanded tree without starting a flowchart run.


getExpandedRoot

public ExBranch getExpandedRoot()
Returns:
the root node of the expanded tree or null if the tree was not yet expanded.

isSelectedOnly

public boolean isSelectedOnly()
Returns:
value of selectedOnly

setSelectedOnly

public void setSelectedOnly(boolean selectedOnly)
Allows to toggle the selectedOnly bit before calling a presentation of the expanded tree. Default is false.

Parameters:
selectedOnly -

getResult

public ResultNode getResult()
Gets the result of the flowchart execution as a result node tree.

If the flowchart execution was not yet finished, it will return the partial result of the already visited nodes.

Returns:
result node tree.

getBuiltInPresentation

public java.lang.String getBuiltInPresentation(EBuiltInFlowchartPresentationMode mode)
Parameters:
mode -
Returns:
the requested presentation as a String.