• 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 5616

Show
Ignore:
Timestamp:
09/17/08 08:58:31 (2 months ago)
Author:
jburel
Message:

Fix minor bugs and hopefully fix login screen for Ubuntu and windows. Not tested on Vista

Location:
trunk/SRC/org/openmicroscopy/shoola
Files:
1 added
11 modified

  • agents/events/iviewer/ImageRendered.java (added)
  • agents/events/iviewer/MeasurementTool.java (modified) (3 diffs)
  • agents/imviewer/view/ImViewerComponent.java (modified) (4 diffs)
  • agents/imviewer/view/ImViewerUI.java (modified) (1 diff)
  • agents/measurement/MeasurementAgent.java (modified) (5 diffs)
  • agents/measurement/view/MeasurementViewer.java (modified) (2 diffs)
  • agents/measurement/view/MeasurementViewerComponent.java (modified) (6 diffs)
  • agents/measurement/view/MeasurementViewerUI.java (modified) (1 diff)
  • agents/measurement/view/ToolBar.java (modified) (6 diffs)
  • agents/treeviewer/browser/BrowserComponent.java (modified) (1 diff)
  • util/ui/login/ScreenLogin.java (modified) (5 diffs)
  • util/ui/login/ServerEditor.java (modified) (2 diffs)

Legend:

Unmodified
Added
Removed
  • trunk/SRC/org/openmicroscopy/shoola/agents/events/iviewer/MeasurementTool.java

    r4982 r5616  
    2626//Java imports 
    2727import java.awt.Rectangle; 
     28import java.awt.image.BufferedImage; 
    2829import java.util.Map; 
    2930 
    … …  
    5152 
    5253    /** The ID of the pixels set. */ 
    53     private long        pixelsID; 
     54    private long                pixelsID; 
    5455     
    5556    /** The ID of the image. */ 
    56     private long        imageID; 
     57    private long                imageID; 
    5758     
    5859    /** The name of the image. */ 
    59     private String      name; 
     60    private String              name; 
    6061     
    6162    /** The currently selected z-section. */ 
    62     private int                 defaultZ; 
     63    private int                         defaultZ; 
    6364     
    6465    /** The currently selected timepoint. */ 
    65     private int                 defaultT; 
     66    private int                         defaultT; 
    6667     
    6768    /** Collection of pairs (channel's index, channel's color). */ 
    68     private Map                 activeChannels; 
     69    private Map                         activeChannels; 
    6970     
    7071    /** The image's magnification factor. */ 
    71     private double              magnification; 
     72    private double                      magnification; 
    7273     
    7374    /** The bounds of the component posting the event. */ 
    74     private Rectangle   requesterBounds; 
     75    private Rectangle           requesterBounds; 
    7576 
     77    /** Thumbnail of the rendered image. */ 
     78    private BufferedImage       thumbnail; 
     79     
    7680    /** 
    7781     * Creates a new instance. 
    … …  
    104108        requesterBounds = bounds; 
    105109    } 
     110     
     111    /** 
     112     * Sets the icon of the window. 
     113     *  
     114     * @param thumbnail The icon to set. 
     115     */ 
     116    public void setThumbnail(BufferedImage thumbnail) 
     117    { 
     118        this.thumbnail = thumbnail; 
     119    } 
     120     
     121    /** 
     122     * Returns the thumbnail. 
     123     *  
     124     * @return See above.  
     125     */ 
     126    public BufferedImage getThumbnail() { return thumbnail; } 
    106127     
    107128    /** 
  • trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java

    r5609 r5616  
    5151//Application-internal dependencies 
    5252import org.openmicroscopy.shoola.agents.events.iviewer.ChannelSelection; 
     53import org.openmicroscopy.shoola.agents.events.iviewer.ImageRendered; 
    5354import org.openmicroscopy.shoola.agents.events.iviewer.MeasurePlane; 
    5455import org.openmicroscopy.shoola.agents.events.iviewer.MeasurementTool; 
    … …  
    147148         */ 
    148149        private boolean                                                 saveBeforeCopy; 
    149  
    150         /** The possible projections options. */ 
    151         private Map<Integer, String>                    projections; 
    152150         
    153151        /** The projection dialog. */ 
    … …  
    720718                if (model.isPlayingChannelMovie()) 
    721719                        model.setState(ImViewer.CHANNEL_MOVIE); 
    722                 if (!model.isPlayingMovie()) 
    723                         view.setIconImage(model.getImageIcon()); 
     720                if (!model.isPlayingMovie()) { 
     721                        //Post an event 
     722                        EventBus bus = ImViewerAgent.getRegistry().getEventBus(); 
     723                        BufferedImage icon = model.getImageIcon(); 
     724                        bus.post(new ImageRendered(model.getPixelsID(), icon)); 
     725                        view.setIconImage(icon); 
     726                } 
     727                         
    724728                if (view.isLensVisible()) view.setLensPlaneImage(); 
    725729                List history = model.getHistory(); 
    … …  
    19711975                                model.getActiveChannelsMap(), model.getZoomFactor(),  
    19721976                                view.getBounds()); 
     1977                request.setThumbnail(model.getImageIcon()); 
    19731978                bus.post(request); 
    19741979                view.selectTabbedPane(ImViewer.VIEW_INDEX); 
  • trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java

    r5528 r5616  
    598598                item = new JMenuItem(action); 
    599599                item.setText(action.getName()); 
    600                 menu.add(item); 
     600                //menu.add(item); 
    601601                return menu; 
    602602        } 
  • trunk/SRC/org/openmicroscopy/shoola/agents/measurement/MeasurementAgent.java

    r5069 r5616  
    3434import org.openmicroscopy.shoola.agents.events.SaveData; 
    3535import org.openmicroscopy.shoola.agents.events.iviewer.ChannelSelection; 
     36import org.openmicroscopy.shoola.agents.events.iviewer.ImageRendered; 
    3637import org.openmicroscopy.shoola.agents.events.iviewer.MeasurePlane; 
    3738import org.openmicroscopy.shoola.agents.events.iviewer.MeasurementTool; 
    … …  
    8384        } 
    8485        if (viewer != null) { 
     86                viewer.setIconImage(evt.getThumbnail()); 
    8587                MeasurementViewerFactory.addRequest(evt); 
    8688                viewer.activate(); 
    … …  
    176178                 
    177179        } 
     180    } 
     181     
     182    /** 
     183     * Reacts to the passed event. 
     184     *  
     185     * @param evt The event to handle. 
     186     */ 
     187    private void handleImageRenderedEvent(ImageRendered evt) 
     188    { 
     189        MeasurementViewer viewer = MeasurementViewerFactory.getViewer( 
     190                                                                        evt.getPixelsID()); 
     191        if (viewer != null) 
     192                viewer.setIconImage(evt.getThumbnail()); 
    178193    } 
    179194     
    … …  
    211226                bus.register(this, SaveData.class); 
    212227                bus.register(this, FocusGainedEvent.class); 
     228                bus.register(this, ImageRendered.class); 
    213229        } 
    214230 
    … …  
    246262                else if (e instanceof FocusGainedEvent) 
    247263                        handleFocusGainedEvent((FocusGainedEvent) e); 
     264                else if (e instanceof ImageRendered) 
     265                        handleImageRenderedEvent((ImageRendered) e); 
    248266        } 
    249267         
  • trunk/SRC/org/openmicroscopy/shoola/agents/measurement/view/MeasurementViewer.java

    r5166 r5616  
    2525 
    2626//Java imports 
     27import java.awt.image.BufferedImage; 
    2728import java.io.InputStream; 
    2829import java.util.ArrayList; 
    … …  
    284285        /** Moves the window to the front. */ 
    285286    public void toFront(); 
    286      
    287     public Boolean isPixelDataAvailable(); 
     287 
     288    /** 
     289     * Sets the icon of the window. 
     290     *  
     291     * @param thumbnail The icon to set. 
     292     */ 
     293        public void setIconImage(BufferedImage thumbnail); 
    288294         
    289295} 
  • trunk/SRC/org/openmicroscopy/shoola/agents/measurement/view/MeasurementViewerComponent.java

    r5575 r5616  
    2626//Java imports 
    2727import java.awt.Dimension; 
     28import java.awt.image.BufferedImage; 
    2829import java.io.File; 
    2930import java.io.InputStream; 
    … …  
    3435import java.util.Map; 
    3536import java.util.TreeMap; 
    36  
    3737import javax.swing.JFileChooser; 
    3838import javax.swing.JFrame; 
    … …  
    4646import ome.model.core.Pixels; 
    4747import org.openmicroscopy.shoola.agents.events.measurement.MeasurementToolLoaded; 
    48 import org.openmicroscopy.shoola.agents.imviewer.view.ImViewer; 
    4948import org.openmicroscopy.shoola.agents.measurement.MeasurementAgent; 
    5049import org.openmicroscopy.shoola.agents.measurement.util.FileMap; 
    … …  
    770769                                        "Save the ROI data in the file associate with this image.", 
    771770                                        filterList); 
    772                 File f=UIUtilities.getDefaultFolder(); 
     771                File f = UIUtilities.getDefaultFolder(); 
    773772            if (f != null) chooser.setCurrentDirectory(f); 
    774773                try 
    … …  
    818817        /**  
    819818     * Implemented as specified by the {@link MeasurementViewer} interface. 
    820      * @see ImViewer#saveRndSettings() 
     819     * @see MeasurementViewer#saveRndSettings() 
    821820     */ 
    822821    public void toFront() 
    … …  
    825824        controller.toFront(); 
    826825    } 
     826 
     827        /**  
     828     * Implemented as specified by the {@link MeasurementViewer} interface. 
     829     * @see MeasurementViewer#setIconImage(BufferedImage) 
     830     */ 
     831        public void setIconImage(BufferedImage thumbnail) 
     832        { 
     833                if (model.getState() == DISCARDED) return; 
     834                view.setIconImage(thumbnail); 
     835        } 
    827836     
    828      
    829     public Boolean isPixelDataAvailable() 
    830     { 
    831         return model.isPixelDataAvailable(); 
    832     } 
    833837} 
  • trunk/SRC/org/openmicroscopy/shoola/agents/measurement/view/MeasurementViewerUI.java

    r5508 r5616  
    635635                { 
    636636                        un.notifyInfo("ROI Assistant", "ROI Assistant cannot be used" + 
    637                                         " in graph pane or intensity view"); 
     637                                        " in graph pane or intensity view."); 
    638638                        return; 
    639639                } 
  • trunk/SRC/org/openmicroscopy/shoola/agents/measurement/view/ToolBar.java

    r5144 r5616  
    8686 
    8787        /** The defaults attributes of the line connection figure. */ 
    88         private final static HashMap<AttributeKey, Object>      defaultConnecionAttributes; 
     88        private final static HashMap<AttributeKey, Object>       
     89        defaultConnectionAttributes; 
    8990         
    9091        static 
    9192        { 
    92                 defaultConnecionAttributes=new HashMap<AttributeKey, Object>(); 
    93                 defaultConnecionAttributes.put(MeasurementAttributes.FILL_COLOR, 
     93                defaultConnectionAttributes=new HashMap<AttributeKey, Object>(); 
     94                defaultConnectionAttributes.put(MeasurementAttributes.FILL_COLOR, 
    9495                                                IOConstants.DEFAULT_FILL_COLOUR); 
    95                 defaultConnecionAttributes.put(MeasurementAttributes.STROKE_COLOR, 
     96                defaultConnectionAttributes.put(MeasurementAttributes.STROKE_COLOR, 
    9697                                                IOConstants.DEFAULT_STROKE_COLOUR); 
    97                 defaultConnecionAttributes.put(MeasurementAttributes.TEXT_COLOR, 
     98                defaultConnectionAttributes.put(MeasurementAttributes.TEXT_COLOR, 
    9899                                                IOConstants.DEFAULT_TEXT_COLOUR); 
    99                 defaultConnecionAttributes.put(MeasurementAttributes.FONT_SIZE, new Double(10)); 
    100                 defaultConnecionAttributes.put(MeasurementAttributes.FONT_BOLD, false); 
    101                 defaultConnecionAttributes.put(MeasurementAttributes.STROKE_WIDTH, new Double(1.0)); 
    102                 defaultConnecionAttributes.put(MeasurementAttributes.TEXT, "Text"); 
    103                 defaultConnecionAttributes.put(MeasurementAttributes.MEASUREMENTTEXT_COLOUR, 
     100                defaultConnectionAttributes.put(MeasurementAttributes.FONT_SIZE,  
     101                                new Double(10)); 
     102                defaultConnectionAttributes.put(MeasurementAttributes.FONT_BOLD, false); 
     103                defaultConnectionAttributes.put(MeasurementAttributes.STROKE_WIDTH,  
     104                                new Double(1.0)); 
     105                defaultConnectionAttributes.put(MeasurementAttributes.TEXT, "Text"); 
     106                defaultConnectionAttributes.put( 
     107                                MeasurementAttributes.MEASUREMENTTEXT_COLOUR, 
    104108                        IOConstants.DEFAULT_MEASUREMENT_TEXT_COLOUR); 
    105                 defaultConnecionAttributes.put(MeasurementAttributes.SHOWMEASUREMENT,  
     109                defaultConnectionAttributes.put(MeasurementAttributes.SHOWMEASUREMENT,  
    106110                                                        Boolean.FALSE); 
    107                 defaultConnecionAttributes.put(DrawingAttributes.SHOWTEXT, Boolean.FALSE); 
    108         } 
    109          
    110         /** The properties figure for a line connection object. */ 
    111         private FigureProperties                        lineConnectionProperties; 
    112                  
     111                defaultConnectionAttributes.put(DrawingAttributes.SHOWTEXT,  
     112                                Boolean.FALSE); 
     113        } 
     114 
    113115        /** The default string added to the type of Figure to create. */ 
    114116        private static final String                     CREATE_KEY = "create"; 
    … …  
    117119    private static final Dimension              HGLUE = new Dimension(5, 5); 
    118120     
     121    /** The properties figure for a line connection object. */ 
     122        private FigureProperties                        lineConnectionProperties; 
     123         
    119124        /** Tool bar hosting the control defined by <code>JHotDraw</code>. */ 
    120125        private JToolBar                                        toolBar; 
    … …  
    159164        private void initComponents() 
    160165        { 
    161                 lineConnectionProperties = new FigureProperties(defaultConnecionAttributes); 
     166                lineConnectionProperties = new FigureProperties( 
     167                                defaultConnectionAttributes); 
    162168                ellipseTool = new DrawingObjectCreationTool(new MeasureEllipseFigure()); 
    163169                rectTool = new DrawingObjectCreationTool(new MeasureRectangleFigure()); 
    … …  
    233239                 { 
    234240                         JToggleButton button = (JToggleButton) component; 
    235                          IconManager icons = IconManager.getInstance(); 
    236241                         button.setToolTipText("Connector"); 
    237242                         button.setAction(new DrawingAction(measurementcomponent, button));      
    … …  
    264269                        button.addMouseListener(this); 
    265270                } 
    266  
    267271        } 
    268272         
    … …  
    368372        } 
    369373         
    370         /* (non-Javadoc) 
    371          * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent) 
     374        /** 
     375         * Sets the selected flag of the source of the event to  
     376         * <code>true</code> when a right click event occurs. 
     377         * @see MouseListener#mouseClicked(MouseEvent) 
    372378         */ 
    373379        public void mouseClicked(MouseEvent e) 
    374380        { 
    375                 if(rightClick(e)) 
    376                 { 
    377                         this.createSingleFigure(false); 
     381                if (rightClick(e)) 
     382                { 
     383                        createSingleFigure(false); 
    378384                        JToggleButton button = (JToggleButton)e.getSource(); 
    379385                        button.setSelected(true); 
    380386                } 
    381387                else 
    382                 { 
    383                         this.createSingleFigure(view.isCreateSingleFigure()); 
    384                 } 
    385                  
    386         } 
    387  
    388         /* (non-Javadoc) 
    389          * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent) 
    390          */ 
    391         public void mouseEntered(MouseEvent e) 
    392         { 
    393                 // TODO Auto-generated method stub 
    394                  
    395         } 
    396  
    397         /* (non-Javadoc) 
    398          * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent) 
    399          */ 
    400         public void mouseExited(MouseEvent e) 
    401         { 
    402                 // TODO Auto-generated method stub 
    403                  
    404         } 
    405  
    406         /* (non-Javadoc) 
    407          * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent) 
    408          */ 
    409         public void mousePressed(MouseEvent e) 
    410         { 
    411  
    412         } 
    413  
    414         /* (non-Javadoc) 
    415          * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent) 
    416          */ 
    417         public void mouseReleased(MouseEvent e) 
    418         { 
    419                 // TODO Auto-generated method stub 
    420                  
    421         } 
     388                        createSingleFigure(view.isCreateSingleFigure()); 
     389        } 
     390 
     391        /** 
     392         * Required by the {@link MouseListener} I/F but no-op implementation  
     393         * in our case. 
     394         * @see MouseListener#mouseEntered(MouseEvent) 
     395         */ 
     396        public void mouseEntered(MouseEvent e) {} 
     397 
     398        /** 
     399         * Required by the {@link MouseListener} I/F but no-op implementation  
     400         * in our case. 
     401         * @see MouseListener#mouseExited(MouseEvent) 
     402         */ 
     403        public void mouseExited(MouseEvent e) {} 
     404 
     405        /** 
     406         * Required by the {@link MouseListener} I/F but no-op implementation  
     407         * in our case. 
     408         * @see MouseListener#mousePressed(MouseEvent) 
     409         */ 
     410        public void mousePressed(MouseEvent e) {} 
     411 
     412        /** 
     413         * Required by the {@link MouseListener} I/F but no-op implementation  
     414         * in our case. 
     415         * @see MouseListener#mouseReleased(MouseEvent) 
     416         */ 
     417        public void mouseReleased(MouseEvent e) {} 
    422418         
    423419} 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserComponent.java

    r5538 r5616  
    11041104                                results = TreeViewerTranslator.refreshImageHierarchy( 
    11051105                                                        node.getResults(), exp.getId(),  
    1106                                                         exp.getDefaultGroup().getId()); 
     1106                                                        -1); 
    11071107                                view.refreshTimeFolder(expNode, results); 
    11081108                        } else { 
    11091109                                convertedNodes = TreeViewerTranslator.refreshHierarchy( 
    11101110                                                node.getResults(), node.getExpandedTopNodes(),  
    1111                                                 exp.getId(), exp.getDefaultGroup().getId()); 
     1111                                                exp.getId(), -1); 
    11121112                                view.setExperimenterData(convertedNodes, expNode); 
    11131113                        } 
  • trunk/SRC/org/openmicroscopy/shoola/util/ui/login/ScreenLogin.java

    r5615 r5616  
    324324                 
    325325                serverText = UIUtilities.buildTextPane(serverName, TEXT_COLOR); 
    326                 //serverText.setFont(serverText.getFont().deriveFont(Font.BOLD)); 
    327                 serverTextPane = UIUtilities.buildComponentPanelRight(serverText, false); 
    328         } 
    329  
    330         /** 
    331          * Builds and lays out the specified text field. 
    332          *  
    333          * @param field         The field to lay out. 
    334          * @param mnemonic      The mnemonic value. 
    335          * @param s                     The value to display in front of the field. 
    336          * @return See above. 
    337          */ 
    338         private JPanel buildTextPanel(JTextField field, int mnemonic, String s) 
    339         { 
    340                 JPanel panel = new JPanel(); 
    341                 panel.setOpaque(false); 
    342                 //panel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); 
    343                  
    344                 JLabel label = UIUtilities.setTextFont(s); 
    345                 label.setForeground(TEXT_COLOR); 
    346                 label.setDisplayedMnemonic(mnemonic); 
    347                 label.setOpaque(false); 
    348                 //label.setLabelFor(field); 
    349                  
    350                 panel.add(label);         
    351                 panel.add(field); 
    352                 return panel; 
    353         } 
    354  
    355         /** 
    356          * Builds and lays out the panel hosting the login information. 
    357          *  
    358          * @return See above. 
    359          */ 
    360         private JPanel buildTopPanel() 
    361         { 
    362                 JPanel topPanel = new JPanel(); 
    363                 topPanel.setOpaque(false); 
    364                 /* 
    365                 JTextPane pleaseLogIn = UIUtilities.buildTextPane(TEXT_LOGIN,  
    366                                 TEXT_COLOR); 
    367                 Font f = pleaseLogIn.getFont(); 
    368                 Font newFont = f.deriveFont(Font.BOLD, TEXT_FONT_SIZE); 
    369                 pleaseLogIn.setFont(newFont); 
    370                 JPanel p = new JPanel(); 
    371                 p.setOpaque(false); 
    372                 p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); 
    373                 p.add(serverTextPane); 
    374                 p.add(connectionSpeedText); 
    375                  
    376                 JPanel namePanel = new JPanel(); 
    377                 namePanel.setOpaque(false); 
    378                 namePanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); 
    379                 namePanel.add(buildTextPanel(user, 'U', USER_TEXT)); 
    380                 namePanel.add(Box.createHorizontalStrut(20)); 
    381                 namePanel.add(buildTextPanel(pass, 'P', PASSWORD_TEXT)); 
    382                  
    383                  
    384                 GridBagConstraints c = new GridBagConstraints(); 
    385                 c.anchor = GridBagConstraints.FIRST_LINE_START; 
    386                 c.fill = GridBagConstraints.HORIZONTAL; 
    387                 c.gridx = 0; 
    388                 c.gridy = 0; 
    389                 topPanel.setLayout(new GridBagLayout()); 
    390                 topPanel.add(pleaseLogIn, c); //Add to panel. 
    391                 c.gridx++; 
    392                 c.weightx = 0.5; 
    393                 topPanel.add(p, c); 
    394                 c.gridx++; 
    395                 c.weightx = 0; 
    396                 topPanel.add(configButton, c); 
    397                 c.gridx = 0; 
    398                 c.gridy++; 
    399                 c.gridwidth = 3; 
    400                 //topPanel.add(Box.createVerticalStrut(5), c); 
    401                 //c.gridy++; 
    402                 topPanel.add(namePanel, c); 
    403