Java Reference
In-Depth Information
combineWith
, for doing this. This method compares the minima of
this
and the
DimensionObject
given as an argument, and sets the minima to the smaller of
the values. The update of the maxima is done in an analogous way. If a graphical
object is deleted from the drawing the update of
extremalDimensions
is more dif-
ficult. If one of the values of
extremalDimensions
, say the minimal
x
-coordinate,
comes from the deleted object, then one has to find that object of the drawing
that now has minimal
x
-coordinate. We do this by re-computing the values of
ex-
tremalDimensions
from scratch. That is, we screen all graphical objects in the
drawing to determine the new extremal values. There are more efficient ways of
updating the values after a deletion but they require elaborate data structures, the
implementation of which would occult the structure of the package.
(a)
(b)
Figure 21.1 The test application
GenericDrawingDemo
. (a) In proportional mode, i.e. both
coordinate axes have the same scale - circles appear as circles. (b) In non-proportional mode,
i.e. sized to fill the panel - circles might appear as ellipses
Search WWH ::
Custom Search