| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.essex.ia.media.OperatorManager
public class OperatorManager
Class that manages the initilisation of operators. It uses an xml file to store names of operators and parses the file at runtime so it knows what operators are available. This allows users of ImageApp to create there own operators and integrate them into ImageApp without any changes to the core code.
| Field Summary | |
|---|---|
| protected  java.util.ArrayList | actions | 
| protected  java.lang.String | fileName | 
| static int | HEIGHTHeight of the opertors vertex | 
| static int | INCREMENTThe increment used to seperate the ports | 
| static int | NO_OF_DEST_PORTSDefault number of output ports | 
| static int | NO_OF_SOURCE_PORTSDefault number of input ports | 
| protected  java.util.HashMap | opClassesToTags | 
| static java.lang.String | OPERATOR_DIR_XML | 
| protected  java.lang.Class[] | operatorClasses | 
| protected  OperatorDescriptor[] | operatorDescriptors | 
| protected  java.util.HashMap | opGroupNameToActions | 
| protected  java.util.HashMap | opGroupNameToOperators | 
| protected  java.util.HashMap | opGroupToOperatorsThis maps every group to its operator descriptors ie/ OperatorGroup --> OperatorDescriptor[] | 
| protected  java.util.HashMap | opIDToClass | 
| protected  java.util.ArrayList | textMenus | 
| protected  OperatorGroup[] | topLevelOperatorGroups | 
| static int | WIDTHWidth of opertors vertex | 
| static int | X_POSX Position of this fig | 
| static int | Y_POSY position of this Fig | 
| Method Summary | |
|---|---|
| protected  void | createActions()This class creates a set of actions, one per operator. | 
| protected  void | createClasses()This initialises the variables opClassesToTags,opIDToClassandoperatorClasses. | 
| protected  javax.swing.JMenu[] | createJMenus()Creates a new set of menus one for each action group. | 
| static OperatorManager | getInstance() | 
|  java.util.ArrayList | getOperatorActions() | 
|  java.lang.Class | getOperatorClass(java.lang.String operatorID) | 
|  OperatorDescriptor | getOperatorDescriptor(java.lang.Class operatorClass) | 
|  javax.swing.JMenu[] | getTextMenus() | 
|  boolean | getValidate() | 
| static com.jgraph.graph.DefaultGraphCell | insert(com.jgraph.JGraph graph,
       Operator operator,
       java.awt.Point point)TODO: Move this ??? See PersistenceManager.insert(com.jgraph.JGraph, uk.ac.essex.ia.Operator, java.awt.Point, uk.ac.essex.ia.opview.xml.Port[])Insert an operator into the given graph at the given point | 
|  void | loadOperatorsIn(OperatorGroup group)Recursive function to load the two hashmaps opGroupNameToOperatorsandopGroupToOperators. | 
| static void | main(java.lang.String[] args) | 
| protected  void | parseFile()Parse the configuration file using castor | 
|  void | setValidate(boolean shouldValidate) | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final int X_POS
public static final int Y_POS
public static final int WIDTH
public static final int HEIGHT
public static final int INCREMENT
public static final java.lang.String OPERATOR_DIR_XML
public static int NO_OF_SOURCE_PORTS
public static int NO_OF_DEST_PORTS
protected OperatorGroup[] topLevelOperatorGroups
protected OperatorDescriptor[] operatorDescriptors
protected java.util.ArrayList actions
protected java.util.ArrayList textMenus
protected java.lang.String fileName
protected java.lang.Class[] operatorClasses
protected java.util.HashMap opClassesToTags
protected java.util.HashMap opIDToClass
protected java.util.HashMap opGroupToOperators
protected java.util.HashMap opGroupNameToOperators
protected java.util.HashMap opGroupNameToActions
| Method Detail | 
|---|
public static OperatorManager getInstance()
                                   throws java.lang.Exception
java.lang.Exception
public static com.jgraph.graph.DefaultGraphCell insert(com.jgraph.JGraph graph,
                                                       Operator operator,
                                                       java.awt.Point point)
PersistenceManager.insert(com.jgraph.JGraph, uk.ac.essex.ia.Operator, java.awt.Point, uk.ac.essex.ia.opview.xml.Port[])
 Insert an operator into the given graph at the given point
graph - operator - point - public boolean getValidate()
public void setValidate(boolean shouldValidate)
shouldValidate - - whether it should validate the XMLpublic OperatorDescriptor getOperatorDescriptor(java.lang.Class operatorClass)
operatorClass - - The class object of the operator whose xml config you want
public java.util.ArrayList getOperatorActions()
public javax.swing.JMenu[] getTextMenus()
public java.lang.Class getOperatorClass(java.lang.String operatorID)
operatorID - public void loadOperatorsIn(OperatorGroup group)
opGroupNameToOperators and
 opGroupToOperators. This is recursive as operator groups can contain operator
 groups.
group - protected void createActions()
actions and opGroupNameToActions.
protected void createClasses()
opClassesToTags, opIDToClass and
 operatorClasses.
protected javax.swing.JMenu[] createJMenus()
createActions()
protected void parseFile()
                  throws java.lang.Exception
java.lang.Exceptionpublic static void main(java.lang.String[] args)
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||