|
||||||||||
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.
model
- the DrawingModel
that is to be cachedpublic void setRenderer(DrawingRenderer renderer)
DrawingRenderer
that will be used in this cache.
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()
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 |