• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.server
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Change
  • Next Change →

Changeset 1471 for branches/3.0-Beta1

Show
Ignore:
Timestamp:
04/25/07 16:06:59 (19 months ago)
Author:
TheBrain
Message:

Changes to the import to support 1.6 java and support 2gb+ file imports.

Location:
branches/3.0-Beta1/components/bioformats-omero/src/ome/formats
Files:
1 added
9 modified

  • OMEROMetadataStore.java (modified) (25 diffs)
  • importer/CommentMessenger.java (modified) (2 diffs)
  • importer/FileQueueHandler.java (modified) (1 diff)
  • importer/ImportDialog.java (modified) (1 diff)
  • importer/ImportHandler.java (modified) (7 diffs)
  • importer/LoginFrame.java (added)
  • importer/Main.java (modified) (2 diffs)
  • importer/SplashWindow.java (modified) (4 diffs)
  • importer/Splasher.java (modified) (1 diff)
  • importer/StatusBar.java (modified) (1 diff)

Legend:

Unmodified
Added
Removed
  • branches/3.0-Beta1/components/bioformats-omero/src/ome/formats/OMEROMetadataStore.java

    r1276 r1471  
    8383{ 
    8484 
     85    private boolean DEBUG = false; 
     86     
    8587    /** Logger for this class. */ 
    8688    private static Log     log    = LogFactory.getLog(OMEROMetadataStore.class); 
    … …  
    119121            String port) throws MetadataStoreException 
    120122    { 
     123        if (DEBUG) {log.debug("Starting OMEROMetadataStore.");} 
     124         
    121125        // Mask the password information for display in the debug window 
    122126        String maskedPswd = ""; 
    … …  
    185189    public Object getRoot() 
    186190    { 
     191        if (DEBUG) {log.debug("Calling getRoot().");} 
    187192        return pixels; 
    188193    } 
    … …  
    195200    public void setRoot(Object root) throws IllegalArgumentException 
    196201    { 
     202        if (DEBUG) {log.debug("Calling setRoot().");} 
    197203        if (!(root instanceof Pixels)) 
    198204            throw new IllegalArgumentException("'root' object of type '" 
    … …  
    209215    public void createRoot() 
    210216    { 
     217        if (DEBUG) {log.debug("Calling createRoot().");} 
    211218        pixels = new Pixels(); 
    212219    } 
    … …  
    221228    private IObject getEnumeration(Class<? extends IObject> klass, String value) 
    222229    { 
     230        if (DEBUG) {log.debug("Calling getEnumeration().");} 
    223231        if (klass == null) 
    224232            throw new NullPointerException("Expecting not-null klass."); 
    … …  
    242250            Integer i) 
    243251    { 
     252        if (DEBUG) {log.debug("Calling setImage().");} 
    244253        log.debug(String.format("Setting Image: name (%s), creationDate (%s), " 
    245254                + "description (%s)", name, creationDate, description)); 
    … …  
    263272            Object group, Integer i) 
    264273    { 
     274        if (DEBUG) {log.debug("Calling setExperimenter().");} 
    265275    // FIXME: To implement. 
    266276    } 
    … …  
    274284    public void setGroup(String name, Object leader, Object contact, Integer i) 
    275285    { 
     286        if (DEBUG) {log.debug("Calling setGroup().");} 
    276287    // FIXME: To implement. 
    277288    } 
    … …  
    280291            String serialNumber, String type, Integer i) 
    281292    { 
     293        if (DEBUG) {log.debug("Calling setInstrument().");} 
    282294    // FIXME: To implement. 
    283295    } 
    … …  
    293305            Float pixelSizeZ, Float pixelSizeC, Float pixelSizeT, Integer i) 
    294306    { 
     307        if (DEBUG) {log.debug("Calling setDimensions().");} 
    295308        log.debug(String.format( 
    296309                "Setting Dimensions: pixelSizeX (%f), pixelSizeY (%f), " 
    … …  
    336349            Object displayOptions, Integer i) 
    337350    { 
     351        if (DEBUG) {log.debug("Calling setDisplayRIO().");} 
    338352    // FIXME: We have no real type for this. 
    339353    } 
    … …  
    351365            String dimensionOrder, Integer i) 
    352366    { 
     367        if (DEBUG) {log.debug("Calling setPixels().");} 
    353368        log 
    354369                .debug(String 
    … …  
    413428    public void setStageLabel(String name, Float x, Float y, Float z, Integer i) 
    414429    { 
     430        if (DEBUG) {log.debug("Calling setStageLabel().");} 
    415431        log.debug(String.format( 
    416432                "Setting StageLabel: name (%s), x (%f), y (%f), z (%f)", name, 
    … …  
    449465            String mode, Integer i) 
    450466    { 
     467        if (DEBUG) {log.debug("Calling setLogicalChannel().");} 
    451468        log 
    452469                .debug(String 
    … …  
    496513            Double globalMax, Integer i) 
    497514    { 
     515        if (DEBUG) {log.debug("Calling setChannelGlobalMinMax().");} 
    498516        log.debug(String.format( 
    499517                "Setting GlobalMin: '%f' GlobalMax: '%f' for channel: '%d'", 
    … …  
    528546            Float exposureTime, Integer i) 
    529547    { 
     548        if (DEBUG) {log.debug("Calling setPlaneInfo().");} 
    530549        PlaneInfo pi = new PlaneInfo(); 
    531550        pi.setTheZ(z); 
    … …  
    555574    public void setPlane(Long id, byte[] pixels, int theZ, int theC, int theT) 
    556575    { 
     576        if (DEBUG) {log.debug("Calling setPlane().");} 
    557577        if (pservice == null) pservice = sf.createRawPixelsStore(); 
    558578 
    559579        pservice.setPixelsId(id); 
    560         pservice.setPlane(pixels, theZ, theC, theT); 
     580        try { 
     581            pservice.setPlane(pixels, theZ, theC, theT); 
     582        } catch (Throwable t)  
     583        { 
     584            log.debug("Got an error"); 
     585            t.printStackTrace(); 
     586        } 
    561587    } 
    562588 
    … …  
    571597    public void setStack(Long id, byte[] pixels, int theC, int theT) 
    572598    { 
     599        if (DEBUG) {log.debug("Calling setStack().");} 
    573600        if (pservice == null) pservice = sf.createRawPixelsStore(); 
    574601 
    … …  
    585612    public void addPixelsToDataset(Long pixId, Dataset dataset) 
    586613    { 
     614        if (DEBUG) {log.debug("Calling addPixelsToDatabase().");} 
    587615        Pixels pixels = iQuery.get(Pixels.class, pixId); 
    588616 
    … …  
    609637    public List<Dataset> getDatasets(Project project) 
    610638    { 
     639        if (DEBUG) {log.debug("Calling getDatasets().");} 
    611640        List l = iQuery.findAllByQuery( 
    612641                "from Dataset where id in " + 
    … …  
    627656    public List<Project> getProjects() 
    628657    { 
     658        if (DEBUG) {log.debug("Calling Projects().");} 
    629659        List l = iQuery.findAllByQuery( 
    630660                "from Project as p where p.details.owner.id = :id",  
    … …  
    641671    public Long saveToDB() 
    642672    { 
     673        if (DEBUG) {log.debug("Calling saveToDB().");} 
    643674        IUpdate update = sf.getUpdateService(); 
    644675        pixels = update.saveAndReturnObject(pixels); 
    … …  
    650681    public void setOriginalFiles(File[] files) 
    651682    { 
     683        if (DEBUG) {log.debug("Calling setOriginalFiles().");} 
    652684        for (File file: files) 
    653685        { 
    … …  
    665697    public void writeFilesToFileStore(File[] files, long pixelsId) 
    666698    { 
     699        if (DEBUG) {log.debug("Calling writeFilesToStore().");} 
    667700        try 
    668701        { 
  • branches/3.0-Beta1/components/bioformats-omero/src/ome/formats/importer/CommentMessenger.java

    r1196 r1471  
    2929import javax.swing.JOptionPane; 
    3030import javax.swing.JPanel; 
    31 import javax.swing.JTabbedPane; 
    3231import javax.swing.JTextArea; 
    3332import javax.swing.JTextField; 
    3433import javax.swing.JTextPane; 
    3534import javax.swing.UIManager; 
    36 import javax.swing.text.BadLocationException; 
    37 import javax.swing.text.Style; 
    38 import javax.swing.text.StyledDocument; 
    3935 
    4036import ome.formats.importer.util.GuiCommonElements; 
    4137import ome.formats.importer.util.HtmlMessenger; 
    42  
    43 import org.apache.commons.httpclient.HttpClient; 
    44 import org.apache.commons.httpclient.methods.PostMethod; 
    4538 
    4639import layout.TableLayout; 
    … …  
    5447    private static final long serialVersionUID = -894653530593047377L; 
    5548 
    56     boolean debug = true; 
     49    boolean debug = false; 
    5750     
    5851    String url = "http://users.openmicroscopy.org.uk/~brain/omero/commentcollector.php"; 
  • branches/3.0-Beta1/components/bioformats-omero/src/ome/formats/importer/FileQueueHandler.java

    r1196 r1471  
    2323import java.util.prefs.Preferences; 
    2424 
    25 import javax.swing.JCheckBox; 
    2625import javax.swing.JFileChooser; 
    2726import javax.swing.JFrame; 
  • branches/3.0-Beta1/components/bioformats-omero/src/ome/formats/importer/ImportDialog.java

    r1295 r1471  
    104104    ImportDialog(JFrame owner, String title, boolean modal, OMEROMetadataStore store) 
    105105    { 
    106         super(); 
     106        super(owner); 
    107107        this.store = store; 
    108108         
  • branches/3.0-Beta1/components/bioformats-omero/src/ome/formats/importer/ImportHandler.java

    r1295 r1471  
    4141{ 
    4242 
     43    private boolean DEBUG; 
     44     
    4345    private ImportLibrary   library; 
    4446 
    … …  
    6062            IFormatReader reader, ImportContainer[] fads) 
    6163    { 
     64        this.DEBUG = viewer.DEBUG; 
     65        if (DEBUG) {log.debug("Starting ImportHandler.");} 
     66         
    6267        this.viewer = viewer; 
    6368        this.library = new ImportLibrary(store, reader, fads); 
    … …  
    6772         
    6873        this.iReader = new ImageReader(); 
    69          
     74                
    7075        new Thread() 
    7176        { 
    … …  
    8489    private void importImages() 
    8590    { 
     91        if (DEBUG) {log.debug("Calling importImages.");} 
     92         
    8693        long timestampIn; 
    8794        long timestampOut; 
    … …  
    8996        long timeInSeconds; 
    9097        long hours, minutes, seconds; 
     98         
    9199        Date date = null; 
    92100 
    … …  
    178186            boolean archive) 
    179187    { 
     188        if (DEBUG) {log.debug("Calling importImage().");} 
     189         
    180190        String fileName = file.getAbsolutePath(); 
    181191        String shortName = file.getName(); 
    … …  
    268278    public void open(String fileName) 
    269279    { 
     280        if (DEBUG) {log.debug("Calling open().");} 
    270281        viewer.waitCursor(true); 
    271282        try 
  • branches/3.0-Beta1/components/bioformats-omero/src/ome/formats/importer/Main.java

    r1299 r1471  
    5353    private static final long   serialVersionUID = 1228000122345370913L; 
    5454 
     55    public static String        versionText = "Beta 1.2"; 
     56     
    5557    /** The data of the last release date. */ 
    5658    public static String        releaseDate       
    57          = "2007-02-28 11:02:43 +0000 (Wed, 28 Feb 2007"; 
     59         = "2007-02-28 11:02:43 +0000 (Wed, 25 Apr 2007"; 
    5860 
    5961    /** The repository revision. */ 
    … …  
    8082 
    8183    public static final String ICON = "gfx/icon.png"; 
     84 
     85    public static final boolean DEBUG = false; 
    8286     
    8387    public LoginHandler        loginHandler; 
  • branches/3.0-Beta1/components/bioformats-omero/src/ome/formats/importer/SplashWindow.java

    r1295 r1471  
    1717import javax.swing.ImageIcon; 
    1818import javax.swing.JFrame; 
    19 import javax.swing.JOptionPane; 
    2019/** 
    2120 * A Splash window. 
    … …  
    4241public class SplashWindow extends JFrame { 
    4342    /** 
     43     *  
     44     */ 
     45    private static final long serialVersionUID = 1L; 
     46 
     47    /** 
    4448     * The current instance of the splash window. 
    4549     * (Singleton design pattern). 
    4650     */ 
    4751    private static SplashWindow instance; 
    48      
    49     private static Main   mainInstance; 
    5052     
    5153    /** 
    … …  
    124126                    // occur before the contents of the window 
    125127                    // has been painted. 
    126                     synchronized(SplashWindow.this) { 
    127                         SplashWindow.this.paintCalled = true; 
    128                         SplashWindow.this.notifyAll(); 
     128                    synchronized(this) { 
     129                        paintCalled = true; 
     130                        notifyAll(); 
    129131                    } 
    130132                    dispose(); 
    … …  
    217219    public static void invokeMain(String className, String[] args) { 
    218220        try { 
    219            mainInstance = (Main)Class.forName(className) 
     221           Class.forName(className) 
    220222            .getMethod("main", new Class[] {String[].class}) 
    221223            .invoke(null, new Object[] {args}); 
  • branches/3.0-Beta1/components/bioformats-omero/src/ome/formats/importer/Splasher.java

    r1295 r1471  
    2626        try 
    2727        { 
    28             Thread.sleep(1000); 
     28            Thread.sleep(200); 
    2929        } catch (InterruptedException e)  {} 
    3030        SplashWindow.invokeMain("ome.formats.importer.Main", args); 
  • branches/3.0-Beta1/components/bioformats-omero/src/ome/formats/importer/StatusBar.java

    r1299 r1471  
    107107    { 
    108108        progressBar.setVisible(visible); 
     109        progressBar.setFont(getFont().deriveFont(11.0f)); 
     110        progressBar.setPreferredSize(new Dimension(220, 20)); 
    109111        if (perc < 0) progressBar.setIndeterminate(true); 
    110112        else 
    111113        { 
    112114            progressBar.setIndeterminate(false); 
    113             progressBar.setFont(getFont().deriveFont(11.0f)); 
    114             progressBar.setPreferredSize(new Dimension(220, 20)); 
     115            progressBar.setValue(perc); 
     116        } 
     117        if (string.length() > 0)  
     118        { 
    115119            progressBar.setStringPainted(true); 
    116             progressBar.setValue(perc); 
    117             if (string.length() > 0)  
    118             { 
    119                 progressBar.setStringPainted(true); 
    120                 progressBar.setString("   " + string + "   "); 
    121             } 
     120            progressBar.setString("   " + string + "   "); 
    122121        } 
    123122    } 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/