desktop/desktop-sample/src/main/java/cz/xelfi/quoridor/desktop/sample/LoginPanel.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Tue, 14 Sep 2010 09:58:04 +0200
branchdesktop
changeset 268 13fe01081e23
parent 263 ac802aa234fc
permissions -rw-r--r--
Updating licenses in desktop modules
     1 /**
     2  * Quoridor server and related libraries
     3  * Copyright (C) 2009-2010 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
     4  *
     5  * This program is free software: you can redistribute it and/or modify
     6  * it under the terms of the GNU General Public License as published by
     7  * the Free Software Foundation, either version 3 of the License.
     8  *
     9  * This program is distributed in the hope that it will be useful,
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    12  * GNU General Public License for more details.
    13  *
    14  * You should have received a copy of the GNU General Public License
    15  * along with this program. Look for COPYING file in the top folder.
    16  * If not, see http://www.gnu.org/licenses/.
    17  */
    18 
    19 package cz.xelfi.quoridor.desktop.sample;
    20 
    21 /**
    22  *
    23  * @author Jaroslav Tulach
    24  */
    25 class LoginPanel extends javax.swing.JPanel {
    26 
    27     /** Creates new form LoginPanel */
    28     public LoginPanel() {
    29         initComponents();
    30     }
    31 
    32     /** This method is called from within the constructor to
    33      * initialize the form.
    34      * WARNING: Do NOT modify this code. The content of this method is
    35      * always regenerated by the Form Editor.
    36      */
    37     @SuppressWarnings("unchecked")
    38     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    39     private void initComponents() {
    40 
    41         loginLabel = new javax.swing.JLabel();
    42         login = new javax.swing.JTextField();
    43         passwordLabel = new javax.swing.JLabel();
    44         password = new javax.swing.JPasswordField();
    45 
    46         loginLabel.setText(org.openide.util.NbBundle.getMessage(LoginPanel.class, "LoginPanel.loginLabel.text")); // NOI18N
    47 
    48         login.setText(org.openide.util.NbBundle.getMessage(LoginPanel.class, "LoginPanel.login.text")); // NOI18N
    49 
    50         passwordLabel.setText(org.openide.util.NbBundle.getMessage(LoginPanel.class, "LoginPanel.passwordLabel.text")); // NOI18N
    51 
    52         password.setText(org.openide.util.NbBundle.getMessage(LoginPanel.class, "LoginPanel.password.text")); // NOI18N
    53 
    54         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    55         this.setLayout(layout);
    56         layout.setHorizontalGroup(
    57             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    58             .addGroup(layout.createSequentialGroup()
    59                 .addContainerGap()
    60                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    61                     .addComponent(loginLabel)
    62                     .addComponent(passwordLabel))
    63                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    64                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    65                     .addComponent(password, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)
    66                     .addComponent(login, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE))
    67                 .addContainerGap())
    68         );
    69         layout.setVerticalGroup(
    70             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    71             .addGroup(layout.createSequentialGroup()
    72                 .addContainerGap()
    73                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    74                     .addComponent(loginLabel)
    75                     .addComponent(login, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    76                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
    77                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    78                     .addComponent(passwordLabel)
    79                     .addComponent(password, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    80                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    81         );
    82     }// </editor-fold>//GEN-END:initComponents
    83 
    84 
    85     // Variables declaration - do not modify//GEN-BEGIN:variables
    86     private javax.swing.JTextField login;
    87     private javax.swing.JLabel loginLabel;
    88     private javax.swing.JPasswordField password;
    89     private javax.swing.JLabel passwordLabel;
    90     // End of variables declaration//GEN-END:variables
    91 
    92     public String getLogin() {
    93         return login.getText();
    94     }
    95 
    96     public String getPassword() {
    97         return new String(password.getPassword());
    98     }
    99 }