Class DefaultSlateModel

java.lang.Object
  |
  +--DefaultSlateModel

public class DefaultSlateModel
extends java.lang.Object
implements SlateModel, java.io.Serializable

A simple, vector based implementation of SlateModel interface.

Author:
Ramnivas Laddad
See Also:
Serialized Form

Constructor Summary
DefaultSlateModel()
           
 
Method Summary
 void addShape(java.awt.Shape s)
          Add shape to the model.
 void addSlateModelListener(SlateModelListener 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(SlateModelListener l)
          Remove a previously added listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSlateModel

public DefaultSlateModel()
Method Detail

addSlateModelListener

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

removeSlateModelListener

public void removeSlateModelListener(SlateModelListener l)
Remove a previously added listener.
Specified by:
removeSlateModelListener in interface SlateModel
Parameters:
l - listener to be removed.

addShape

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

removeShape

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

removeAllShapes

public void removeAllShapes()
Remove all the shapes from model
Specified by:
removeAllShapes in interface SlateModel

getShapeCount

public int getShapeCount()
Get the count of shape in the model
Specified by:
getShapeCount in interface SlateModel
Returns:
number of shapes currently int the model

getShapeAtIndex

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