Changeset 2582


Ignore:
Timestamp:
04/06/07 16:27:13 (13 years ago)
Author:
sorber
Message:

Added 2D w/ overlays option to "Would you like to visualize" dialog.

Location:
trunk/loci/visbio
Files:
2 edited

Legend:

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

    r1989 r2582  
    4141import loci.visbio.*; 
    4242import loci.visbio.ome.OMEManager; 
     43import loci.visbio.overlays.OverlayTransform; 
    4344import loci.visbio.util.*; 
    4445import loci.visbio.view.DisplayWindow; 
     
    376377      lm.getVisBio().getManager(WindowManager.class); 
    377378    wm.showWindow(window); 
     379  } 
     380 
     381  /** Do new display with overlays */ 
     382  public void doNewDisplayWithOverlays() { 
     383    DataTransform data = getSelectedData(); 
     384    if (data == null) return; 
     385    DisplayManager disp = (DisplayManager) 
     386      lm.getVisBio().getManager(DisplayManager.class); 
     387    if (disp == null) return; 
     388    DisplayWindow window = disp.createDisplay(this, data.getName(), false); 
     389    if (window == null) return; 
     390 
     391    // construct overlays and add to data list and display window 
     392    String overlaysName = data.getName() + "  overlays"; 
     393    OverlayTransform overlays = new OverlayTransform(data, overlaysName); 
     394    DataManager dm = (DataManager)  
     395      lm.getVisBio().getManager(DataManager.class); 
     396    if (dm == null) return; 
     397    dm.addData(overlays); 
     398    window.addTransform(data); 
     399    window.addTransform(overlays); 
     400 
     401    // show windows 
     402    WindowManager wm = (WindowManager) 
     403      lm.getVisBio().getManager(WindowManager.class); 
     404    wm.showWindow(window); 
     405    dm.showControls(overlays); 
    378406  } 
    379407 
  • trunk/loci/visbio/help/HelpManager.java

    r2506 r2582  
    9292      buttons.add(vis2D); 
    9393 
     94      // create option for 2D visualization w/ overlays 
     95      JRadioButton visOver = new JRadioButton("In 2D w/ Overlays",  
     96        !canDisplay3D); 
     97      visOver.setEnabled(canDisplay2D); 
     98      if (!LAFUtil.isMacLookAndFeel()) visOver.setMnemonic('o'); 
     99      buttons.add(visOver); 
     100 
    94101      // create option for no visualization 
    95102      JRadioButton visNot = new JRadioButton("Not now"); 
     
    99106      // create panel for asking user about immediate visualization 
    100107      PanelBuilder builder = new PanelBuilder(new FormLayout( 
    101         "15dlu, pref, 3dlu, pref, 3dlu, pref:grow", "pref, 3dlu, pref" 
     108        "15dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref:grow",  
     109        "pref, 3dlu, pref" 
    102110      )); 
    103111      CellConstraints cc = new CellConstraints(); 
    104       builder.addLabel("Would you like the visualize the \"" + 
    105         data + "\" object now?", cc.xyw(1, 1, 6)); 
     112      builder.addLabel("Would you like to visualize the \"" + 
     113        data + "\" object now?", cc.xyw(1, 1, 8)); 
    106114      builder.add(vis3D, cc.xy(2, 3)); 
    107115      builder.add(vis2D, cc.xy(4, 3)); 
    108       builder.add(visNot, cc.xy(6, 3)); 
     116      builder.add(visOver, cc.xy(6, 3)); 
     117      builder.add(visNot, cc.xy(8, 3)); 
     118 
    109119      JPanel visPanel = builder.getPanel(); 
    110120 
     
    115125      boolean success = om.checkMessage(dc, 
    116126        DISPLAY_DATA, false, visPanel, "VisBio"); 
    117       if (success && !visNot.isSelected()) dc.doNewDisplay(vis3D.isSelected()); 
     127      if (success && !visNot.isSelected()) {  
     128        if (!visOver.isSelected()) dc.doNewDisplay(vis3D.isSelected()); 
     129        else dc.doNewDisplayWithOverlays(); 
     130      } 
    118131    } 
    119132  } 
Note: See TracChangeset for help on using the changeset viewer.