ui/src/main/java/ucar/nc2/ui/grid/ContourFeature.java
public java.awt.geom.Rectangle2D getBounds2D() {
    // Get the bounding box for this feature. from java.awt.geom.Rectangle2D
    double x0 = (((ContourLine) (lines.get(0))).getX())[0];
    double y0 = (((ContourLine) (lines.get(0))).getY())[0];
    double xMaxInd = x0, xmin = x0, yMaxInd = y0, ymin = y0;

    for (int i = 0; i < lines.size(); i++) {
      GisPart cline = (ContourLine) (lines.get(i));
      double[] xpts = cline.getX();
      double[] ypts = cline.getY();
      for (int j = 0; j < cline.getNumPoints(); j++) {
        if (xpts[j] < xmin)
          xmin = xpts[j];
        else if (xpts[j] > xMaxInd)
          xMaxInd = xpts[j];
        if (ypts[j] < ymin)
          ymin = ypts[j];
        else if (ypts[j] > yMaxInd)
          yMaxInd = ypts[j];
      }
    }

    // Rectangle2D.Double(double x, double y, double width, double height)
    Rectangle2D.Double rect =
            new Rectangle2D.Double(xmin, ymin, xMaxInd - xmin, yMaxInd - ymin);
    return rect;
  }
public java.awt.geom.Rectangle2D getBounds2D() {
    // Get the bounding box for this feature. from java.awt.geom.Rectangle2D
    double x0 = (((ContourLine) (lines.get(0))).getX())[0];
    double y0 = (((ContourLine) (lines.get(0))).getY())[0];
    double xMaxInd = x0, xmin = x0, yMaxInd = y0, ymin = y0;

    for (int i = 0; i < lines.size(); i++) {
      GisPart cline = (ContourLine) (lines.get(i));
      double[] xpts = cline.getX();
      double[] ypts = cline.getY();
      for (int j = 0; j < cline.getNumPoints(); j++) {
        if (xpts[j] < xmin)
          xmin = xpts[j];
        else if (xpts[j] > xMaxInd)
          xMaxInd = xpts[j];
        if (ypts[j] < ymin)
          ymin = ypts[j];
        else if (ypts[j] > yMaxInd)
          yMaxInd = ypts[j];
      }
    }

    // Rectangle2D.Double(double x, double y, double width, double height)
    Rectangle2D.Double rect =
            new Rectangle2D.Double(xmin, ymin, xMaxInd - xmin, yMaxInd - ymin);
    return rect;
  }
public java . awt . geom . Rectangle2D getBounds2D ( ) { // Get the bounding box for this feature. from java.awt.geom.Rectangle2D double x0 = ( ( ( ContourLine ) ( lines . get ( 0 ) ) ) . getX ( ) ) [ 0 ] ; double y0 = ( ( ( ContourLine ) ( lines . get ( 0 ) ) ) . getY ( ) ) [ 0 ] ; double xMaxInd = x0 , xmin = x0 , yMaxInd = y0 , ymin = y0 ; for ( int i = 0 ; i < lines . size ( ) ; i ++ ) { GisPart cline = ( ContourLine ) ( lines . get ( i ) ) ; double [ ] xpts = cline . getX ( ) ; double [ ] ypts = cline . getY ( ) ; for ( int j = 0 ; j < cline . getNumPoints ( ) ; j ++ ) { if ( xpts [ j ] < xmin ) xmin = xpts [ j ] ; else if ( xpts [ j ] > xMaxInd ) xMaxInd = xpts [ j ] ; if ( ypts [ j ] < ymin ) ymin = ypts [ j ] ; else if ( ypts [ j ] > yMaxInd ) yMaxInd = ypts [ j ] ; } } // Rectangle2D.Double(double x, double y, double width, double height) Rectangle2D . Double rect = new Rectangle2D . Double ( xmin , ymin , xMaxInd - xmin , yMaxInd - ymin ) ; return rect ; }
implement GisFeature methods:
implement GisFeature methods :