org.processmining.framework.models
Class ModelHierarchy

java.lang.Object
  extended by org.processmining.framework.models.ModelHierarchy
Direct Known Subclasses:
BPEL4WSHierarchy, BPELHierarchy, EPCHierarchy, PetriNetHierarchy, ProtosHierarchy, YawlNetHierarchy

public abstract class ModelHierarchy
extends java.lang.Object

Title:

Description:

Copyright: Copyright (c) 2004

Company:

Version:
1.0
Author:
not attributable

Constructor Summary
ModelHierarchy()
           
 
Method Summary
 java.lang.Object addHierarchyObject(java.lang.Object child, java.lang.Object parent, java.lang.String label)
          Add an object to the hierarchy of objects.
 java.lang.Object addHierarchyObject(java.lang.Object child, java.lang.String label)
          Add an object to the hierarchy of objects.
 boolean copyFromHierarchy(ModelHierarchy org)
           
 java.util.Collection getAllObjects()
          This method returns a collection of objects representing the nodes in this hierarchy.
 java.util.Collection getChildren(java.lang.Object parent)
          This method returns a collection of objects representing the children of the given parent object, or null if the parent object does not exist.
 java.lang.Object getParent(java.lang.Object child)
           
 java.util.Collection getRoots()
          This method returns a collection of the root elements of the hierarchy.
 java.lang.Object getSelectedNode()
          Return the user object of the selected node in the JTree visualisation.
 javax.swing.JComponent getTreeVisualization()
          Returns the visualization of the stored hierarchy
protected abstract  void selectionChanged(java.lang.Object selectedObject)
          This method is called each time the user changes the selection in the list.
 void setSelectedNode(java.lang.Object selectObject)
          Selects the node in the tree that points to the given object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelHierarchy

public ModelHierarchy()
Method Detail

addHierarchyObject

public java.lang.Object addHierarchyObject(java.lang.Object child,
                                           java.lang.String label)
Add an object to the hierarchy of objects.

Parameters:
child - Object to add as a child
label - String representing the label of the object in the tree
Returns:
Object That represents the parent to which the child is added (i.e. parent).

addHierarchyObject

public java.lang.Object addHierarchyObject(java.lang.Object child,
                                           java.lang.Object parent,
                                           java.lang.String label)
Add an object to the hierarchy of objects.

Parameters:
child - Object to add as a child
parent - Object that is the required parent of the child
label - String representing the label of the object in the tree
Returns:
Object That represents the parent to which the child is added (i.e. parent).

getChildren

public java.util.Collection getChildren(java.lang.Object parent)
This method returns a collection of objects representing the children of the given parent object, or null if the parent object does not exist.

Parameters:
parent - Object
Returns:
Collection containing the children of parent

getParent

public java.lang.Object getParent(java.lang.Object child)
Parameters:
child - Object
Returns:
Object representing the parent of the child

getRoots

public java.util.Collection getRoots()
This method returns a collection of the root elements of the hierarchy.

Returns:
Collection storing the roots of the hierarchy.

getTreeVisualization

public javax.swing.JComponent getTreeVisualization()
Returns the visualization of the stored hierarchy

Returns:
A component with the tree visialization of this object

getSelectedNode

public java.lang.Object getSelectedNode()
Return the user object of the selected node in the JTree visualisation.

Returns:
Object

setSelectedNode

public void setSelectedNode(java.lang.Object selectObject)
Selects the node in the tree that points to the given object.

Parameters:
selectObject - the object to select.

copyFromHierarchy

public boolean copyFromHierarchy(ModelHierarchy org)

selectionChanged

protected abstract void selectionChanged(java.lang.Object selectedObject)
This method is called each time the user changes the selection in the list. Note that it is only called after the constructor of a subclass has set initialized to true

Parameters:
selectedObject - The object that was selected.

getAllObjects

public java.util.Collection getAllObjects()
This method returns a collection of objects representing the nodes in this hierarchy.

Returns:
Collection containing the nodes in this hierarchy