|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
org.patterncoder.pattern.PatternModel
public class PatternModel
The PatternModel class is used to represent the data that is being used to display information to the user. All data used in the Graphical user interface is stored within this model structure, allowing for a clear seperation of control and data.
model in the Model View Controllor architecture.
PatternModel extends the Observable class from the java.util library, and allows all objects with the code to registar an interest in any changes being made to the model.
Constructor Summary | |
---|---|
PatternModel()
Class constructor. |
|
PatternModel(PatternSourceManager edh,
PatternFileReader pfr)
Class Constructor specifying what PatternSourceManager and PatternFileReader objects to use. |
Method Summary | |
---|---|
java.util.HashMap<java.lang.Object,PatternClass> |
getComponents()
Returns a hash map containing the PatternClass objects for a pattern as created from the pattern source file. |
java.lang.String |
getCurrentPatternName()
Returns the name of the pattern that is currently selected and is populating the model. |
java.io.File |
getCurrentSourceFile()
Returns the source file of the pattern currently being displayed. |
java.lang.String |
getDescription()
Returns the currently selected patterns decription |
java.lang.String |
getImage()
Returns the pattern image of the current pattern. |
PatternClass |
getPatternComp(java.lang.Object id)
Returns the PatternClass object that is represented in the model by the supplied Object identifier. |
java.util.List<java.lang.String> |
getPatterns()
Returns the array of currently loaded patterns |
void |
populateModel()
Populates the model used to display information. |
void |
setComponents()
Creates a list of components of type PatternClass. |
void |
setCurrentPattern(java.lang.String curPattern,
int index)
Is called passing details of the currently selected pattern Changes currently selected pattern variables accordingly. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PatternModel() throws PatternCoderException
patext.BlueDPException
PatternCoderException
public PatternModel(PatternSourceManager edh, PatternFileReader pfr)
edh
- the PatternSourceManager to use when locating files.pfr
- the PatternFileReader to use when reading files.Method Detail |
---|
public void populateModel() throws java.io.FileNotFoundException, java.lang.Exception
java.lang.Exception
- thrown if a general exception occurs.
java.io.FileNotFoundException
- thrown if the file used to populate creates a problem.public java.util.List<java.lang.String> getPatterns()
public java.io.File getCurrentSourceFile()
public java.lang.String getDescription()
public java.lang.String getImage()
public void setCurrentPattern(java.lang.String curPattern, int index)
curPattern
- The pattern currently selected by the userindex
- The index of the pattern in the ComboBoxpublic void setComponents()
PatternClass
public java.util.HashMap<java.lang.Object,PatternClass> getComponents()
PatternClass
public PatternClass getPatternComp(java.lang.Object id)
id
- the Object id of the component.
public java.lang.String getCurrentPatternName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |