|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
The interface that defines a model cache for JDrawing.
The model cache is responsible for selecting elements necessary for
repainting a specific area, calculating a bounding rectangle of the
model, and searching for elements containing a given point.
DrawingModel,
DrawingElementRenderer| Method Summary | |
void |
addDrawingModelCacheListener(DrawingModelCacheListener listener)
Adds a listener which will be notified about changes in this model cache. |
java.lang.Object[] |
getElementsForPoint(java.awt.geom.Point2D point)
Returns elements which contain a given point. |
java.lang.Object[] |
getElementsForRectangle(java.awt.geom.Rectangle2D rectangle)
Returns elements neccessary for repainting given area. |
java.awt.Rectangle |
getModelBounds()
Returns the bounding box of all elements of the model. |
java.awt.geom.Rectangle2D |
getModelBounds2D()
Returns the high precision bounding box of all elements of the model. |
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.
|
| Method Detail |
public void setModel(DrawingModel model)
DrawingModel that will be cached by this cache.
If model is null, then set this DrawingModelCache
to do not cache any DrawingModel.
model - the DrawingModel that is to be cached or
nullpublic void setRenderer(DrawingRenderer renderer)
DrawingRenderer that will be used in this cache.
If renderer is null, then set this DrawingModelCache
to do not use any DrawingRenderer.
Renderer is used to obtain the bounds of an element of the model.
renderer - the DrawingRenderer that is to be usedpublic java.awt.Rectangle getModelBounds()
java.lang.IllegalStateException - if either drawing model, or drawing
renderer is not setpublic java.awt.geom.Rectangle2D getModelBounds2D()
java.lang.IllegalStateException - if either drawing model, or drawing
renderer is not setpublic java.lang.Object[] getElementsForRectangle(java.awt.geom.Rectangle2D rectangle)
rectangle - area that will be repainted
java.lang.IllegalStateException - if either drawing model, or drawing
renderer is not setpublic java.lang.Object[] getElementsForPoint(java.awt.geom.Point2D point)
point - the Point2D
return elements containing given point
java.lang.IllegalStateException - if either drawing model, or drawing
renderer is not setpublic void addDrawingModelCacheListener(DrawingModelCacheListener listener)
listener - the DrawingModelCacheListener
java.lang.IllegalArgumentException - if listener is nullpublic void removeDrawingModelCacheListener(DrawingModelCacheListener listener)
null
then this method does nothing.
listener - the DrawingModelCacheListener
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||