slate
Interface SlateModel

All Known Implementing Classes:
DefaultSlateModel

public abstract interface SlateModel

Model interface for managing repository of shapes. The associated listener and event types are implemented as nested interface and class of this.

Author:
Ramnivas Laddad

Inner Class Summary
static class SlateModel.Event
          Nested event class for communicating changes in the model of enclosing type SlateModel to its listeners of type SlateModel.Listener.
static interface SlateModel.Listener
          Nested interface for listening to changes in model of the enclosing type, SlateModel.
 
Method Summary
 void addShape(java.awt.Shape s)
          Add shape to the model.
 void addSlateModelListener(SlateModel.Listener l)
          Add listener interested in changes in the changes model.
 java.awt.Shape getShapeAtIndex(int index)
          Get the shape at given index
 int getShapeCount()
          Get the count of shape in the model.
 void removeAllShapes()
          Remove all the shapes from model.
 void removeShape(java.awt.Shape s)
          Remove shape from model
 void removeSlateModelListener(SlateModel.Listener l)
          Remove a previously added listener.
 

Method Detail

addSlateModelListener

public void addSlateModelListener(SlateModel.Listener l)
Add listener interested in changes in the changes model.
Parameters:
l - listener to be added.

removeSlateModelListener

public void removeSlateModelListener(SlateModel.Listener l)
Remove a previously added listener.
Parameters:
l - listener to be removed.

addShape

public void addShape(java.awt.Shape s)
Add shape to the model.
Parameters:
s - shape to be added.

removeShape

public void removeShape(java.awt.Shape s)
Remove shape from model
Parameters:
s - shape to be removed

removeAllShapes

public void removeAllShapes()
Remove all the shapes from model.

getShapeCount

public int getShapeCount()
Get the count of shape in the model.
Returns:
number of shapes currently in the model

getShapeAtIndex

public java.awt.Shape getShapeAtIndex(int index)
Get the shape at given index
Parameters:
index - index of shape sought
Returns:
shape at given index