/[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

branches/1.0-gt2-2.6/src/skrueger/i8n/SwitchLanguageDialog.java revision 315 by mojays, Wed Aug 26 11:03:27 2009 UTC trunk/src/skrueger/i8n/SwitchLanguageDialog.java revision 1097 by alfonx, Sun Oct 10 21:14:05 2010 UTC
# Line 25  Line 25 
25   *   *
26   * Contributors:   * Contributors:
27   *     Martin O. J. Schmitz - initial API and implementation   *     Martin O. J. Schmitz - initial API and implementation
28   *     Stefan A. Krüger - additional utility classes   *     Stefan A. Tzeggai - additional utility classes
29   ******************************************************************************/   ******************************************************************************/
30  package skrueger.i8n;  package skrueger.i8n;
31    
# Line 62  import skrueger.swing.TranslationEditJPa Line 62  import skrueger.swing.TranslationEditJPa
62  public class SwitchLanguageDialog extends JDialog {  public class SwitchLanguageDialog extends JDialog {
63          protected Logger LOGGER = Logger.getLogger(SwitchLanguageDialog.class);          protected Logger LOGGER = Logger.getLogger(SwitchLanguageDialog.class);
64    
         private static final long serialVersionUID = 1L;  
   
65          private JPanel jContentPane = null;          private JPanel jContentPane = null;
66    
67          private JLabel jLabelFlagimage = null;          private JLabel jLabelFlagimage = null;
# Line 83  public class SwitchLanguageDialog extend Line 81  public class SwitchLanguageDialog extend
81          /**          /**
82           * 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
83           * is available, select it directly. Creating this object automatically           * is available, select it directly. Creating this object automatically
84           * makes it visible.           * makes it visible, unless there is only one language to choose from.. it
85           *           * that case it disposes itself automatically.
          * @param owner  
          * @param atlasConfig  
86           */           */
87          public SwitchLanguageDialog(final Component owner,          public SwitchLanguageDialog(final Component owner,
88                          final List<String> languages) {                          final List<String> languages) {
# Line 98  public class SwitchLanguageDialog extend Line 94  public class SwitchLanguageDialog extend
94                  if (languages.size() == 1) {                  if (languages.size() == 1) {
95                          LOGGER.debug("Only language '" + languages.get(0)                          LOGGER.debug("Only language '" + languages.get(0)
96                                          + "' is available. It has been selected automatically.");                                          + "' is available. It has been selected automatically.");
97                            // dispose();
98                            setModal(false);
99                          return;                          return;
100                  }                  }
101    
# Line 111  public class SwitchLanguageDialog extend Line 109  public class SwitchLanguageDialog extend
109           */           */
110          private void initialize() {          private void initialize() {
111                  this.setContentPane(getJContentPane());                  this.setContentPane(getJContentPane());
                 setModal(true);  
                 SwingUtil.centerFrameOnScreenRandom(this);  
112    
113                  setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);                  setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
114    
115                  pack();                  pack();
116    
117                    SwingUtil.centerFrameOnScreenRandom(this);
118                    setModal(true);
119                    setVisible(true);
120          }          }
121    
122          /**          /**
# Line 213  public class SwitchLanguageDialog extend Line 213  public class SwitchLanguageDialog extend
213                          gridBagConstraints.gridy = 0;                          gridBagConstraints.gridy = 0;
214                          jLabel = new JLabel();                          jLabel = new JLabel();
215                          jLabel.setText("Select language: "); // i8n!?! Maybe replace with an                          jLabel.setText("Select language: "); // i8n!?! Maybe replace with an
216                                                                                                          // icon of an index finger                          // icon of an index finger
217                          jPanel1 = new JPanel();                          jPanel1 = new JPanel();
218                          jPanel1.setLayout(new GridBagLayout());                          jPanel1.setLayout(new GridBagLayout());
219                          jPanel1.add(jLabel, gridBagConstraints);                          jPanel1.add(jLabel, gridBagConstraints);
# Line 286  public class SwitchLanguageDialog extend Line 286  public class SwitchLanguageDialog extend
286                  return jComboBox;                  return jComboBox;
287          }          }
288    
289  } // @jve:decl-index=0:visual-constraint="0,0"  }

Legend:
Removed from v.315  
changed lines
  Added in v.1097

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26