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

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

Change limits to zoom in 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 509 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)/4.0;
      double halfheight = (ymax - ymin)/4.0;
      double centerx = (xmin + xmax)/2.0;
      double centery = (ymin + ymax)/2.0;
      if (Math.abs(halfheight) < 1e-100 || Math.abs(halfwidth) < 1e-100)
           return null;
      setLimits(centerx - halfwidth, centerx + halfwidth, centery - halfheight, centery + halfheight);
      return getLimits();

Generated by  Doxygen 1.6.0   Back to index