]> git.mxchange.org Git - addressbook-swing.git/commitdiff
using gender for Mr./Mrs. is plain wrong, now "personal title" and "academic
authorRoland Häder <roland@mxchange.org>
Sat, 10 Jun 2017 19:09:30 +0000 (21:09 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 10 Jun 2017 19:09:30 +0000 (21:09 +0200)
title" are being used.

Signed-off-by: Roland Häder <roland@mxchange.org>
docs/VERSIONS.txt
docs/mindmaps/Addressbook Application.mm
src/org/mxchange/addressbook/application/AddressbookApplication.java
src/org/mxchange/addressbook/client/AddressbookClient.java
src/org/mxchange/addressbook/client/console/ConsoleClient.java
src/org/mxchange/addressbook/client/gui/AddressbookFrame.java
src/org/mxchange/addressbook/client/gui/SwingClient.java
src/org/mxchange/addressbook/facade/contact/AddressbookContactFacade.java
src/org/mxchange/addressbook/facade/contact/ContactFacade.java
src/org/mxchange/localization/bundle_de_DE.properties
src/org/mxchange/localization/bundle_en_US.properties

index 9d2566707912b4051367f0e5fe3b929da2a8db2c..760221d5982d014720dd490ea9c98d821242cbe4 100644 (file)
@@ -7,7 +7,7 @@ Inernet("public" service) and Intranet
 Version 1.0+:
 - Single-user local application
 - Fields:
-  + Gender
+  + Personal title
   + Surname
   + Family name
   + Company name
index 42981fab0a20fe7a8c8dc4f4a202df7052f71c58..7a543c75a528276b90d1c0d8f4c03ccadf28ebca 100644 (file)
 </node>
 <node TEXT="Click the link to enter some personal data" ID="ID_1966993495" CREATED="1443604585327" MODIFIED="1443614745419">
 <font NAME="Liberation Sans"/>
-<node TEXT="First name, family name and gender" ID="ID_467871831" CREATED="1443604604023" MODIFIED="1443614745419">
+<node TEXT="First name, family name and title" ID="ID_467871831" CREATED="1443604604023" MODIFIED="1443614745419">
 <font NAME="Liberation Sans"/>
 </node>
 <node TEXT="To make sure the user is really him/her" ID="ID_1598650071" CREATED="1443604615575" MODIFIED="1443614745420">
 <font NAME="Liberation Sans"/>
 <node TEXT="Enter personal data" ID="ID_1304960332" CREATED="1443605949952" MODIFIED="1443614745427">
 <font NAME="Liberation Sans"/>
-<node TEXT="Gender" ID="ID_946054746" CREATED="1443605987049" MODIFIED="1443615261408">
+<node TEXT="Personal title" ID="ID_946054746" CREATED="1443605987049" MODIFIED="1443615261408">
 <icon BUILTIN="fema"/>
 <font NAME="Liberation Sans"/>
 </node>
-<node TEXT="Titles (Dr., Prof.)" ID="ID_1117613838" CREATED="1443613582457" MODIFIED="1443614745428">
+<node TEXT="Academic titles (Dr., Prof.)" ID="ID_1117613838" CREATED="1443613582457" MODIFIED="1443614745428">
 <font NAME="Liberation Sans"/>
 </node>
 <node TEXT="First name" ID="ID_592998632" CREATED="1443605980762" MODIFIED="1443614745428">
 <icon BUILTIN="idea"/>
 <font NAME="Liberation Sans"/>
 </node>
-<node TEXT="Gender" ID="ID_1074968827" CREATED="1443613341685" MODIFIED="1443615261409">
+<node TEXT="Personal title" ID="ID_1074968827" CREATED="1443613341685" MODIFIED="1443615261409">
 <icon BUILTIN="fema"/>
 <font NAME="Liberation Sans"/>
 </node>
index ca1ab325f05c4036c7fc0c86086602872e17e06a..84e3fbf94fa238758ce534c007cdf6c9a5bdb66d 100644 (file)
@@ -249,7 +249,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati
                // Is the bundle initialized?
                if (!isBundledInitialized()) {
                        // Temporary initialize default bundle
-                       // TODO The enum Gender uses this
+                       // TODO The enum PersonalTitle uses this
                        this.initBundle();
                }
        }
index 57dbc6520618ef67d859bf65dc9067c968d880ab..5136aab8ba384985e5104238293470b6bb3b9e06 100644 (file)
@@ -18,7 +18,7 @@ package org.mxchange.addressbook.client;
 
 import org.mxchange.addressbook.menu.item.SelectableMenuItem;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.gender.Gender;
+import org.mxchange.jcontacts.contact.title.PersonalTitle;
 import org.mxchange.jcore.client.Client;
 import org.mxchange.jcore.exceptions.MenuInitializationException;
 import org.mxchange.jcore.exceptions.UnhandledUserChoiceException;
@@ -106,13 +106,13 @@ public interface AddressbookClient extends Client {
        char enterChar (final char[] validChars, final String message);
 
        /**
-        * Asks the user to enter his/her gender (M=Male, F=Female, C=Company)
+        * Asks the user to enter his/her personal title (M=Male, F=Female, C=Company)
         * <p>
         * @param message Message to output
         * <p>
-        * @return Gender enum
+        * @return PersonalTitle enum
         */
-       Gender enterGender (final String message);
+       PersonalTitle enterPersonalTitle (final String message);
 
        /**
         * Reads an integer (int) from the user
index 935a347aa24d02c3a3b562cd27f42d062234911e..a5f59d63d66b3e929f544833ed530aa90f3a4d73 100644 (file)
@@ -32,8 +32,8 @@ import org.mxchange.addressbook.menu.item.SelectableMenuItem;
 import org.mxchange.addressbook.menu.item.console.ConsoleMenuItem;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.UserContact;
-import org.mxchange.jcontacts.contact.gender.Gender;
-import org.mxchange.jcontacts.contact.gender.GenderUtils;
+import org.mxchange.jcontacts.contact.title.PersonalTitle;
+import org.mxchange.jcontacts.contact.title.PersonalTitleUtils;
 import org.mxchange.jcontactsbusiness.exceptions.BusinessContactAlreadyAddedException;
 import org.mxchange.jcore.application.Application;
 import org.mxchange.jcore.exceptions.MenuInitializationException;
@@ -103,11 +103,11 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC
                        throw new NullPointerException("contact is null"); //NOI18N
                }
 
-               // Get translated gender as the user may want to see "Mr.", "Mrs."
-               String gender = GenderUtils.getTranslatedGender(contact);
+               // Get translated title as the user may want to see "Mr.", "Mrs."
+               String title = PersonalTitleUtils.getTranslatedPersonalTitle(contact);
 
-               // Now put all together: gender, surname, family name
-               this.outputMessage(MessageFormat.format("Anrede, Vorname, Name: {0} {1} {2}", gender, contact.getContactFirstName(), contact.getContactFamilyName()));
+               // Now put all together: title, surname, family name
+               this.outputMessage(MessageFormat.format("Anrede, Vorname, Name: {0} {1} {2}", title, contact.getContactFirstName(), contact.getContactFamilyName()));
 
                // Trace message
                this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
@@ -193,8 +193,8 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC
                // Get manager and cast it
                ContactFacade manager = (ContactFacade) this.getFacade();
 
-               // Gender:
-               Gender gender = manager.enterOwnGender();
+               // PersonalTitle:
+               PersonalTitle title = manager.enterOwnPersonalTitle();
 
                // Surname
                String firstName = manager.enterOwnFirstName();
@@ -203,7 +203,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC
                String familyName = manager.enterOwnFamilyName();
 
                // Update contact instance
-               contact.setContactGender(gender);
+               contact.setContactPersonalTitle(title);
                contact.setContactFirstName(firstName);
                contact.setContactFamilyName(familyName);
 
@@ -265,8 +265,8 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC
                // Get manager and cast it
                ContactFacade manager = (ContactFacade) this.getFacade();
 
-               // First ask for gender
-               Gender gender = manager.enterOwnGender();
+               // First ask for title
+               PersonalTitle title = manager.enterOwnPersonalTitle();
 
                // 2nd for first name
                String firstName = manager.enterOwnFirstName();
@@ -275,7 +275,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC
                String familyName = manager.enterOwnFamilyName();
 
                // Construct UserContact instance
-               Contact contact = new UserContact(gender, firstName, familyName);
+               Contact contact = new UserContact(title, firstName, familyName);
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} - EXIT!", contact)); //NOI18N
@@ -402,23 +402,23 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC
        }
 
        @Override
-       public Gender enterGender (final String message) {
+       public PersonalTitle enterPersonalTitle (final String message) {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("message={0} - CALLED!", message)); //NOI18N
 
                // Get valid chars
-               char[] validChars = Gender.validChars();
+               char[] validChars = PersonalTitle.validChars();
 
                // Debug message
                //* NOISY-DEBUG: */ System.out.println(validChars);
                // Call inner method
-               char gender = this.enterChar(validChars, message);
+               char title = this.enterChar(validChars, message);
 
-               // Now get a Gender instance back
-               Gender g = Gender.fromChar(gender);
+               // Now get a PersonalTitle instance back
+               PersonalTitle g = PersonalTitle.fromChar(title);
 
                // g must not be null
-               assert (g instanceof Gender) : "g is not set."; //NOI18N
+               assert (g instanceof PersonalTitle) : "g is not set."; //NOI18N
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("g={0} - EXIT!", g)); //NOI18N
index 975c03220786f15a7a4fddbefdb16c184e6fc932..aab109f8c9ceb5ad3486376204a93435106c10e8 100644 (file)
@@ -50,7 +50,7 @@ import org.mxchange.addressbook.BaseAddressbookSystem;
 import org.mxchange.addressbook.application.AddressbookApplication;
 import org.mxchange.addressbook.facade.contact.ContactFacade;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.gender.Gender;
+import org.mxchange.jcontacts.contact.title.PersonalTitle;
 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
 import org.mxchange.jcore.application.Application;
 import org.mxchange.jcore.client.Client;
@@ -777,19 +777,19 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                // Set border to titled version
                namePanel.setBorder(new TitledBorder(this.generateBorderTitle("name"))); //NOI18N
 
-               // Gender text field
-               JLabel gLabel = new JLabel(this.getBundle().getString("AddressbookFrame.gender.text"));
+               // PersonalTitle text field
+               JLabel gLabel = new JLabel(this.getBundle().getString("AddressbookFrame.title.text"));
 
-               // Get all genders
-               Gender[] genders = Gender.values();
+               // Get all titles
+               PersonalTitle[] titles = PersonalTitle.values();
 
-               // Init gender combo box with tool tip
-               JComboBox<Gender> gender = new JComboBox<>(new DefaultComboBoxModel<>(genders));
-               gender.setToolTipText(this.getBundle().getString("AddressbookFrame.gender.toolTipText"));
+               // Init title combo box with tool tip
+               JComboBox<PersonalTitle> title = new JComboBox<>(new DefaultComboBoxModel<>(titles));
+               title.setToolTipText(this.getBundle().getString("AddressbookFrame.title.toolTipText"));
 
-               // Add both to gender panel
+               // Add both to title panel
                namePanel.add(gLabel);
-               namePanel.add(gender);
+               namePanel.add(title);
 
                // Add text field for surname
                this.addTextFieldWithLabelToPanel(namePanel, "surname", 20); //NOI18N
index 926382d2f3e1b73ae75b2bba367f8805eda83c17..0582aa8f5fbdec47ad6c9095c95a38a4be815741 100644 (file)
@@ -22,7 +22,7 @@ import org.mxchange.addressbook.client.AddressbookClient;
 import org.mxchange.addressbook.client.BaseAddressbookClient;
 import org.mxchange.addressbook.menu.item.SelectableMenuItem;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.gender.Gender;
+import org.mxchange.jcontacts.contact.title.PersonalTitle;
 import org.mxchange.jcore.application.Application;
 import org.mxchange.jcore.exceptions.FrameAlreadyInitializedException;
 import org.mxchange.jcore.exceptions.UnhandledUserChoiceException;
@@ -136,7 +136,7 @@ public class SwingClient extends BaseAddressbookClient implements AddressbookCli
        }
 
        @Override
-       public Gender enterGender (final String message) {
+       public PersonalTitle enterPersonalTitle (final String message) {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. //NOI18N
        }
 
index 01f8be0f1c00d7beb26f8ecdb2458282ffa4f54c..74d3653cc1d83676246004085a41a78e0cec8eb0 100644 (file)
@@ -25,7 +25,7 @@ import java.util.Iterator;
 import java.util.List;
 import org.mxchange.addressbook.client.AddressbookClient;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.gender.Gender;
+import org.mxchange.jcontacts.contact.title.PersonalTitle;
 import org.mxchange.jcontactsbusiness.exceptions.BusinessContactAlreadyAddedException;
 import org.mxchange.jcore.client.Client;
 import org.mxchange.jcore.exceptions.UnhandledUserChoiceException;
@@ -409,14 +409,14 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad
        }
 
        @Override
-       public Gender enterOwnGender () {
+       public PersonalTitle enterOwnPersonalTitle () {
                // Trace message
                this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
 
                // Get and cast client instance
                AddressbookClient client = (AddressbookClient) this.getClient();
 
-               return client.enterGender("Bitte geben Sie die Anrede ein: (M=Herr, F=Frau, C=Firma): ");
+               return client.enterPersonalTitle("Bitte geben Sie die Anrede ein: (M=Herr, F=Frau, C=Firma): ");
        }
 
        @Override
index 290ebfc632fc39891c23910dba056b82b2f0a81c..894bfc2bdb32794c8069014eee4d303c4825bc2a 100644 (file)
@@ -18,7 +18,7 @@ package org.mxchange.addressbook.facade.contact;
 
 import java.io.IOException;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.gender.Gender;
+import org.mxchange.jcontacts.contact.title.PersonalTitle;
 import org.mxchange.jcontactsbusiness.exceptions.BusinessContactAlreadyAddedException;
 import org.mxchange.jcore.facade.Facade;
 import org.mxchange.jcountry.data.Country;
@@ -57,7 +57,7 @@ public interface ContactFacade extends Facade {
        void doChangeAddressData (final Contact contact);
 
        /**
-        * The user can change name data, like gender, surname, family name and
+        * The user can change name data, like title, surname, family name and
         * company name (if business contact).
         * <p>
         * @param contact Instance to change data
@@ -169,11 +169,11 @@ public interface ContactFacade extends Facade {
        String enterOwnFirstName ();
 
        /**
-        * Allows the user to enter own gender.
+        * Allows the user to enter own title.
         * <p>
-        * @return Gender
+        * @return PersonalTitle
         */
-       Gender enterOwnGender ();
+       PersonalTitle enterOwnPersonalTitle ();
 
        /**
         * Allows the user to enter own phone number.
index bc2ec9c0fb9d0c9b83d122b770b08876c730ab5a..cc12ea1e08a78201dc4921baa91966bfb57eeaed 100644 (file)
@@ -32,8 +32,8 @@ AddressbookFrame.menuItem.addNewContact.text=Neue Adresse hinzuf\u00fcgen
 AddressbookFrame.menuItem.addNewContact.toolTipText=Eine neue Adresse hinzuf\u00fcgen.
 AddressbookFrame.dialog.addContact.title.text=Neue Adresse hinzuf\u00fcgen
 AddressbookFrame.main.title.text=Adressen auflisten
-AddressbookFrame.gender.text=Anrede:
-AddressbookFrame.gender.toolTipText=W\u00e4hlen Sie die Anrede aus.
+AddressbookFrame.title.text=Anrede:
+AddressbookFrame.title.toolTipText=W\u00e4hlen Sie die Anrede aus.
 AddressbookFrame.surname.text=Vorname:
 AddressbookFrame.surname.toolTipText=Geben Sie den Vornamen ein.
 AddressbookFrame.familyName.text=Nachname:
@@ -56,10 +56,9 @@ AddressbookFrame.faxNumber.text=Fax:
 AddressbookFrame.faxNumber.toolTipText=Geben Sie die Faxnummer ein.
 AddressbookFrame.comment.text=Anmerkungen:
 AddressbookFrame.comment.toolTipText=Geben Sie eine Anmerkung (Freifeld) ein.
-GENDER_MALE=Herr
-GENDER_FEMALE=Frau
-GENDER_COMPANY=Firma
-ContactManager.columnName.gender.text=Anrede
+PERSONAL_TITLE_MR=Herr
+PERSONAL_TITLE_MRS=Frau
+ContactManager.columnName.title.text=Anrede
 ContactManager.columnName.surname.text=Vorname
 ContactManager.columnName.familyName.text=Nachname
 ContactManager.columnName.street.text=Strasse
index a5d3e0fac43cb808a11205047245c0a4c65949a9..3c11200d6032ab12e711ab4f10f059c50c1ecdc5 100644 (file)
@@ -12,7 +12,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
-AddressbookFrame.border.name.title.text=Gender, surname, family name:
+AddressbookFrame.border.name.title.text=Title, surname, family name:
 AddressbookFrame.border.address.title.text=Address:
 AddressbookFrame.border.other.title.text=Other data:
 AddressbookFrame.button.addAddress.text=Add address
@@ -32,8 +32,8 @@ AddressbookFrame.menuItem.addNewContact.text=Add new address
 AddressbookFrame.menuItem.addNewContact.toolTipText=Add a new address.
 AddressbookFrame.dialog.addContact.title.text=Add new address
 AddressbookFrame.main.title.text=List addresses
-AddressbookFrame.gender.text=Gender:
-AddressbookFrame.gender.toolTipText=Choose gender.
+AddressbookFrame.title.text=Title:
+AddressbookFrame.title.toolTipText=Choose title.
 AddressbookFrame.surname.text=Surname:
 AddressbookFrame.surname.toolTipText=Enter surname.
 AddressbookFrame.familyName.text=Family name:
@@ -56,10 +56,9 @@ AddressbookFrame.faxNumber.text=Fax:
 AddressbookFrame.faxNumber.toolTipText=Enter fax number.
 AddressbookFrame.comment.text=Note:
 AddressbookFrame.comment.toolTipText=Enter a note (free field).
-GENDER_MALE=Mr.
-GENDER_FEMALE=Mrs.
-GENDER_COMPANY=Company
-ContactManager.columnName.gender.text=Gender
+PERSONAL_TITLE_MR=Mr.
+PERSONAL_TITLE_MRS=Mrs.
+ContactManager.columnName.title.text=Title
 ContactManager.columnName.surname.text=Surname
 ContactManager.columnName.familyName.text=Family name
 ContactManager.columnName.street.text=Street