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

Context Navigation

  • ← Previous Changeset
  • Next Changeset →

Changeset 5540

Show
Ignore:
Timestamp:
07/11/08 21:11:12 (3 months ago)
Author:
jburel
Message:

Fixed layout problem

Location:
trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser
Files:
4 modified

  • ThumbnailProvider.java (modified) (2 diffs)
  • browser/Thumbnail.java (modified) (2 diffs)
  • layout/PlateLayout.java (modified) (3 diffs)
  • view/WellsModel.java (modified) (4 diffs)

Legend:

Unmodified
Added
Removed
  • trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/ThumbnailProvider.java

    r5399 r5540  
    2626//Java imports 
    2727import java.awt.Color; 
     28import java.awt.Dimension; 
    2829import java.awt.Graphics; 
    2930import java.awt.Graphics2D; 
    … …  
    324325        public BufferedImage getFullSizeImage() { return fullSizeImage; } 
    325326 
     327    /** 
     328     * Implemented as specified by the {@link Thumbnail} I/F. 
     329     * @see Thumbnail#getOriginalSize() 
     330     */ 
     331        public Dimension getOriginalSize() 
     332        {  
     333                return new Dimension(originalWidth, originalHeight); 
     334        } 
    326335} 
  • trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/browser/Thumbnail.java

    r5399 r5540  
    2525 
    2626//Java imports 
     27import java.awt.Dimension; 
    2728import java.awt.image.BufferedImage; 
    2829import javax.swing.Icon; 
    … …  
    157158    public void setFullSizeImage(BufferedImage image); 
    158159     
     160    /** 
     161     * Returns the original size of the thumbnail. 
     162     *  
     163     * @return See above. 
     164     */ 
     165    public Dimension getOriginalSize(); 
     166     
    159167} 
  • trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/layout/PlateLayout.java

    r5538 r5540  
    3636//Application-internal dependencies 
    3737import org.openmicroscopy.shoola.agents.dataBrowser.browser.CellDisplay; 
     38import org.openmicroscopy.shoola.agents.dataBrowser.browser.ImageDisplay; 
    3839import org.openmicroscopy.shoola.agents.dataBrowser.browser.ImageNode; 
    3940import org.openmicroscopy.shoola.agents.dataBrowser.browser.ImageSet; 
    4041import org.openmicroscopy.shoola.agents.dataBrowser.browser.WellImageNode; 
     42 
     43import pojos.ImageData; 
    4144 
    4245 
    … …  
    120123                                                col.add(cell); 
    121124                                        else row.add(cell); 
    122                                 } else  
     125                                } else { 
    123126                                        l.add(n); 
     127                                } 
     128                                         
    124129                        } 
    125                 Dimension maxDim = LayoutUtils.maxChildDim(l); 
     130                //Dimension maxDim = LayoutUtils.maxChildDim(l); 
     131                Dimension maxDim = new Dimension(0, 0); 
     132            Iterator children = l.iterator(); 
     133            ImageDisplay child; 
     134            ImageData img; 
     135            while (children.hasNext()) { 
     136                child = (ImageDisplay) children.next(); 
     137                img = (ImageData) child.getHierarchyObject(); 
     138                if (img.getId() >= 0) 
     139                        maxDim = LayoutUtils.max(maxDim, child.getPreferredSize()); 
     140            } 
    126141                 //First need to set width and height 
    127142                Dimension d = col.get(0).getPreferredSize(); 
    … …  
    152167                        d = wiNode.getPreferredSize(); 
    153168                        wiNode.setBounds(width+c*maxDim.width, height+r*maxDim.height,  
    154                                                         maxDim.width, maxDim.height); 
     169                                                        d.width, d.height); 
    155170                        } 
    156171        } 
  • trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/WellsModel.java

    r5539 r5540  
    7777        private int             columns; 
    7878         
     79        /** The dimension of a well. */ 
     80        private Dimension               wellDimension; 
     81         
    7982        /** 
    8083         * Creates a new instance. 
    … …  
    8891                if (wells  == null)  
    8992                        throw new IllegalArgumentException("No wells."); 
     93                wellDimension = null; 
    9094                this.wells = wells; 
    9195                this.parent = parent; 
    … …  
    107111                        node.setRowDisplay(EditorUtil.LETTERS.get(row+1));  
    108112                        node.setColumnDisplay(""+(column+1)); 
     113                        if (((ImageData) node.getHierarchyObject()).getId() >= 0 && 
     114                                        wellDimension == null) 
     115                                wellDimension = node.getThumbnail().getOriginalSize(); 
    109116                } 
    110117                columns++; 
    … …  
    137144                        if (node instanceof WellImageNode) { 
    138145                                img = (ImageData) node.getHierarchyObject(); 
    139                                 if (img.getId() < 0)  
     146                                if (img.getId() < 0 && !refresh) { 
    140147                                        node.getThumbnail().setFullScaleThumb( 
    141                                                         Factory.createDefaultThumbnail("N/A")); 
    142                                 else  
     148                                                        Factory.createDefaultThumbnail(wellDimension.width,  
     149                                                                        wellDimension.height, "N/A")); 
     150                                } else  
    143151                                        images.add(img); 
    144152                        } 

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/