|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jdrawing.AbstractDrawingModelCache
This abstract class provides default implementations for most of
the methods in the DrawingModelCache
interface. It takes
care of the management of listeners and provides some conveniences
for generating DrawingModelCacheEvents
and dispatching them
to the listeners. Also it provides some default handling of drawing
model events.
Constructor Summary | |
AbstractDrawingModelCache()
|
Method Summary | |
void |
addDrawingModelCacheListener(DrawingModelCacheListener listener)
Adds a listener which will be notified about changes in this model cache. |
void |
elementsAdded(DrawingModelEvent event)
Invoked after elements have been inserted into the model. |
void |
elementsChanged(DrawingModelEvent event)
Invoked after elements have been changed in some way. |
void |
elementsRemoved(DrawingModelEvent event)
Invoked after elements have been removed from the model. |
protected void |
fireAreaChanged(java.awt.Rectangle area)
Notifies all listeners that the area has changed in some way. |
protected void |
fireDrawingChanged()
Notifies all listeners that the drawing has changed in some way. |
DrawingModelCacheListener[] |
getDrawingModelCacheListeners()
Returns an array of all the drawing model cache listeners registered on this model cache. |
DrawingModel |
getModel()
Returns the DrawingModel that is cached by this cache. |
java.awt.Rectangle |
getModelBounds()
Returns the bounding box of all elements of the model. |
DrawingRenderer |
getRenderer()
Returns the DrawingRenderer that is used by this cache. |
void |
modelChanged(DrawingModelEvent event)
Invoked after the model has drastically changed in some way. |
void |
removeDrawingModelCacheListener(DrawingModelCacheListener listener)
Removes a listener from the list that is notified about changes in this model cache. |
void |
setModel(DrawingModel model)
Sets the DrawingModel that will be cached by this cache. |
void |
setRenderer(DrawingRenderer renderer)
Sets the DrawingRenderer that will be used in this cache.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jdrawing.DrawingModelCache |
getElementsForPoint, getElementsForRectangle, getModelBounds2D |
Constructor Detail |
public AbstractDrawingModelCache()
Method Detail |
public void setModel(DrawingModel model)
DrawingModelCache
DrawingModel
that will be cached by this cache.
setModel
in interface DrawingModelCache
model
- the DrawingModel
that is to be cachedpublic DrawingModel getModel()
DrawingModel
that is cached by this cache.
DrawingModel
that is cached by this cachepublic void setRenderer(DrawingRenderer renderer)
DrawingModelCache
DrawingRenderer
that will be used in this cache.
Renderer is used to obtain the bounds of an element of the model.
setRenderer
in interface DrawingModelCache
renderer
- the DrawingRenderer
that is to be usedpublic DrawingRenderer getRenderer()
DrawingRenderer
that is used by this cache.
DrawingRenderer
that is used by this cachepublic java.awt.Rectangle getModelBounds()
DrawingModelCache
getModelBounds
in interface DrawingModelCache
public void addDrawingModelCacheListener(DrawingModelCacheListener listener)
DrawingModelCache
addDrawingModelCacheListener
in interface DrawingModelCache
listener
- the DrawingModelCacheListener
public void removeDrawingModelCacheListener(DrawingModelCacheListener listener)
DrawingModelCache
removeDrawingModelCacheListener
in interface DrawingModelCache
listener
- the DrawingModelCacheListener
public DrawingModelCacheListener[] getDrawingModelCacheListeners()
DrawingModelCacheListener
s
or an empty array if no drawing model cache listeners are
currently registeredprotected void fireAreaChanged(java.awt.Rectangle area)
area
- rectangular bounds of the changed areaprotected void fireDrawingChanged()
public void elementsAdded(DrawingModelEvent event)
elementsAdded
in interface DrawingModelListener
event
- DrawingModelEvent object encapsulating event
informationpublic void elementsRemoved(DrawingModelEvent event)
elementsRemoved
in interface DrawingModelListener
event
- DrawingModelEvent object encapsulating event
informationpublic void elementsChanged(DrawingModelEvent event)
elementsChanged
in interface DrawingModelListener
event
- DrawingModelEvent object encapsulating event
informationpublic void modelChanged(DrawingModelEvent event)
modelChanged
in interface DrawingModelListener
event
- DrawingModelEvent object encapsulating event
information
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |