Changeset 169 for trunk/loci/visbio/view


Ignore:
Timestamp:
02/16/05 17:41:43 (15 years ago)
Author:
curtis
Message:

Fix a bunch of dialog centering issues.

Location:
trunk/loci/visbio/view
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/visbio/view/DisplayControls.java

    r155 r169  
    179179    DisplayManager dm = (DisplayManager) lm; 
    180180    Object src = e.getSource(); 
    181     if (src == add2D) dm.createDisplay(false); 
    182     else if (src == add3D) dm.createDisplay(true); 
     181    if (src == add2D) dm.createDisplay(this, false); 
     182    else if (src == add3D) dm.createDisplay(this, true); 
    183183    else if (src == show) showDisplay(); 
    184184    else if (src == capture) { 
  • trunk/loci/visbio/view/DisplayManager.java

    r155 r169  
    2424package loci.visbio.view; 
    2525 
     26import java.awt.Component; 
    2627import java.util.Vector; 
    2728import javax.swing.JOptionPane; 
     
    6667 
    6768  /** Pops up a dialog allowing the user to create a new display. */ 
    68   public DisplayWindow createDisplay(boolean threeD) { 
     69  public DisplayWindow createDisplay(Component parent, boolean threeD) { 
    6970    nextId++; 
    70     DisplayWindow window = createDisplay("display" + nextId, threeD); 
     71    DisplayWindow window = createDisplay(parent, "display" + nextId, threeD); 
    7172    if (window == null) nextId--; 
    7273    return window; 
     
    7778   * with the given default name. 
    7879   */ 
    79   public DisplayWindow createDisplay(String defaultName, boolean threeD) { 
     80  public DisplayWindow createDisplay(Component parent, 
     81    String defaultName, boolean threeD) 
     82  { 
    8083    DisplayWindow window = null; 
    8184    if (getDisplays().length < MAX_DISPLAYS) { 
    82       String name = (String) JOptionPane.showInputDialog(null, 
     85      String name = (String) JOptionPane.showInputDialog(parent, 
    8386        "Display name:", "Add display", JOptionPane.INFORMATION_MESSAGE, 
    8487        null, null, defaultName); 
     
    8992    } 
    9093    else { 
    91       JOptionPane.showMessageDialog(null, "Sorry, but there is a limit of " + 
    92         MAX_DISPLAYS + " displays maximum.\nPlease reuse or delete one of " + 
    93         "your existing displays.", "Cannot create display", 
    94         JOptionPane.ERROR_MESSAGE); 
     94      JOptionPane.showMessageDialog(parent, 
     95        "Sorry, but there is a limit of " + MAX_DISPLAYS + 
     96        " displays maximum.\nPlease reuse or delete one of your existing " + 
     97        "displays.", "Cannot create display", JOptionPane.ERROR_MESSAGE); 
    9598    } 
    9699    return window; 
Note: See TracChangeset for help on using the changeset viewer.