|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jdrawing.AbstractDrawingModel
This abstract class provides default implementations for most of
the methods in the DrawingModel
interface. It takes
care of the management of listeners and provides some conveniences
for generating DrawingModelEvents
and dispatching them
to the listeners
Constructor Summary | |
AbstractDrawingModel()
|
Method Summary | |
void |
addDrawingModelListener(DrawingModelListener listener)
Adds a listener which will be notified about changes in this model. |
protected void |
fireElementsAdded(java.lang.Object[] elements)
Notifies all listeners that elements have been inserted. |
protected void |
fireElementsChanged(java.lang.Object[] elements)
Notifies all listeners that elements have been changed. |
protected void |
fireElementsRemoved(java.lang.Object[] elements)
Notifies all listeners that elements have been removed. |
protected void |
fireModelChanged()
Notifies all listeners that the model has changed. |
DrawingModelListener[] |
getDrawingModelListeners()
Returns an array of all the drawing model listeners registered on this model. |
void |
removeDrawingModelListener(DrawingModelListener listener)
Removes a listener from the list that is notified about changes in this model. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jdrawing.DrawingModel |
elements, sortElements |
Constructor Detail |
public AbstractDrawingModel()
Method Detail |
public void addDrawingModelListener(DrawingModelListener listener)
addDrawingModelListener
in interface DrawingModel
listener
- the DrawingModelListener
public void removeDrawingModelListener(DrawingModelListener listener)
removeDrawingModelListener
in interface DrawingModel
listener
- the DrawingModelListener
public DrawingModelListener[] getDrawingModelListeners()
DrawingModelListener
s
or an empty array if no drawing model listeners are
currently registeredprotected void fireElementsAdded(java.lang.Object[] elements)
elements
- an array of Object containing inserted elementsprotected void fireElementsRemoved(java.lang.Object[] elements)
elements
- an array of Object containing removed elementsprotected void fireElementsChanged(java.lang.Object[] elements)
elements
- an array of Object containing changed elementsprotected void fireModelChanged()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |