public int setView(int i, int ai[], int j, int k, int l, int i1, int j1, int k1)
     throws JNCSFileNotOpenException, JNCSInvalidSetViewException {
   int l1 = j;
   int i2 = k;
   int j2 = l;
   int k2 = i1;
   if (j < 0) l1 = 0;
   if (k < 0) i2 = 0;
   if (l > super.width - 1) j2 = super.width - 1;
   if (i1 > super.height - 1) k2 = super.height - 1;
   int l2 = (int) Math.round(((double) (l1 - j) / (double) (l - j)) * (double) j1);
   int i3 = (int) Math.round(((double) (i2 - k) / (double) (i1 - k)) * (double) k1);
   int j3 = (int) Math.round(((double) (j2 - j) / (double) (l - j)) * (double) j1);
   int k3 = (int) Math.round(((double) (k2 - k) / (double) (i1 - k)) * (double) k1);
   super.setView(i, ai, l1, i2, j2, k2, j3 - l2, k3 - i3);
   bHaveValidSetView = true;
   if (!super.progressive) {
     dRendererSetViewDatasetTLX = l1;
     dRendererSetViewDatasetTLY = l1;
     dRendererSetViewDatasetBRX = j2;
     dRendererSetViewDatasetBRY = k2;
     dRendererSetViewWidth = j3 - l2;
     dRendererSetViewHeight = k3 - i3;
   }
   return 0;
 }
 public int setView(int i, int ai[], double d, double d1, double d2, double d3, int j, int k)
     throws JNCSFileNotOpenException, JNCSInvalidSetViewException {
   JNCSDatasetPoint jncsdatasetpoint = convertWorldToDataset(d, d1);
   JNCSDatasetPoint jncsdatasetpoint1 = convertWorldToDataset(d2, d3);
   double d4 = d;
   double d5 = d1;
   double d6 = d2;
   double d7 = d3;
   jncsdatasetpoint.x = (int) Math.floor((d4 - super.originX) / super.cellIncrementX);
   jncsdatasetpoint.y = (int) Math.floor((d5 - super.originY) / super.cellIncrementY);
   jncsdatasetpoint1.x = (int) Math.ceil((d6 - super.originX) / super.cellIncrementX);
   jncsdatasetpoint1.y = (int) Math.ceil((d7 - super.originY) / super.cellIncrementY);
   JNCSWorldPoint jncsworldpoint = convertDatasetToWorld(jncsdatasetpoint.x, jncsdatasetpoint.y);
   JNCSWorldPoint jncsworldpoint1 =
       convertDatasetToWorld(jncsdatasetpoint1.x, jncsdatasetpoint1.y);
   d4 = jncsworldpoint.x;
   d5 = jncsworldpoint.y;
   d6 = jncsworldpoint1.x;
   d7 = jncsworldpoint1.y;
   if (jncsdatasetpoint.x < 0) d4 = super.originX;
   if (jncsdatasetpoint.y < 0) d5 = super.originY;
   if (jncsdatasetpoint1.x > super.width - 1)
     d6 = super.originX + (double) (super.width - 1) * super.cellIncrementX;
   if (jncsdatasetpoint1.y > super.height - 1)
     d7 = super.originY + (double) (super.height - 1) * super.cellIncrementY;
   if (jncsdatasetpoint.x < 0 && jncsdatasetpoint1.x < 0
       || jncsdatasetpoint.x > super.width - 1 && jncsdatasetpoint1.x > super.width - 1) {
     bHaveValidSetView = false;
     return 1;
   }
   if (jncsdatasetpoint.y < 0 && jncsdatasetpoint1.y < 0
       || jncsdatasetpoint.y > super.height - 1 && jncsdatasetpoint1.y > super.height - 1) {
     bHaveValidSetView = false;
     return 1;
   }
   int l = (int) Math.round(((d4 - d) / (d2 - d)) * (double) j);
   int i1 = (int) Math.round(((d5 - d1) / (d3 - d1)) * (double) k);
   int j1 = (int) Math.round(((d6 - d) / (d2 - d)) * (double) j);
   int k1 = (int) Math.round(((d7 - d1) / (d3 - d1)) * (double) k);
   if (j1 - l > jncsdatasetpoint1.x - jncsdatasetpoint.x) {
     j1 = jncsdatasetpoint1.x;
     l = jncsdatasetpoint.x;
   }
   if (k1 - i1 > jncsdatasetpoint1.y - jncsdatasetpoint.y) {
     k1 = jncsdatasetpoint1.y;
     i1 = jncsdatasetpoint.y;
   }
   if (j1 - l < 1 || k1 - i1 < 1) {
     bHaveValidSetView = false;
     return 1;
   }
   super.setView(i, ai, d4, d5, d6, d7, j1 - l, k1 - i1);
   bHaveValidSetView = true;
   if (!super.progressive) {
     dRendererSetViewWorldTLX = d4;
     dRendererSetViewWorldTLY = d5;
     dRendererSetViewWorldBRX = d6;
     dRendererSetViewWorldBRY = d7;
     dRendererSetViewWidth = j1 - l;
     dRendererSetViewHeight = k1 - i1;
   }
   return 0;
 }