|
||||||||||
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 neccessary for
repainiting specific area, for calculating bounding rectangle of
the model, and for searching for elements, containing 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 containes 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 |
setElementRenderer(DrawingElementRenderer renderer)
Sets the DrawingElementRenderer that will be used this cache.
|
void |
setModel(DrawingModel model)
Sets the DrawingModel that will be cached by this cache. |
Method Detail |
public void setModel(DrawingModel model)
DrawingModel
that will be cached by this cache.
model
- the DrawingModel
that is to be cachedpublic void setElementRenderer(DrawingElementRenderer renderer)
DrawingElementRenderer
that will be used this cache.
Renderer is user to obtain bounds of element of the model.
renderer
- the DrawingElementRenderer
that is to be usedpublic java.awt.Rectangle getModelBounds()
public java.awt.geom.Rectangle2D getModelBounds2D()
public java.lang.Object[] getElementsForRectangle(java.awt.geom.Rectangle2D rectangle)
rectangle
- area that will be repainted
public java.lang.Object[] getElementsForPoint(java.awt.geom.Point2D point)
point
- the Point2D
return elements containing given pointpublic void addDrawingModelCacheListener(DrawingModelCacheListener listener)
listener
- the DrawingModelCacheListener
public void removeDrawingModelCacheListener(DrawingModelCacheListener listener)
listener
- the DrawingModelCacheListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |