Example #1
0
 /**
  * Resets the current pointer collection, notifying the filters, and optionally resetting the
  * current set of filtering constraints (extents).
  *
  * @param pc new pointer collection to be displayed and presented for filtering
  * @param resetFilteringConstraints boolean flag, if true, then set all filtering constaints
  *     (extents) to match the extremes of the data in the pointer collection
  */
 public void setPointerCollection(PointerCollectionGroup pcg, boolean resetFilteringConstraints) {
   if (pcg == null) return;
   mCurrPC = pcg;
   fdm.newPointerCollection(mCurrPC);
   if (resetFilteringConstraints) {
     filterConstraintsMgr.resetFilterConstraints(
         new FilterConstraints(
             NdEditFormulas.GetPrettyRange(mCurrPC.getMinMaxLat(), -90.0, 90.0),
             NdEditFormulas.GetPrettyRange(mCurrPC.getMinMaxLon(), -180.0, 180.0),
             NdEditFormulas.GetPrettyRange(mCurrPC.getMinMaxDepth()),
             NdEditFormulas.GetPrettyRange(mCurrPC.getMinMaxTime()),
             null,
             null));
   }
 }
Example #2
0
 public void save(String filename) {
   try {
     File propFile = new File(NdEditFormulas.getSupportPath(), filename);
     FileOutputStream f = new FileOutputStream(propFile);
     internalToProperties().save(f, "ndEdit User Settings");
   } catch (Exception e) {
     String errmsg = new String("Cannot open FileOutputStream: " + filename);
     JOptionPane.showMessageDialog(null, errmsg, "ERROR", JOptionPane.ERROR_MESSAGE);
   }
 }
Example #3
0
 public void load(String filename) {
   FileInputStream f;
   try {
     File propFile = new File(NdEditFormulas.getSupportPath(), filename);
     f = new FileInputStream(propFile);
   } catch (Exception e) {
     System.out.println("Exception: " + e.toString());
     String errmsg = new String("Cannot open input stream (or load properties): " + filename);
     JOptionPane.showMessageDialog(null, errmsg, "ERROR", JOptionPane.ERROR_MESSAGE);
     return;
   }
   Properties props = new Properties();
   try {
     props.load(f);
   } catch (Exception e) {
     System.out.println("Exception: " + e.toString());
     String errmsg = new String("Cannot or load properties from file: " + filename);
     JOptionPane.showMessageDialog(null, errmsg, "ERROR", JOptionPane.ERROR_MESSAGE);
     return;
   }
   propertiesToInternal(props);
 }