/[schmitzm]/trunk/src/skrueger/i8n/SwitchLanguageDialog.java
ViewVC logotype

Diff of /trunk/src/skrueger/i8n/SwitchLanguageDialog.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/src/skrueger/i8n/SwitchLanguageDialog.java revision 244 by alfonx, Wed Jul 29 09:33:33 2009 UTC branches/2.0-RC1/src/skrueger/i8n/SwitchLanguageDialog.java revision 607 by alfonx, Wed Dec 9 15:13:42 2009 UTC
# Line 2  Line 2 
2   * Copyright (c) 2009 Martin O. J. Schmitz.   * Copyright (c) 2009 Martin O. J. Schmitz.
3   *   *
4   * This file is part of the SCHMITZM library - a collection of utility   * This file is part of the SCHMITZM library - a collection of utility
5   * classes based on Java 1.6, focussing (not only) on Java Swing   * classes based on Java 1.6, focusing (not only) on Java Swing
6   * and the Geotools library.   * and the Geotools library.
7   *   *
8   * The SCHMITZM project is hosted at:   * The SCHMITZM project is hosted at:
# Line 33  import java.awt.Component; Line 33  import java.awt.Component;
33  import java.awt.GridBagConstraints;  import java.awt.GridBagConstraints;
34  import java.awt.GridBagLayout;  import java.awt.GridBagLayout;
35  import java.awt.Insets;  import java.awt.Insets;
 import java.awt.Window;  
36  import java.awt.event.ActionEvent;  import java.awt.event.ActionEvent;
37  import java.awt.event.ActionListener;  import java.awt.event.ActionListener;
38  import java.awt.event.MouseWheelListener;  import java.awt.event.MouseWheelListener;
# Line 84  public class SwitchLanguageDialog extend Line 83  public class SwitchLanguageDialog extend
83          /**          /**
84           * A dialog to select one of the available languages. If only one language           * A dialog to select one of the available languages. If only one language
85           * is available, select it directly. Creating this object automatically           * is available, select it directly. Creating this object automatically
86           * makes it visible.           * makes it visible, unless there is only one language to choose from.. it
87           *           * that case it disposes itself autmatically.
          * @param owner  
          * @param atlasConfig  
88           */           */
89          public SwitchLanguageDialog(final Component owner,          public SwitchLanguageDialog(final Component owner,
90                          final List<String> languages) {                          final List<String> languages) {
# Line 99  public class SwitchLanguageDialog extend Line 96  public class SwitchLanguageDialog extend
96                  if (languages.size() == 1) {                  if (languages.size() == 1) {
97                          LOGGER.debug("Only language '" + languages.get(0)                          LOGGER.debug("Only language '" + languages.get(0)
98                                          + "' is available. It has been selected automatically.");                                          + "' is available. It has been selected automatically.");
99    //                      dispose();
100                            setModal(false);
101                          return;                          return;
102                  }                  }
103    
# Line 112  public class SwitchLanguageDialog extend Line 111  public class SwitchLanguageDialog extend
111           */           */
112          private void initialize() {          private void initialize() {
113                  this.setContentPane(getJContentPane());                  this.setContentPane(getJContentPane());
                 setModal(true);  
                 SwingUtil.centerFrameOnScreenRandom(this);  
114    
115                  setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);                  setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
116    
117                  pack();                  pack();
118    
119                    SwingUtil.centerFrameOnScreenRandom(this);
120                    setModal(true);
121                    setVisible(true);
122          }          }
123    
124          /**          /**
# Line 214  public class SwitchLanguageDialog extend Line 215  public class SwitchLanguageDialog extend
215                          gridBagConstraints.gridy = 0;                          gridBagConstraints.gridy = 0;
216                          jLabel = new JLabel();                          jLabel = new JLabel();
217                          jLabel.setText("Select language: "); // i8n!?! Maybe replace with an                          jLabel.setText("Select language: "); // i8n!?! Maybe replace with an
218                                                                                                          // icon of an index finger                          // icon of an index finger
219                          jPanel1 = new JPanel();                          jPanel1 = new JPanel();
220                          jPanel1.setLayout(new GridBagLayout());                          jPanel1.setLayout(new GridBagLayout());
221                          jPanel1.add(jLabel, gridBagConstraints);                          jPanel1.add(jLabel, gridBagConstraints);
# Line 287  public class SwitchLanguageDialog extend Line 288  public class SwitchLanguageDialog extend
288                  return jComboBox;                  return jComboBox;
289          }          }
290    
291  } // @jve:decl-index=0:visual-constraint="0,0"  }

Legend:
Removed from v.244  
changed lines
  Added in v.607

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26