se.liu.ida.critiquer.resources
Class OrganizationModel

java.lang.Object
  extended by se.liu.ida.critiquer.resources.OrganizationModel
All Implemented Interfaces:
TreeModel

public class OrganizationModel
extends Object
implements TreeModel

The organization model represents the available resources that may be used for this scenario To change what resources are used, we must change the constructor so that another agent factory is used to produce our set of agents TODO: Preferably this should be selectable when the planning tool starts, or at least configurable from the command line.

Author:
olale

Constructor Summary
OrganizationModel()
          Create a default hierarchy
 
Method Summary
 void addTreeModelListener(TreeModelListener l)
           
 void generateOrganization()
          Generate an organization structure.
 Vector<Agent> getAllAgents()
          Get all concrete agents that are not a combination of several agents in a group
 Object getChild(Object parent, int index)
           
 int getChildCount(Object parent)
           
 int getIndexOfChild(Object parent, Object child)
           
 Object getRoot()
           
 boolean isLeaf(Object node)
           
 void removeTreeModelListener(TreeModelListener l)
           
 void setRootAgent(Agent rootAgent)
           
 void valueForPathChanged(TreePath path, Object newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrganizationModel

public OrganizationModel()
Create a default hierarchy

Method Detail

generateOrganization

public void generateOrganization()
Generate an organization structure.


getAllAgents

public Vector<Agent> getAllAgents()
Get all concrete agents that are not a combination of several agents in a group

Returns:
all agent which have no children

getRoot

public Object getRoot()
Specified by:
getRoot in interface TreeModel

setRootAgent

public void setRootAgent(Agent rootAgent)

getChild

public Object getChild(Object parent,
                       int index)
Specified by:
getChild in interface TreeModel

getChildCount

public int getChildCount(Object parent)
Specified by:
getChildCount in interface TreeModel

isLeaf

public boolean isLeaf(Object node)
Specified by:
isLeaf in interface TreeModel

valueForPathChanged

public void valueForPathChanged(TreePath path,
                                Object newValue)
Specified by:
valueForPathChanged in interface TreeModel

getIndexOfChild

public int getIndexOfChild(Object parent,
                           Object child)
Specified by:
getIndexOfChild in interface TreeModel

addTreeModelListener

public void addTreeModelListener(TreeModelListener l)
Specified by:
addTreeModelListener in interface TreeModel

removeTreeModelListener

public void removeTreeModelListener(TreeModelListener l)
Specified by:
removeTreeModelListener in interface TreeModel