The Source for Java Technology Collaboration


Drawing Model Cache

Drawing model model cache is an object than incapsulates optimization algorithms. It allows one to perform the following operations effectively:

  • find all drawing elements? affecting a given point
  • find all drawing elements? affecting a given rectangle
  • compute the bounding box for the whole image

Drawing model cache implementes the interface DrawingModelCache that contains the following methods:

Object[] getElementsForPoint (Point2D point)
Object[] getElementsForRectangle (Rectangle2D rectangle)
Rectangle getModelBounds ()
Rectangle2D getModelBounds2D ()

In the process of execution of these methods all the required information is retrieved from the drawing model and the drawing element renderer? objects. To increase performance, some information may be cached inside the data model cache.

Upon receiving a notification about changes inside the drawing model, the data model cache calculates the boundary of the region to be redrawn, updates cached information and sends an appropriate signal to the control?.

Topic DrawingModelCache . { Edit | Ref-By | Printable | Diffs r1 | More }
 XML java.net RSS

Revision r1 - 14 Sep 2004 - 07:20:00 - Main.mvladimirov
Parents: WebHome > JDrawing > DrawingModel