|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.sketch.SketchModel
public class SketchModel
A SketchModel stores sketched symbols. Symbols can either be individual strokes or groups of strokes, represented by StrokeSymbol and CompositeSymbol, respectively. When the model changes (symbols have been added, removed, or modified), it generates SketchEvents to notify its listeners that a change has occured.
Constructor Summary | |
---|---|
SketchModel()
Create a SketchModel with no symbols. |
Method Summary | |
---|---|
void |
addSketchListener(SketchListener l)
Add the given SketchListener to the set of listeners. |
void |
addSymbol(int index,
Symbol s)
Insert a symbol into the model at the given position (Z order). |
void |
addSymbol(Symbol s)
Add the given symbol to the model. |
int |
getSymbolCount()
Return the number of symbols in this model. |
int |
indexOf(Symbol s)
Return the index of the given symbol, or -1 if the symbol is not contained by the model. |
void |
removeSketchListener(SketchListener l)
Remove the specified SketchListener from the set of listeners. |
void |
removeSymbol(Symbol s)
Remove the specified symbol from the model. |
Iterator |
symbols()
Return an iterator over the symbols in the model. |
void |
updateSymbol(Symbol s)
Provide the means for a client to notify the listeners that the specified symbol has been updated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SketchModel()
Method Detail |
---|
public void addSketchListener(SketchListener l)
public void addSymbol(Symbol s)
public void addSymbol(int index, Symbol s)
Clients should assume that an implementation of this method does not check if the symbol is already contained -- clients are therefore responsible for being bug-free.
public int getSymbolCount()
public int indexOf(Symbol s)
public void removeSketchListener(SketchListener l)
public void removeSymbol(Symbol s)
public Iterator symbols()
public void updateSymbol(Symbol s)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |