Logo Search packages:      
Sourcecode: wims version File versions  Download package

double [] edu::hws::jcm::draw::CoordinateRect::zoomOut (  )  [inline]

Change limits to zoom out by a factor of 2. A maximal zoom is enforced. The center of the rectangle does not move.

an array of the new limits, or null if limits don't change.

Definition at line 528 of file CoordinateRect.java.

References badData(), getLimits(), and setLimits().

Referenced by edu::hws::jcm::draw::LimitControlPanel::actionPerformed().

      if (badData())
         return getLimits();
      double halfwidth = (xmax - xmin);
      double halfheight = (ymax - ymin);
      double centerx = (xmin + xmax)/2.0;
      double centery = (ymin + ymax)/2.0;
      if (Math.abs(halfwidth) > 1e100 || Math.abs(halfheight) > 1e100)
         return null;
      setLimits(centerx - halfwidth, centerx + halfwidth, centery - halfheight, centery + halfheight);
      return getLimits();

Generated by  Doxygen 1.6.0   Back to index