Changeset 2499


Ignore:
Timestamp:
03/22/07 12:43:44 (13 years ago)
Author:
curtis
Message:

Use Bio-Formats Status events instead of Task events.

Location:
trunk/loci/visbio
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/visbio/data/DataManager.java

    r1989 r2499  
    3232import java.util.zip.ZipInputStream; 
    3333import javax.swing.tree.DefaultMutableTreeNode; 
    34 import loci.formats.FilePattern; 
     34import loci.formats.*; 
    3535import loci.visbio.*; 
    3636import loci.visbio.help.HelpManager; 
     
    290290    task.setStoppable(false); 
    291291    task.setStatus("Creating dataset"); 
    292     TaskListener tl = new TaskListener() { 
    293       public void taskUpdated(TaskEvent e) { 
     292    StatusListener sl = new StatusListener() { 
     293      public void statusUpdated(StatusEvent e) { 
    294294        int val = e.getProgressValue(); 
    295295        int max = e.getProgressMaximum(); 
     
    299299    }; 
    300300    Dataset dataset = new Dataset(name, pattern, 
    301       ids, lengths, dims, width, height, step, tl); 
     301      ids, lengths, dims, width, height, step, sl); 
    302302    task.setCompleted(); 
    303303    addData(dataset); 
  • trunk/loci/visbio/data/Dataset.java

    r2365 r2499  
    3434import loci.formats.*; 
    3535import loci.formats.ome.OMEXMLMetadataStore; 
    36 import loci.visbio.TaskEvent; 
    37 import loci.visbio.TaskListener; 
    3836import loci.visbio.state.Dynamic; 
    3937import loci.visbio.state.SaveException; 
     
    7775 
    7876  /** Optional listener for constructor progress. */ 
    79   protected TaskListener listener; 
     77  protected StatusListener listener; 
    8078 
    8179  // -- Computed fields -- 
     
    170168  public Dataset(String name, String pattern, String[] ids, 
    171169    int[] lengths, String[] dims, float width, float height, float step, 
    172     TaskListener listener) 
     170    StatusListener listener) 
    173171  { 
    174172    super(null, name, width, height, step); 
     
    643641  private void status(int current, int max, String message) { 
    644642    if (listener == null) return; 
    645     listener.taskUpdated(new TaskEvent(current, max, message)); 
     643    listener.statusUpdated(new StatusEvent(current, max, message)); 
    646644  } 
    647645 
  • trunk/loci/visbio/ome/ImageUploader.java

    r2446 r2499  
    2525 
    2626import java.util.*; 
     27import loci.formats.StatusEvent; 
     28import loci.formats.StatusListener; 
    2729import loci.formats.ome.OMEUploader; 
    2830import loci.formats.ome.UploadException; 
    29 import loci.visbio.*; 
    3031 
    3132/** 
     
    6061    } 
    6162    catch (UploadException exc) { 
    62       notifyListeners(new TaskEvent(1, 1, 
     63      notifyListeners(new StatusEvent(1, 1, 
    6364        "Error uploading (see error console for details)")); 
    6465      exc.printStackTrace(); 
     
    6768 
    6869  /** Adds an upload task listener. */ 
    69   public void addTaskListener(TaskListener l) { 
     70  public void addStatusListener(StatusListener l) { 
    7071    synchronized (listeners) { listeners.addElement(l); } 
    7172  } 
    7273 
    7374  /** Removes an upload task listener. */ 
    74   public void removeTaskListener(TaskListener l) { 
     75  public void removeStatusListener(StatusListener l) { 
    7576    synchronized (listeners) { listeners.removeElement(l); } 
    7677  } 
    7778 
    7879  /** Removes all upload task listeners. */ 
    79   public void removeAllTaskListeners() { 
     80  public void removeAllStatusListeners() { 
    8081    synchronized (listeners) { listeners.removeAllElements(); } 
    8182  } 
    8283 
    8384  /** Notifies listeners of an upload task update. */ 
    84   protected void notifyListeners(TaskEvent e) { 
     85  protected void notifyListeners(StatusEvent e) { 
    8586    synchronized (listeners) { 
    8687      for (int i=0; i<listeners.size(); i++) { 
    87         TaskListener l = (TaskListener) listeners.elementAt(i); 
    88         l.taskUpdated(e); 
     88        StatusListener l = (StatusListener) listeners.elementAt(i); 
     89        l.statusUpdated(e); 
    8990      } 
    9091    } 
  • trunk/loci/visbio/ome/OMEManager.java

    r2146 r2499  
    2626import java.awt.Component; 
    2727import javax.swing.JOptionPane; 
     28import loci.formats.StatusEvent; 
     29import loci.formats.StatusListener; 
    2830import loci.visbio.*; 
    2931import loci.visbio.data.*; 
     
    9294    TaskManager tm = (TaskManager) bio.getManager(TaskManager.class); 
    9395    final BioTask task = tm.createTask("Upload " + dt.getName() + " to OME"); 
    94     uploader.addTaskListener(new TaskListener() { 
    95       public void taskUpdated(TaskEvent e) { 
     96    uploader.addStatusListener(new StatusListener() { 
     97      public void statusUpdated(StatusEvent e) { 
    9698        // update task with latest database communication status 
    9799        int value = e.getProgressValue(); 
Note: See TracChangeset for help on using the changeset viewer.