Changeset 5139


Ignore:
Timestamp:
05/29/09 17:49:57 (11 years ago)
Author:
curtis
Message:

More bugfixes. Getting better, but still not thoroughly tested.

Location:
trunk/components/loci-plugins/src/loci/plugins
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/loci-plugins/src/loci/plugins/Colorizer.java

    r5138 r5139  
    235235        ImporterOptions options = null; 
    236236        try { 
    237           // CTR TODO - should not depend anything in importer package 
     237          // TODO: remove dependency on importer package 
    238238          options = new ImporterOptions(); 
    239239        } 
     
    241241          WindowTools.reportException(exc); 
    242242        } 
    243  
    244         boolean spectral = 
    245           stack.getSliceLabel(1).indexOf(FormatTools.SPECTRA) != -1; 
    246243 
    247244        if (mergeOption == null) { 
  • trunk/components/loci-plugins/src/loci/plugins/config/ConfigWindow.java

    r5138 r5139  
    161161    libInfo.add(version); 
    162162 
    163     // TODO - install/upgrade button, if applicable 
     163    // TODO: install/upgrade button, if applicable 
    164164    // - can upgrade any JAR from LOCI repository 
    165165    //   + upgrade button for "ImageJ" just launches ImageJ upgrade plugin 
     
    188188    libInfo.add(new JScrollPane(notes)); 
    189189 
    190     // TODO - "How to install" for each library? 
     190    // TODO: "How to install" for each library? 
    191191 
    192192    JPanel upgradePanel = new JPanel(); 
     
    196196 
    197197    JLabel upgradeLabel = 
    198       new JLabel("Automatically check for a new versions of the LOCI plugins"); 
     198      new JLabel("Automatically check for new versions of the LOCI plugins"); 
    199199    upgradePanel.add(upgradeLabel); 
    200200 
    201201    try { 
    202       // CTR TODO - should not depend anything in importer package 
     202      // TODO: remove dependency on importer package 
    203203      options = new ImporterOptions(); 
    204204    } 
     
    244244  public void itemStateChanged(ItemEvent e) { 
    245245    Object src = e.getSource(); 
    246     // CTR TODO NOW 
    247     /* 
     246 
    248247    if (src == upgradeBox) { 
    249248      options.setUpgradeCheck(upgradeBox.isSelected()); 
    250       Prefs.set(ImporterOptions.PREF_UPGRADE, upgradeBox.isSelected()); 
     249      options.saveOptions(); 
    251250      return; 
    252251    } 
    253     */ 
    254252 
    255253    Object value = formatsList.getSelectedValue(); 
  • trunk/components/loci-plugins/src/loci/plugins/config/InstallWizard.java

    r5133 r5139  
    138138    long installed = file.lastModified(); 
    139139    if (installed < latest) { 
    140       // TODO 
     140      // TODO: prompt user to upgrade 
    141141    } 
    142142  } 
  • trunk/components/loci-plugins/src/loci/plugins/importer/IdDialog.java

    r5138 r5139  
    7575          "native file chooser\nthat crashes ImageJ if you click on a file " + 
    7676          "in CXD, IPW, OIB or ZVI format while in\ncolumn view mode. You " + 
    77           "can work around the problem in one of two ways:\n" + 
    78           "  1. Switch to list view (press Command+2)\n" + 
    79           "  2. Check \"Use JFileChooser to Open/Save\" under " + 
     77          "can work around the problem in one of two ways:\n \n" + 
     78          "    1. Switch to list view (press Command+2)\n" + 
     79          "    2. Check \"Use JFileChooser to Open/Save\" under " + 
    8080          "Edit>Options>Input/Output..."); 
    8181      } 
     
    146146    String id = options.getId(); 
    147147    if (id == null) { 
    148       // CTR TODO -- eliminate this kludge 
     148      // TODO: eliminate OMEPlugin kludge 
    149149      IJ.runPlugIn("loci.plugins.ome.OMEPlugin", ""); 
    150150      return STATUS_FINISHED; 
  • trunk/components/loci-plugins/src/loci/plugins/importer/Importer.java

    r5138 r5139  
    4646import java.util.Enumeration; 
    4747import java.util.Hashtable; 
     48import java.util.StringTokenizer; 
    4849import java.util.Vector; 
    4950 
     
    6869import loci.plugins.Colorizer; 
    6970import loci.plugins.LociImporter; 
    70 import loci.plugins.Updater; 
    7171import loci.plugins.prefs.OptionsDialog; 
    7272import loci.plugins.util.BFVirtualStack; 
     
    132132    // -- Step 1: check if new version is available -- 
    133133 
     134    debug("check if new version is available"); 
     135 
    134136    UpgradeDialog upgradeDialog = new UpgradeDialog(options); 
    135137    int status = upgradeDialog.showDialog(); 
    136138    if (!statusOk(status)) return; 
    137139 
    138     if (options.doUpgradeCheck()) { 
    139       debug("check if new version is available"); 
    140       IJ.showStatus("Checking for new version..."); 
    141       if (Updater.newVersionAvailable()) { 
    142         boolean doUpgrade = IJ.showMessageWithCancel("", 
    143           "A new stable version of Bio-Formats is available.\n" + 
    144           "Click 'OK' to upgrade."); 
    145         if (doUpgrade) { 
    146           Updater.install(Updater.STABLE_BUILD); 
    147         } 
    148       } 
    149     } 
    150     else debug("skipping new version check"); 
    151  
    152140    // -- Step 2: construct reader and check id -- 
    153141 
     
    165153    boolean quiet = options.isQuiet(); 
    166154 
    167     String location = options.getLocation(); 
    168155    Location idLoc = null; 
    169156    String idName = id; 
    170     if (ImporterOptions.LOCATION_LOCAL.equals(location)) { 
     157    if (options.isLocal()) { 
    171158      idLoc = new Location(id); 
    172159      idName = idLoc.getName(); 
     160    } 
     161    else if (options.isOME() || options.isOMERO()) { 
     162      // NB: strip out username and password when opening from OME/OMERO 
     163      StringTokenizer st = new StringTokenizer(id, "?&"); 
     164      StringBuffer idBuf = new StringBuffer(); 
     165      int tokenCount = 0; 
     166      while (st.hasMoreTokens()) { 
     167        String token = st.nextToken(); 
     168        if (token.startsWith("username=") || token.startsWith("password=")) { 
     169          continue; 
     170        } 
     171        if (tokenCount == 1) idBuf.append("?"); 
     172        else if (tokenCount > 1) idBuf.append("&"); 
     173        idBuf.append(token); 
     174        tokenCount++; 
     175      } 
     176      idName = idBuf.toString(); 
    173177    } 
    174178 
     
    248252 
    249253    // save options as new defaults 
     254    if (!quiet) options.setFirstTime(false); 
    250255    options.saveOptions(); 
    251256 
     
    254259    debug("analyze and read from data source"); 
    255260 
    256     // 'id' contains the user's password if we are opening from OME/OMERO 
    257     String a = id; 
    258     if (options.isOME() || options.isOMERO()) a = "..."; 
    259     IJ.showStatus("Analyzing " + a); 
     261    IJ.showStatus("Analyzing " + idName); 
    260262 
    261263    try { 
     
    453455        Hashtable meta = r.getMetadata(); 
    454456        //if (seriesCount == 1) meta = r.getMetadata(); 
    455         meta.put(location, currentFile); 
     457        meta.put(options.getLocation(), currentFile); 
    456458        int digits = digits(seriesCount); 
    457459        for (int i=0; i<seriesCount; i++) { 
     
    887889        //ru.setVar("pattern", pattern); 
    888890        ru.exec("dataset = new Dataset(name, pattern)"); 
    889         // CTR TODO finish VisBio logic 
     891        // TODO: finish VisBio logic 
    890892      } 
    891893      catch (ReflectException exc) { 
  • trunk/components/loci-plugins/src/loci/plugins/importer/SeriesDialog.java

    r5138 r5139  
    196196    if (options.isConcatenate()) { 
    197197      // toggle on compatible series 
    198       // CTR TODO -- why are we doing this? 
     198      // TODO: why are we doing this? 
    199199      for (int i=0; i<seriesCount; i++) { 
    200200        if (series[i]) continue; 
  • trunk/components/loci-plugins/src/loci/plugins/importer/SwapDialog.java

    r5138 r5139  
    9898      if (z.equals(t) || z.equals(c) || c.equals(t)) { 
    9999        IJ.error("Invalid swapping options - each axis can be used only once."); 
    100         return showDialog(); // CTR: TODO: fix bad recursion 
     100        return showDialog(); // TODO: fix bad recursion 
    101101      } 
    102102 
  • trunk/components/loci-plugins/src/loci/plugins/importer/UpgradeDialog.java

    r5138 r5139  
    2626package loci.plugins.importer; 
    2727 
     28import ij.IJ; 
    2829import ij.gui.GenericDialog; 
     30import loci.plugins.Updater; 
    2931import loci.plugins.prefs.OptionsDialog; 
    3032 
     
    5456 
    5557  /** 
    56    * Asks user whether Bio-Formats should automatically check for upgrades. 
     58   * Asks user whether Bio-Formats should automatically check for upgrades, 
     59   * and if so, checks for an upgrade and prompts user to install it. 
    5760   * 
    5861   * @return status of operation 
    5962   */ 
    6063  public int showDialog() { 
    61     if (options.isFirstTime() && !options.isQuiet()) { 
     64    if (options.isQuiet()) return STATUS_OK; 
     65 
     66    if (options.isFirstTime()) { 
    6267      // present user with one-time dialog box 
    63       GenericDialog gd = new GenericDialog("Check for Upgrades"); 
     68      GenericDialog gd = new GenericDialog("Bio-Formats Upgrade Checker"); 
    6469      gd.addMessage("One-time notice: The LOCI plugins for ImageJ can " + 
    6570        "automatically check for upgrades\neach time they are run. If you " + 
     
    7176      if (gd.wasCanceled()) return STATUS_CANCELED; 
    7277    } 
     78 
     79    if (options.doUpgradeCheck()) { 
     80      IJ.showStatus("Checking for new version..."); 
     81      if (Updater.newVersionAvailable()) { 
     82        boolean doUpgrade = IJ.showMessageWithCancel("", 
     83          "A new stable version of Bio-Formats is available.\n" + 
     84          "Click 'OK' to upgrade now, or 'Cancel' to skip for now."); 
     85        if (doUpgrade) Updater.install(Updater.STABLE_BUILD); 
     86      } 
     87    } 
     88 
    7389    return STATUS_OK; 
    7490  } 
  • trunk/components/loci-plugins/src/loci/plugins/prefs/BooleanOption.java

    r5133 r5139  
    5353  public BooleanOption(HashMap<String, String> entry) { 
    5454    this(entry.get(INI_KEY), 
    55       "true".equals(entry.get(INI_SAVE)), 
     55      !"false".equals(entry.get(INI_SAVE)), // default behavior is saved 
    5656      entry.get(INI_LABEL), 
    5757      entry.get(INI_INFO), 
    58       "true".equals(entry.get(INI_DEFAULT))); 
     58      "true".equals(entry.get(INI_DEFAULT))); // default value is false 
    5959  } 
    6060 
  • trunk/components/loci-plugins/src/loci/plugins/prefs/StringOption.java

    r5136 r5139  
    7373  public StringOption(HashMap<String, String> entry) { 
    7474    this(entry.get(INI_KEY), 
    75       "true".equals(entry.get(INI_SAVE)), 
     75      !"false".equals(entry.get(INI_SAVE)), // default behavior is saved 
    7676      entry.get(INI_LABEL), 
    7777      entry.get(INI_INFO), 
  • trunk/components/loci-plugins/src/loci/plugins/util/ROIHandler.java

    r5138 r5139  
    235235    int roiNum, int shape) 
    236236  { 
    237     // TODO - storeOval 
     237    // TODO: storeOval 
    238238  } 
    239239 
Note: See TracChangeset for help on using the changeset viewer.