Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## pipe.gui
Class ModuleManager

    java.lang.Object
      pipe.gui.ModuleManager

All Implemented Interfaces:
  Constants

public class ModuleManager
extends java.lang.Object
implements Constants

The ModuleManager class contains methods to create swing components to allow the user to load modules and execute methods within them. To use, instantiate a ModuleManager object and use the methods to return the required components.

Author:
  Camilla Clifford

Nested Class Summary
`(package private) class` | `ModuleManager.RemoveModuleAction` Action object that can be used to remove a module from the ModuleTree
`class` | `ModuleManager.TreeHandler`

Field Summary
`private java.util.HashSet` | `installedModules`
`private javax.swing.tree.DefaultMutableTreeNode` | `load_modules`
`private java.lang.String` | `loadNodeString`
`private javax.swing.JTree` | `moduleTree`
`(package private) java.awt.Component` | `parent`
`private javax.swing.tree.DefaultTreeModel` | `treeModel`

Fields inherited from interface pipe.gui.Constants
`ADDTOKEN, ANIMATE, ANNOTATION, ANNOTATION_DEFAULT_FONT, ANNOTATION_DEFAULT_FONT_SIZE, ANNOTATION_LAYER_OFFSET, ANNOTATION_MIN_WIDTH, ANNOTATION_SIZE_OFFSET, ARC, ARC_CONTROL_POINT_CONSTANT, ARC_LAYER_OFFSET, ARC_PATH_PROXIMITY_WIDTH, ARC_PATH_SELECTION_WIDTH, ARC_POINT_LAYER_OFFSET, CREATING, DEFAULT_ELEMENT_TYPE, DELETE, DELTOKEN, DRAW, ELEMENT_FILL_COLOUR, ELEMENT_LINE_COLOUR, ENABLED_TRANSITION_COLOUR, FIRE, GRID, IMMTRANS, LOWEST_LAYER_OFFSET, NOTE_DISABLED_COLOUR, NOTE_EDITING_COLOUR, PLACE, PLACE_TRANSITION_HEIGHT, PLACE_TRANSITION_LAYER_OFFSET, PLACE_TRANSITION_PROXIMITY_RADIUS, PROPERTY_FILE_DESC, PROPERTY_FILE_EXTENSION, RANDOM, RESERVED_BORDER, RESIZE_POINT_DOWN_COLOUR, SELECT, SELECTION_FILL_COLOUR, SELECTION_LAYER_OFFSET, SELECTION_LINE_COLOUR, START, STEPBACKWARD, STEPFORWARD, STOP, TIMEDTRANS`

Constructor Summary
`ModuleManager()`

Method Summary
`private void` | `addClassToTree(java.lang.Class moduleClass)` Method creates and returns a Module management tree.
`void` | `addModuleToTree(javax.swing.tree.DefaultMutableTreeNode newNode)` Adds a new node to the Module subtree
`private java.util.Vector` | `getModuleClasses(java.io.File rootDir)` Finds all the fully qualified (ie: full package names) module classnames by recursively searching the rootDirectories
`private java.io.File` | `getModuleDir()` Returns the root directory under which the modules will be found.
`javax.swing.JTree` | `getModuleTree()`
`void` | `removeModuleFromTree(javax.swing.tree.DefaultMutableTreeNode newNode)` Removes a node from the Module subtree

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### installedModules

    private java.util.HashSet installedModules

### moduleTree

    private javax.swing.JTree moduleTree

### treeModel

    private javax.swing.tree.DefaultTreeModel treeModel

### load_modules

    private javax.swing.tree.DefaultMutableTreeNode load_modules

### loadNodeString

    private java.lang.String loadNodeString

### parent

    java.awt.Component parent

Constructor Detail

### ModuleManager

    public ModuleManager()

Method Detail

### getModuleDir

    private java.io.File getModuleDir()

  Returns the root directory under which the modules will be found. At present this is the same directory in which all the classes are found - this could change.

### getModuleClasses

    private java.util.Vector getModuleClasses(java.io.File rootDir)

  Finds all the fully qualified (ie: full package names) module classnames by recursively searching the rootDirectories

  Parameters:
    `rootDir` - The root directory to start searching from

### addClassToTree

    private void addClassToTree(java.lang.Class moduleClass)

  Method creates and returns a Module management tree. This consists of two nodes, one resposible for listing all the available modules from the module directory, and another for admin options such as list refreshing. Each node of the tree has it's own user object, for class nodes this will be ModuleClass, for method nodes ModuleMethod, and another one yet to be implemented for other options. When the user clicks on a method node the method is invoked.

### getModuleTree

    public javax.swing.JTree getModuleTree()

### addModuleToTree

    public void addModuleToTree(javax.swing.tree.DefaultMutableTreeNode newNode)

  Adds a new node to the Module subtree

  Parameters:
    `newNode` - The new node representing a new module.

### removeModuleFromTree

    public void removeModuleFromTree(javax.swing.tree.DefaultMutableTreeNode newNode)

  Removes a node from the Module subtree

  Parameters:
    `newNode` - The node to be removed.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD