Changeset 5616
- Timestamp:
- 09/17/08 08:58:31 (2 months ago)
- 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 26 26 //Java imports 27 27 import java.awt.Rectangle; 28 import java.awt.image.BufferedImage; 28 29 import java.util.Map; 29 30 … … 51 52 52 53 /** The ID of the pixels set. */ 53 private long pixelsID;54 private long pixelsID; 54 55 55 56 /** The ID of the image. */ 56 private long imageID;57 private long imageID; 57 58 58 59 /** The name of the image. */ 59 private String name;60 private String name; 60 61 61 62 /** The currently selected z-section. */ 62 private int defaultZ;63 private int defaultZ; 63 64 64 65 /** The currently selected timepoint. */ 65 private int defaultT;66 private int defaultT; 66 67 67 68 /** Collection of pairs (channel's index, channel's color). */ 68 private Map activeChannels;69 private Map activeChannels; 69 70 70 71 /** The image's magnification factor. */ 71 private double magnification;72 private double magnification; 72 73 73 74 /** The bounds of the component posting the event. */ 74 private Rectangle requesterBounds;75 private Rectangle requesterBounds; 75 76 77 /** Thumbnail of the rendered image. */ 78 private BufferedImage thumbnail; 79 76 80 /** 77 81 * Creates a new instance. … … 104 108 requesterBounds = bounds; 105 109 } 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; } 106 127 107 128 /** -
trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java
r5609 r5616 51 51 //Application-internal dependencies 52 52 import org.openmicroscopy.shoola.agents.events.iviewer.ChannelSelection; 53 import org.openmicroscopy.shoola.agents.events.iviewer.ImageRendered; 53 54 import org.openmicroscopy.shoola.agents.events.iviewer.MeasurePlane; 54 55 import org.openmicroscopy.shoola.agents.events.iviewer.MeasurementTool; … … 147 148 */ 148 149 private boolean saveBeforeCopy; 149 150 /** The possible projections options. */151 private Map<Integer, String> projections;152 150 153 151 /** The projection dialog. */ … … 720 718 if (model.isPlayingChannelMovie()) 721 719 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 724 728 if (view.isLensVisible()) view.setLensPlaneImage(); 725 729 List history = model.getHistory(); … … 1971 1975 model.getActiveChannelsMap(), model.getZoomFactor(), 1972 1976 view.getBounds()); 1977 request.setThumbnail(model.getImageIcon()); 1973 1978 bus.post(request); 1974 1979 view.selectTabbedPane(ImViewer.VIEW_INDEX); -
trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java
r5528 r5616 598 598 item = new JMenuItem(action); 599 599 item.setText(action.getName()); 600 menu.add(item);600 //menu.add(item); 601 601 return menu; 602 602 } -
trunk/SRC/org/openmicroscopy/shoola/agents/measurement/MeasurementAgent.java
r5069 r5616 34 34 import org.openmicroscopy.shoola.agents.events.SaveData; 35 35 import org.openmicroscopy.shoola.agents.events.iviewer.ChannelSelection; 36 import org.openmicroscopy.shoola.agents.events.iviewer.ImageRendered; 36 37 import org.openmicroscopy.shoola.agents.events.iviewer.MeasurePlane; 37 38 import org.openmicroscopy.shoola.agents.events.iviewer.MeasurementTool; … … 83 84 } 84 85 if (viewer != null) { 86 viewer.setIconImage(evt.getThumbnail()); 85 87 MeasurementViewerFactory.addRequest(evt); 86 88 viewer.activate(); … … 176 178 177 179 } 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()); 178 193 } 179 194 … … 211 226 bus.register(this, SaveData.class); 212 227 bus.register(this, FocusGainedEvent.class); 228 bus.register(this, ImageRendered.class); 213 229 } 214 230 … … 246 262 else if (e instanceof FocusGainedEvent) 247 263 handleFocusGainedEvent((FocusGainedEvent) e); 264 else if (e instanceof ImageRendered) 265 handleImageRenderedEvent((ImageRendered) e); 248 266 } 249 267 -
trunk/SRC/org/openmicroscopy/shoola/agents/measurement/view/MeasurementViewer.java
r5166 r5616 25 25 26 26 //Java imports 27 import java.awt.image.BufferedImage; 27 28 import java.io.InputStream; 28 29 import java.util.ArrayList; … … 284 285 /** Moves the window to the front. */ 285 286 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); 288 294 289 295 } -
trunk/SRC/org/openmicroscopy/shoola/agents/measurement/view/MeasurementViewerComponent.java
r5575 r5616 26 26 //Java imports 27 27 import java.awt.Dimension; 28 import java.awt.image.BufferedImage; 28 29 import java.io.File; 29 30 import java.io.InputStream; … … 34 35 import java.util.Map; 35 36 import java.util.TreeMap; 36 37 37 import javax.swing.JFileChooser; 38 38 import javax.swing.JFrame; … … 46 46 import ome.model.core.Pixels; 47 47 import org.openmicroscopy.shoola.agents.events.measurement.MeasurementToolLoaded; 48 import org.openmicroscopy.shoola.agents.imviewer.view.ImViewer;49 48 import org.openmicroscopy.shoola.agents.measurement.MeasurementAgent; 50 49 import org.openmicroscopy.shoola.agents.measurement.util.FileMap; … … 770 769 "Save the ROI data in the file associate with this image.", 771 770 filterList); 772 File f =UIUtilities.getDefaultFolder();771 File f = UIUtilities.getDefaultFolder(); 773 772 if (f != null) chooser.setCurrentDirectory(f); 774 773 try … … 818 817 /** 819 818 * Implemented as specified by the {@link MeasurementViewer} interface. 820 * @see ImViewer#saveRndSettings()819 * @see MeasurementViewer#saveRndSettings() 821 820 */ 822 821 public void toFront() … … 825 824 controller.toFront(); 826 825 } 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 } 827 836 828 829 public Boolean isPixelDataAvailable()830 {831 return model.isPixelDataAvailable();832 }833 837 } -
trunk/SRC/org/openmicroscopy/shoola/agents/measurement/view/MeasurementViewerUI.java
r5508 r5616 635 635 { 636 636 un.notifyInfo("ROI Assistant", "ROI Assistant cannot be used" + 637 " in graph pane or intensity view ");637 " in graph pane or intensity view."); 638 638 return; 639 639 } -
trunk/SRC/org/openmicroscopy/shoola/agents/measurement/view/ToolBar.java
r5144 r5616 86 86 87 87 /** 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; 89 90 90 91 static 91 92 { 92 defaultConnec ionAttributes=new HashMap<AttributeKey, Object>();93 defaultConnec ionAttributes.put(MeasurementAttributes.FILL_COLOR,93 defaultConnectionAttributes=new HashMap<AttributeKey, Object>(); 94 defaultConnectionAttributes.put(MeasurementAttributes.FILL_COLOR, 94 95 IOConstants.DEFAULT_FILL_COLOUR); 95 defaultConnec ionAttributes.put(MeasurementAttributes.STROKE_COLOR,96 defaultConnectionAttributes.put(MeasurementAttributes.STROKE_COLOR, 96 97 IOConstants.DEFAULT_STROKE_COLOUR); 97 defaultConnec ionAttributes.put(MeasurementAttributes.TEXT_COLOR,98 defaultConnectionAttributes.put(MeasurementAttributes.TEXT_COLOR, 98 99 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, 104 108 IOConstants.DEFAULT_MEASUREMENT_TEXT_COLOUR); 105 defaultConnec ionAttributes.put(MeasurementAttributes.SHOWMEASUREMENT,109 defaultConnectionAttributes.put(MeasurementAttributes.SHOWMEASUREMENT, 106 110 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 113 115 /** The default string added to the type of Figure to create. */ 114 116 private static final String CREATE_KEY = "create"; … … 117 119 private static final Dimension HGLUE = new Dimension(5, 5); 118 120 121 /** The properties figure for a line connection object. */ 122 private FigureProperties lineConnectionProperties; 123 119 124 /** Tool bar hosting the control defined by <code>JHotDraw</code>. */ 120 125 private JToolBar toolBar; … … 159 164 private void initComponents() 160 165 { 161 lineConnectionProperties = new FigureProperties(defaultConnecionAttributes); 166 lineConnectionProperties = new FigureProperties( 167 defaultConnectionAttributes); 162 168 ellipseTool = new DrawingObjectCreationTool(new MeasureEllipseFigure()); 163 169 rectTool = new DrawingObjectCreationTool(new MeasureRectangleFigure()); … … 233 239 { 234 240 JToggleButton button = (JToggleButton) component; 235 IconManager icons = IconManager.getInstance();236 241 button.setToolTipText("Connector"); 237 242 button.setAction(new DrawingAction(measurementcomponent, button)); … … 264 269 button.addMouseListener(this); 265 270 } 266 267 271 } 268 272 … … 368 372 } 369 373 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) 372 378 */ 373 379 public void mouseClicked(MouseEvent e) 374 380 { 375 if (rightClick(e))376 { 377 this.createSingleFigure(false);381 if (rightClick(e)) 382 { 383 createSingleFigure(false); 378 384 JToggleButton button = (JToggleButton)e.getSource(); 379 385 button.setSelected(true); 380 386 } 381 387 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) {} 422 418 423 419 } -
trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserComponent.java
r5538 r5616 1104 1104 results = TreeViewerTranslator.refreshImageHierarchy( 1105 1105 node.getResults(), exp.getId(), 1106 exp.getDefaultGroup().getId());1106 -1); 1107 1107 view.refreshTimeFolder(expNode, results); 1108 1108 } else { 1109 1109 convertedNodes = TreeViewerTranslator.refreshHierarchy( 1110 1110 node.getResults(), node.getExpandedTopNodes(), 1111 exp.getId(), exp.getDefaultGroup().getId());1111 exp.getId(), -1); 1112 1112 view.setExperimenterData(convertedNodes, expNode); 1113 1113 } -
trunk/SRC/org/openmicroscopy/shoola/util/ui/login/ScreenLogin.java
r5615 r5616 324 324 325 325 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
