org.patterncoder.pattern
Class PatternImplementer

java.lang.Object
  extended by org.patterncoder.pattern.PatternImplementer

public class PatternImplementer
extends java.lang.Object

PatternImplementer generates all sources needed for a particular pattern, and is used to add them to the BlueJ project.

PatternImplementer first of all generates the java source file for each of the components and copies them to the correct project directory.

The classes are then added to the project, and the package reloaded in order to display all associations between classes.


Constructor Summary
PatternImplementer()
          Creates a new instance of PatternImplementer
PatternImplementer(PatternSourceManager psm, BlueJHandler bjh)
          Creates a new instance of PatternImplementer
 
Method Summary
 void usePattern(java.util.HashMap<java.lang.Object,PatternClass> classes)
          The usePattern method implemets a pattern into the current BlueJ project.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternImplementer

public PatternImplementer()
Creates a new instance of PatternImplementer


PatternImplementer

public PatternImplementer(PatternSourceManager psm,
                          BlueJHandler bjh)
Creates a new instance of PatternImplementer

Parameters:
psm - PatternSourceManager used to del with the source files (.TMPL file location).
bjh - Instance of the BlueJHandler object used to deal with the BlueJ proxyobject.
reader - The FileReader object used to read the pattern files.
Method Detail

usePattern

public void usePattern(java.util.HashMap<java.lang.Object,PatternClass> classes)
                throws java.io.IOException,
                       bluej.extensions.ProjectNotOpenException,
                       bluej.extensions.PackageNotFoundException
The usePattern method implemets a pattern into the current BlueJ project. A HashMap of PatternClass objects, specify the classes that should be implemented as part of the pattern.

Parameters:
classes - a HashMap of PatternClass objects and their Object ids.
Throws:
java.io.IOException - thrown if a file cannot be opened or if the file cannot be created correctly.
bluej.extensions.ProjectNotOpenException - thrown if there is no project open.
bluej.extensions.PackageNotFoundException - thrown if there is no package found.