]> git.mxchange.org Git - jaddressbook-lib.git/commitdiff
Introduced initNamePanel() + added entering surname, family name and displays gender...
authorRoland Haeder <roland@mxchange.org>
Tue, 28 Jul 2015 06:40:01 +0000 (08:40 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 28 Jul 2015 06:40:01 +0000 (08:40 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

Addressbook/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java
Addressbook/src/org/mxchange/addressbook/database/backend/csv/Base64CsvDatabaseBackend.java
Addressbook/src/org/mxchange/addressbook/localization/bundle_de_DE.properties
Addressbook/src/org/mxchange/addressbook/localization/bundle_en_US.properties

index b3bcab4c964c6d34e98535990ca827405e37308e..bf0810d779c3f4af00bf93e5bd0d7fee50a3f1ab 100644 (file)
@@ -272,7 +272,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame
                this.addContact.setAutoRequestFocus(true);
                
                // Initial dimension
-               this.addContact.setSize(400, 300);
+               this.addContact.setSize(500, 400);
                
                /*
                 * Add listener which asks for confirmation, if data has been entered
@@ -282,58 +282,8 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame
                 */
                
                // Init 3 panels:
-               // 1) Panel "name" input boxes
-               JPanel namePanel = new JPanel();
-               namePanel.setLayout(new BoxLayout(namePanel, BoxLayout.Y_AXIS));
-               
-               // Set border to titled version
-               namePanel.setBorder(new TitledBorder(this.generateBorderTitle("name")));
-
-               // Add some input boxes for "name" panel
-               JComboBox<Gender> gender = new JComboBox<>(new DefaultComboBoxModel<Gender>());
-
-               // Panel for gender
-               JPanel gPanel = new JPanel();
-               gPanel.setLayout(new GridLayout(1, 2));
-
-               // Set tooltip text
-               gPanel.setToolTipText(this.getBundle().getString("AddressbookFrame.gender.tooltipText"));
-
-               // Gender text field
-               JLabel gLabel = new JLabel(this.getBundle().getString("AddressbookFrame.gender.text"));
-
-               // Add both to gender panel
-               gPanel.add(gLabel);
-               gPanel.add(gender);
-
-               // Add panel to north of "name" panel
-               namePanel.add(gPanel, BorderLayout.NORTH);
-
-               // Panel for surname
-               JPanel sPanel = new JPanel();
-               sPanel.setLayout(new GridLayout(1, 2));
-
-               // Set too tip text
-               sPanel.setToolTipText(this.getBundle().getString("AddressbookFrame.surname.tooltipText"));
-
-               // New label for surname is not needed
-               JLabel sLabel = new JLabel(this.getBundle().getString("AddressbookFrame.surname.text"));
-
-               // And input box
-               JTextField surname = new JTextField(20);
-
-               // Add both to surname panel
-               sPanel.add(sLabel);
-               sPanel.add(surname);
-
-               // Add surname panel to "name" panel
-               namePanel.add(sPanel, BorderLayout.CENTER);
-
-               // Finally add panel to dialog
-               this.addContact.add(namePanel);
-               
-               // Only for developing:
-               /* DEBUG: */ this.addContact.setVisible(true);
+               // 1) "Name" panel
+               initNamePanel();
        }
 
        /**
@@ -478,6 +428,87 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame
                this.frame.add(menuBar, BorderLayout.NORTH);
        }
 
+       /**
+        * Initializes name panel
+        */
+       private void initNamePanel () {
+               // 1) Panel "name" input boxes
+               JPanel namePanel = new JPanel();
+               namePanel.setLayout(new BoxLayout(namePanel, BoxLayout.Y_AXIS));
+               
+               // Set border to titled version
+               namePanel.setBorder(new TitledBorder(this.generateBorderTitle("name")));
+               
+               // Get all genders
+               Gender[] genders = Gender.values();
+               
+               // Init gender combo box
+               JComboBox<Gender> gender = new JComboBox<>(new DefaultComboBoxModel<>(genders));
+               
+               // Panel for gender
+               JPanel gPanel = new JPanel();
+               gPanel.setLayout(new GridLayout(1, 2));
+               
+               // Set tooltip text
+               gPanel.setToolTipText(this.getBundle().getString("AddressbookFrame.gender.tooltipText"));
+               
+               // Gender text field
+               JLabel gLabel = new JLabel(this.getBundle().getString("AddressbookFrame.gender.text"));
+               
+               // Add both to gender panel
+               gPanel.add(gLabel);
+               gPanel.add(gender);
+               
+               // Add gender panel to "name" panel
+               namePanel.add(gPanel);
+               
+               // Panel for surname
+               JPanel sPanel = new JPanel();
+               sPanel.setLayout(new GridLayout(1, 2));
+               
+               // Set too tip text
+               sPanel.setToolTipText(this.getBundle().getString("AddressbookFrame.surname.tooltipText"));
+               
+               // New label for surname is not needed
+               JLabel sLabel = new JLabel(this.getBundle().getString("AddressbookFrame.surname.text"));
+               
+               // And input box
+               JTextField surname = new JTextField(20);
+               
+               // Add both to surname panel
+               sPanel.add(sLabel);
+               sPanel.add(surname);
+               
+               // Add surname panel to "name" panel
+               namePanel.add(sPanel);
+               
+               // Panel for surname
+               JPanel fPanel = new JPanel();
+               fPanel.setLayout(new GridLayout(1, 2));
+               
+               // Set too tip text
+               fPanel.setToolTipText(this.getBundle().getString("AddressbookFrame.familyName.tooltipText"));
+               
+               // New label for surname is not needed
+               JLabel fLabel = new JLabel(this.getBundle().getString("AddressbookFrame.familyName.text"));
+               
+               // And input box
+               JTextField familyName = new JTextField(20);
+               
+               // Add both to surname panel
+               fPanel.add(fLabel);
+               fPanel.add(familyName);
+               
+               // Add family namepanel to "name" panel
+               namePanel.add(fPanel);
+               
+               // Finally add panel to dialog
+               this.addContact.add(namePanel);
+               
+               // Only for developing:
+               /* DEBUG: */ this.addContact.setVisible(true);
+       }
+
        /**
         * Initialize other dialogs (e.g. "Add contact")
         */
index 9efa657126c16795682d5c8a4e8a2eec6305bd07..2715b5e1597c891ed7a4f39dbaea252db515fa20 100644 (file)
@@ -526,6 +526,7 @@ public class Base64CsvDatabaseBackend extends BaseDatabaseBackend implements Csv
                String input = null;
 
                try {
+                       // Read single line
                        String base64 = this.getStorageFile().readLine();
 
                        // Decode BASE-64
index 7cc24c1ce0add1687576b540241e23f2336e4e9e..9fbe609c165d74c494a7c31fe02c8a5199591009 100644 (file)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 AddressbookFrame.menu.file.text=Datei
+AddressbookFrame.menu.addressbook.text=Adressbuch
 AddressbookFrame.statusLabel.initializing.text=Initialisiere ...
 AddressbookFrame.statusLabel.done.text=Fertig.
 AddressbookFrame.statusLabel.shutdown.text=Shuttting down ...
 AddressbookFrame.menuItem.exitProgram.toolTipText=Beendet das Programm und speichert alle Einstellungen ab.
 AddressbookFrame.menuItem.exitProgram.text=Programm beenden
-AddressbookFrame.menu.addressbook.text=Adressbuch
 AddressbookFrame.menuItem.addOwnData.text=Eigene Adresse hinzuf\u00fcgen
 AddressbookFrame.menuItem.addOwnData.toolTipText=Erlaubt das Hinzuf\u00fcgen eigener Daten.
 AddressbookFrame.menuItem.editOwnData.text=Eigene Adresse \u00e4ndern
 AddressbookFrame.menuItem.editOwnData.toolTipText=Erlaubt das \u00c4ndern eigener Daten.
 AddressbookFrame.dialog.addContact.title.text=Neue Adresse hinzuf\u00fcgen
 AddressbookFrame.main.title.text=Adressen auflisten
-AddressbookFrame.border.name.title.text=Anrede, Vorname, Nachname
+AddressbookFrame.border.name.title.text=Anrede, Vorname, Nachname:
 AddressbookFrame.gender.text=Anrede:
 AddressbookFrame.gender.tooltipText=W\u00e4hlen Sie die Anrede aus.
 AddressbookFrame.surname.text=Vorname:
 AddressbookFrame.surname.tooltipText=Geben Sie den Vornamen ein.
+AddressbookFrame.familyName.text=Nachname:
+AddressbookFrame.familyName.tooltipText=Geben Sie den Nachnamen ein.
 BaseContact.gender.unknown.text=Unbekannt
 BaseContact.gender.male.text=Herr
 BaseContact.gender.female.text=Frau
index 8fce7b594c85918175e8c32dfe733817627f552e..1bb83cd4b7f4ea9402bacf1420dcb22473590ada 100644 (file)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 AddressbookFrame.menu.file.text=File
+AddressbookFrame.menu.addressbook.text=Addressbook
 AddressbookFrame.statusLabel.initializing.text=Initializing ...
 AddressbookFrame.statusLabel.done.text=Done.
 AddressbookFrame.statusLabel.shutdown.text=Shuttting down ...
 AddressbookFrame.menuItem.exitProgram.toolTipText=Exits the program and saves all data.
 AddressbookFrame.menuItem.exitProgram.text=Exit program
-AddressbookFrame.addressbookMenu.text=Addressbook
 AddressbookFrame.menuItem.addOwnData.text=Add own address
 AddressbookFrame.menuItem.addOwnData.toolTipText=Allows the user to add own address data
 AddressbookFrame.menuItem.editOwnData.text=Edit own data
 AddressbookFrame.menuItem.editOwnData.toolTipText=Allows the user to edit own address data
 AddressbookFrame.dialog.addContact.title.text=Add new address
 AddressbookFrame.main.title.text=List addresses
+AddressbookFrame.border.name.title.text=Gender, surname, family name:
 AddressbookFrame.gender.text=Gender:
 AddressbookFrame.gender.tooltipText=Choose gender.
 AddressbookFrame.surname.text=Surname:
 AddressbookFrame.surname.tooltipText=Enter surname.
+AddressbookFrame.familyName.text=Family name:
+AddressbookFrame.familyName.tooltipText=Enter family name.
 BaseContact.gender.unknown.text=Unknown
 BaseContact.gender.male.text=Mr.
 BaseContact.gender.female.text=Mrs.