From: Roland Haeder Date: Tue, 29 Sep 2015 08:41:39 +0000 (+0200) Subject: auto-formatted project + updated jars X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6728dbd7598e463076ac0c433ee43022b19c32f1;p=jbonuscard-lib.git auto-formatted project + updated jars Signed-off-by:Roland Häder --- diff --git a/ROADMAP.txt b/ROADMAP.txt new file mode 100644 index 0000000..5fdb53f --- /dev/null +++ b/ROADMAP.txt @@ -0,0 +1,85 @@ +============================================ +AddressbookApplication management: +============================================ + +Inernet("public" service) and Intranet + +Version 1.0+: +- Single-user local application +- Fields: + + Gender + + Surname + + Family name + + Company name + + Street + number + + ZIP code + + City + + Landline number + + Fax number + + Cell phone number + + Email address + + Birth day + + Comment (?) +- Edit own data +- Add new contact +- Edit contacts +- Delete contacts +- Categorization of contacts + +Version 1.1+: +- Permanent storage in database + +Version 2.0+: +- Multi-user web application +- Local user registration / login / resend confirmation link / password + recovery +- User groups (aka. teams) +- Administration area (user role) + + Create/edit/delete groups + + Edit/delete/lock/unlock user + + Assign user roles/rights +- Allow other users / groups to view addressbook + + Full addressbook + + Only some categories +- VCard export + + Allow users/guests (not recommended) +- XML export of addressbook and compressable (ZIP) +- Form to contact other user/group without need of mail program + + User can disabled this +- Directory for ussers/groups (who allowed to be listed) + + Simple click to add user to own addressbook + + Search form? + +Version 2.1+: +- Multi-language support + +Version 2.2+:("socialized") +- "Social login" (OpenID consumer) + + Connect user account to social account + + Sync own data? +- "Social profile" + + OpenID provider + + RSS/activity feed + +============================================ +Time esitmation: +============================================ +- 1.0 (console): + + 2 days + +- 1.1 (database): + + 2 day + + Initial tables: contacts, categories, contact_category + +- 2.0 (web): + + 3 days + + Additional tables: admins (?), admin_rights, groups, + users, user_contacts, user_user_rights, user_category_rights, + +- 2.1 (language) + + 1 day + + Additional tables: languages (disable, enable language "pack" ?) + +- 2.2 (social): + + 3 days + + Additional tables: ??? diff --git a/install/tables.sql b/install/tables.sql index a08e1de..527737e 100644 --- a/install/tables.sql +++ b/install/tables.sql @@ -1,42 +1,2 @@ SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; - - -DROP TABLE IF EXISTS `contacts`; -CREATE TABLE IF NOT EXISTS `contacts` ( -`id` bigint(20) unsigned NOT NULL COMMENT 'Primary key', - `own_contact` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Whether own contact', - `gender` varchar(10) NOT NULL DEFAULT 'UNKNOWN' COMMENT 'Gender', - `surname` varchar(100) NOT NULL COMMENT 'Surname', - `family_name` varchar(100) NOT NULL COMMENT 'Family name', - `company_name` varchar(255) DEFAULT NULL COMMENT 'Company name', - `street` varchar(255) DEFAULT NULL COMMENT 'Street name', - `house_number` smallint(5) unsigned DEFAULT NULL COMMENT 'House number', - `city` varchar(100) DEFAULT NULL COMMENT 'City name', - `zip_code` smallint(5) unsigned DEFAULT NULL COMMENT 'ZIP code', - `country_code` char(2) DEFAULT NULL COMMENT 'Country code', - `phone_number` varchar(100) DEFAULT NULL COMMENT 'Phone number', - `cellphone_number` varchar(100) DEFAULT NULL COMMENT 'Cellphone number', - `fax_number` varchar(100) DEFAULT NULL COMMENT 'Fax number', - `email_address` varchar(100) DEFAULT NULL COMMENT 'Email addres', - `birthday` date DEFAULT NULL COMMENT 'Birth day', - `comment` tinytext NOT NULL COMMENT 'Comment', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Entry created', - `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Contacts data' AUTO_INCREMENT=1 ; - - -ALTER TABLE `contacts` - ADD PRIMARY KEY (`id`); - - -ALTER TABLE `contacts` -MODIFY `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key'; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/lib/jcore.jar b/lib/jcore.jar index 7884f3d..bff5c73 100644 Binary files a/lib/jcore.jar and b/lib/jcore.jar differ diff --git a/lib/jswingcore.jar b/lib/jswingcore.jar index f5defa1..c7b85f8 100644 Binary files a/lib/jswingcore.jar and b/lib/jswingcore.jar differ diff --git a/src/org/mxchange/addressbook/application/AddressbookApplication.java b/src/org/mxchange/addressbook/application/AddressbookApplication.java index 3a7279f..dca6fe2 100644 --- a/src/org/mxchange/addressbook/application/AddressbookApplication.java +++ b/src/org/mxchange/addressbook/application/AddressbookApplication.java @@ -30,92 +30,8 @@ import org.mxchange.jcore.exceptions.UnhandledUserChoiceException; import org.mxchange.jcore.manager.application.ApplicationManager; /** - * ============================================ - * AddressbookApplication management: - * ============================================ - * - * Inernet("public" service) and Intranet - * - * Version 1.0+: - * - Single-user local application - * - Fields: - * + Gender - * + Surname - * + Family name - * + Company name - * + Street + number - * + ZIP code - * + City - * + Landline number - * + Fax number - * + Cell phone number - * + Email address - * + Birth day - * + Comment (?) - * - Edit own data - * - Add new contact - * - Edit contacts - * - Delete contacts - * - Categorization of contacts - * - * Version 1.1+: - * - Permanent storage in database - * - * Version 2.0+: - * - Multi-user web application - * - Local user registration / login / resend confirmation link / password - * recovery - * - User groups (aka. teams) - * - Administration area (user role) - * + Create/edit/delete groups - * + Edit/delete/lock/unlock user - * + Assign user roles/rights - * - Allow other users / groups to view addressbook - * + Full addressbook - * + Only some categories - * - VCard export - * + Allow users/guests (not recommended) - * - XML export of addressbook and compressable (ZIP) - * - Form to contact other user/group without need of mail program - * + User can disabled this - * - Directory for ussers/groups (who allowed to be listed) - * + Simple click to add user to own addressbook - * + Search form? - * - * Version 2.1+: - * - Multi-language support - * - * Version 2.2+:("socialized") - * - "Social login" (OpenID consumer) - * + Connect user account to social account - * + Sync own data? - * - "Social profile" - * + OpenID provider - * + RSS/activity feed - * - * ============================================ - * Time esitmation: - * ============================================ - * 1.0 (console): - * + 2 days - * - * 1.1 (database): - * + 2 day - * + Initial tables: contacts, categories, contact_category - * - * 2.0 (web): - * + 3 days - * + Additional tables: admins (?), admin_rights, groups, - * users, user_contacts, user_user_rights, user_category_rights, - * - * 2.1 (language) - * + 1 day - * + Additional tables: languages (disable, enable language "pack" ?) - * - * 2.2 (social): - * + 3 days - * + Additional tables: ??? -* + * Address book application class. Please see ROADMAP.txt for details. + *

* @author Roland Haeder * @version 0.0 */ @@ -143,6 +59,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati /** * Protected constructor + *

* @throws java.io.IOException If any IO error occurs */ protected AddressbookApplication () throws IOException { @@ -287,7 +204,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati /** * Checks whether the client shoule be console client should be launched by * checking if -console is set. - * + *

* @return Whether console client should be taken */ private boolean isConsole () { @@ -297,7 +214,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati /** * Checks whether the client shoule be GUI client should be launched by * checking if -gui is set. - * + *

* @return Whether GUI client should be taken */ private boolean isGui () { @@ -306,7 +223,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati /** * Parses all given arguments - * + *

* @param args Arguments from program launch */ private void parseArguments (final String[] args) { @@ -346,7 +263,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati /** * Launches the application - * + *

* @param args Arguments handled to program */ private void start (final String args[]) { @@ -376,7 +293,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati /** * Main method (entry point) - * + *

* @param args the command line arguments */ public static void main (String[] args) { @@ -392,7 +309,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati /** * Getter for printable application name - * + *

* @return A printable name */ public static String printableTitle () { diff --git a/src/org/mxchange/addressbook/client/AddressbookClient.java b/src/org/mxchange/addressbook/client/AddressbookClient.java index 9147fd9..e884edb 100644 --- a/src/org/mxchange/addressbook/client/AddressbookClient.java +++ b/src/org/mxchange/addressbook/client/AddressbookClient.java @@ -24,42 +24,42 @@ import org.mxchange.jcore.model.contact.gender.Gender; /** * A special client interface for addressbook applications. - * + *

* @author Roland Haeder */ public interface AddressbookClient extends Client { /** * The user changes own name data - * + *

* @param contact */ public void doChangeOwnNameData (final Contact contact); /** * The user changes own address data - * + *

* @param contact Contact instance to change */ public void doChangeOwnAddressData (final Contact contact); /** * The user changes own other data - * + *

* @param contact Constact instance to change */ public void doChangeOwnOtherData (final Contact contact); /** * Allows the user to enter own data - * + *

* @return Finished Contact instance */ public Contact doEnterOwnData (); /** * Asks the user to enter his/her gender (M=Male, F=Female, C=Company) - * + *

* @param message Message to output * @return Gender enum */ @@ -68,7 +68,7 @@ public interface AddressbookClient extends Client { /** * Let the user choose what to change on the address: [n]ame, [a]ddress, * [o]ther - * + *

* @param contact Contact instance to let the user change data * @throws UnhandledUserChoiceException If choice is not supported */ @@ -76,14 +76,14 @@ public interface AddressbookClient extends Client { /** * Asks the user for a choice and proceeds accordingly - * + *

* @throws UnhandledUserChoiceException If choice is not supported */ public void doUserMenuChoice () throws UnhandledUserChoiceException; /** * Asks the the user to enter a single character which must match validChars - * + *

* @param validChars Valid chars that are accepted * @param message Message to user * @return Allowed character @@ -94,7 +94,7 @@ public interface AddressbookClient extends Client { * Reads a string of minimum and maximum length from the user. An empty * string should be generally not allowed, but might be okay for e.g. * company name. - * + *

* @param minLength Minimum length of the string to read * @param maxLength Maximum length of the string to read * @param message Message to user @@ -105,7 +105,7 @@ public interface AddressbookClient extends Client { /** * Reads an integer (int) from the user - * + *

* @param minimum Minimum allowed number * @param maximum Maximum allowed number * @param message Message to user @@ -115,14 +115,14 @@ public interface AddressbookClient extends Client { /** * Setter for current menu choice - * + *

* @param currentMenu Current menu choice */ public void setCurrentMenu (final String currentMenu); /** * Some "Getter" for menu item - * + *

* @param accessKey Key to press to access this menu * @param text Text to show to user * @return @@ -131,7 +131,7 @@ public interface AddressbookClient extends Client { /** * Shows given menu entry in client - * + *

* @param item Menu item to show */ public void showEntry (final SelectableMenuItem item); diff --git a/src/org/mxchange/addressbook/client/BaseAddressbookClient.java b/src/org/mxchange/addressbook/client/BaseAddressbookClient.java index d1551b7..4b42d53 100644 --- a/src/org/mxchange/addressbook/client/BaseAddressbookClient.java +++ b/src/org/mxchange/addressbook/client/BaseAddressbookClient.java @@ -28,9 +28,8 @@ import org.mxchange.jcore.client.Client; /** * A general addressbook client - * - * @author Roland Haeder - * TODO: Find better name + *

+ * @author Roland Haeder TODO: Find better name */ public abstract class BaseAddressbookClient extends BaseClient implements AddressbookClient { @@ -54,7 +53,7 @@ public abstract class BaseAddressbookClient extends BaseClient implements Addres /** * Current menu choice - * + *

* @return the currentMenu */ public final String getCurrentMenu () { @@ -68,7 +67,7 @@ public abstract class BaseAddressbookClient extends BaseClient implements Addres /** * "Getter" for given menu type - * + *

* @param menuType Menu type instance to return * @return Menu or null if not found */ @@ -93,7 +92,7 @@ public abstract class BaseAddressbookClient extends BaseClient implements Addres /** * Getter for menus map - * + *

* @return Map of all menus */ protected final Map getMenus () { @@ -102,7 +101,7 @@ public abstract class BaseAddressbookClient extends BaseClient implements Addres /** * Initializes contact manager - * + *

* @throws java.sql.SQLException If any SQL error occurs */ protected void initContactManager () throws SQLException { @@ -128,7 +127,7 @@ public abstract class BaseAddressbookClient extends BaseClient implements Addres /** * Shows given menu - * + *

* @param menuType Given menu to show */ protected void showMenu (final String menuType) { diff --git a/src/org/mxchange/addressbook/client/console/ConsoleClient.java b/src/org/mxchange/addressbook/client/console/ConsoleClient.java index 18340b7..408ebf0 100644 --- a/src/org/mxchange/addressbook/client/console/ConsoleClient.java +++ b/src/org/mxchange/addressbook/client/console/ConsoleClient.java @@ -41,7 +41,7 @@ import org.mxchange.jcore.model.contact.gender.GenderUtils; /** * A client for the console - * + *

* @author Roland Haeder */ public class ConsoleClient extends BaseAddressbookClient implements AddressbookClient { @@ -53,7 +53,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC /** * Parameterless constructor - * + *

* @param application An instance of an Application class */ public ConsoleClient (final Application application) { @@ -597,7 +597,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC /** * Reads one character - * + *

* @return A single character */ private char readChar () { @@ -619,7 +619,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC /** * Reads an integer (int) from user - * + *

* @return An integer number */ private int readInt () { @@ -649,7 +649,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC /** * Reads a string from a scanner until RETURN is pressed - * + *

* @return Read string from scanner */ private String readString () { diff --git a/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java b/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java index 9afac98..0b3fbf0 100644 --- a/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java +++ b/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java @@ -71,7 +71,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * Singelton getter for this frame instance. - * + *

* @param client Client instance * @return Returns a singelton instance of this frame */ @@ -128,7 +128,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * Creates an instance of this frame with a client instance - * + *

* @param client */ private AddressbookFrame (final Client client) { @@ -185,7 +185,6 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame this.getLogger().trace("EXIT!"); //NOI18N } - /** * Enables main window (frame) */ @@ -206,7 +205,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * Setups the frame, do not set isInitialized here - * + *

* @param client Client instance */ @Override @@ -240,9 +239,8 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame * Initalizes this frame. Having initComponents() exposed (publicly * accessible) means that any other object can initialize components which * you may not want. - * - * @throws - * org.mxchange.jcore.exceptions.FrameAlreadyInitializedException If + *

+ * @throws org.mxchange.jcore.exceptions.FrameAlreadyInitializedException If * this method has been called twice */ @Override @@ -269,7 +267,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * Returns field isInitialized. This flag indicates whether this frame has * been initialized or not. - * + *

* @return Field isInitialized */ @Override @@ -306,7 +304,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * Adds a new menu item with given key to menu instance - * + *

* @param menu Menu instance to add item to * @param key Message key part * @param listener Listener instance @@ -314,23 +312,23 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame private void addMenuItem (final JMenu menu, final String key, final ActionListener listener) { // Trace message this.getLogger().trace(MessageFormat.format("menu={0},key={1},listener={2} - CALLED!", menu, key, listener)); //NOI18N - + // New instance JMenuItem item = this.initMenuItemWithTooltip(key); - + // Add listener item.addActionListener(listener); - + // Add item -> menu menu.add(item); - + // Trace message this.getLogger().trace("EXIT!"); //NOI18N } /** * Adds a JTextField with label and tool tip to given panel - * + *

* @param panel Panel instance to add text field * @param key Part of message key from resource bundle * @param fieldLength Length of text field @@ -338,25 +336,25 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame private void addTextFieldWithLabelToPanel (final JPanel panel, final String key, final int fieldLength) { // Trace message this.getLogger().trace(MessageFormat.format("panel={0},key={1},fieldLength={2} - CALLED!", panel, key, fieldLength)); //NOI18N - + // Init label for given key JLabel label = new JLabel(this.getBundle().getString(String.format("AddressbookFrame.%s.text", key))); //NOI18N - + // And input box wih tool tip JTextField field = new JTextField(fieldLength); field.setToolTipText(this.getBundle().getString(String.format("AddressbookFrame.%s.toolTipText", key))); //NOI18N - + // Add both to panel panel.add(label); panel.add(field); - + // Trace message this.getLogger().trace("EXIT!"); //NOI18N } /** * Generates a title for borders - * + *

* @param key Key part to look for * @return Human-readable title */ @@ -368,7 +366,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * Generates a title for all frames based on given sub title key. If null is * given, the sub title is not generated. - * + *

* @param subKey Key for sub title resource * @return A full application title */ @@ -490,7 +488,9 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame initAddCancelButtons(); // x)Only for developing: - /* DEBUG: */ this.addContact.setVisible(true); + /* + * DEBUG: + */ this.addContact.setVisible(true); // Trace message this.getLogger().trace("EXIT!"); //NOI18N @@ -498,7 +498,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * Initializes address panel - * + *

* @param dialog A JDialog instance to this components to */ private void initAddressDataPanel (final JDialog dialog) { @@ -606,7 +606,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * Initializes a menu item instance with tool tip - * + *

* @param key Message key part * @return A finished JMenuItem instance */ @@ -645,7 +645,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame this.addMenuItem(menu, "exitProgram", new ActionListener() { //NOI18N /** * If the user has performed this action - * + *

* @param e An instance of an ActionEvent class */ @Override @@ -668,7 +668,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame this.addOwnItem.addActionListener(new ActionListener() { /** * If the user has performed this action - * + *

* @param e An instance of an ActionEvent class */ @Override @@ -696,7 +696,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame this.editOwnItem.addActionListener(new ActionListener() { /** * If the user has performed this action - * + *

* @param e An instance of an ActionEvent class */ @Override @@ -717,7 +717,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame this.addMenuItem(menu, "addNewContact", new ActionListener() { //NOI18N /** * If the user has performed this action - * + *

* @param e An instance of an ActionEvent class */ @Override @@ -738,7 +738,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * Initializes name panel - * + *

* @param dialog A JDialog instance to this components to */ private void initNameDataPanel (final JDialog dialog) { @@ -781,9 +781,9 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * Initializes "other" data panel - * - * @param dialog A JDialog instance to this components to - * TODO Fill this with life + *

+ * @param dialog A JDialog instance to this components to TODO Fill this + * with life */ private void initOtherDataPanel (final JDialog dialog) { // Trace message @@ -880,7 +880,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame this.dataTable.addMouseListener(new MouseAdapter() { /** * If the user peformed a click on a cell - * + *

* @param e Mouse event instance */ @Override @@ -906,7 +906,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * Updates status to given type - * + *

* @param type Status type */ private void updateStatus (final String type) { @@ -924,6 +924,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame * Class for "add address" button */ private static class AddActionListener extends BaseFrameworkSystem implements ActionListener { + /** * Dialog instance */ @@ -936,7 +937,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * Constructor for action listener - * + *

* @param dialog Dialog instance to call back * @param frame Frame instance (not JFrame) */ @@ -948,7 +949,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * If the action has been performed - * + *

* @param e The performed action event */ @Override @@ -961,6 +962,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame * Class for "cancel address" button */ private static class CancelActionListener extends BaseFrameworkSystem implements ActionListener { + /** * Dialog instance */ @@ -973,7 +975,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * Constructor for action listener - * + *

* @param dialog Dialog instance to call back * @param frame Frame instance (not JFrame) */ @@ -985,7 +987,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame /** * If the action has been performed - * + *

* @param e The performed action event */ @Override diff --git a/src/org/mxchange/addressbook/client/gui/SwingClient.java b/src/org/mxchange/addressbook/client/gui/SwingClient.java index fe62846..e367f91 100644 --- a/src/org/mxchange/addressbook/client/gui/SwingClient.java +++ b/src/org/mxchange/addressbook/client/gui/SwingClient.java @@ -41,7 +41,7 @@ public class SwingClient extends BaseAddressbookClient implements AddressbookCli /** * Constructor with an Application instance. - * + *

* @param application Application instance */ public SwingClient (final Application application) { @@ -90,7 +90,7 @@ public class SwingClient extends BaseAddressbookClient implements AddressbookCli /** * Shows dialog to enter new contact - * + *

* @return Returns finished Contact instance */ @Override @@ -151,7 +151,7 @@ public class SwingClient extends BaseAddressbookClient implements AddressbookCli /** * Returns a Swing menu item - * + *

* @param accessKey Key to access the menu * @param text Text to show to user * @return A SelectableMenuItem diff --git a/src/org/mxchange/addressbook/exceptions/ContactAlreadyAddedException.java b/src/org/mxchange/addressbook/exceptions/ContactAlreadyAddedException.java index 3eda782..c59909f 100644 --- a/src/org/mxchange/addressbook/exceptions/ContactAlreadyAddedException.java +++ b/src/org/mxchange/addressbook/exceptions/ContactAlreadyAddedException.java @@ -21,10 +21,11 @@ import org.mxchange.jcore.model.contact.Contact; /** * Thrown if the given Contact instance is already added - * + *

* @author Roland Haeder */ public class ContactAlreadyAddedException extends Exception { + /** * Serial number */ @@ -32,7 +33,7 @@ public class ContactAlreadyAddedException extends Exception { /** * Constructor with a Contact instance - * + *

* @param contact Contact that is already added */ public ContactAlreadyAddedException (final Contact contact) { @@ -45,5 +46,5 @@ public class ContactAlreadyAddedException extends Exception { public ContactAlreadyAddedException () { super("Contact already added"); } - + } diff --git a/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java b/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java index 7a5e5ee..805c3a4 100644 --- a/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java +++ b/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java @@ -34,7 +34,7 @@ import org.mxchange.jcore.model.contact.gender.Gender; /** * A manager for contacts. - * + *

* @author Roland Haeder * @version 0.0 */ @@ -53,7 +53,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Constructor which accepts maxContacts for maximum (initial) contacts and * a client instance. - * + *

* @param client Client instance to use * @throws java.sql.SQLException If an SQL error occurs */ @@ -87,11 +87,11 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Adds given Contact instance to list - * + *

* @param contact Contact instance to add */ @Override - public void addContact (final Contact contact) throws ContactAlreadyAddedException { + public void addContact (final Contact contact) throws ContactAlreadyAddedException { // Trace message this.getLogger().trace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N @@ -118,7 +118,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Let the user change address data - * + *

* @param contact Instance to change data */ @Override @@ -130,7 +130,8 @@ public class AddressbookContactManager extends BaseManager implements Manageable if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N - } if (!(this.getClient() instanceof AddressbookClient)) { + } + if (!(this.getClient() instanceof AddressbookClient)) { // Cannot cast throw new IllegalArgumentException(MessageFormat.format("this.getClient()={0} does not implement AddressbookClient", this.getClient())); //NOI18N } @@ -156,7 +157,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Let the user change "name data" - * + *

* @param contact Instance to change data */ @Override @@ -199,9 +200,8 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Let the user change other data - * - * @param contact Instance to change data - * TODO Didn't handle birthday + *

+ * @param contact Instance to change data TODO Didn't handle birthday */ @Override public void doChangeOtherData (final Contact contact) { @@ -237,7 +237,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable * Allows the user to change his/her own data */ @Override - public void doChangeOwnData () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException{ + public void doChangeOwnData () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Trace message this.getLogger().trace("CALLED!"); //NOI18N @@ -326,7 +326,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Shuts down this contact manager - * + *

* @throws java.sql.SQLException If an SQL error occurs * @throws java.io.IOException If an IO error occurs */ @@ -344,7 +344,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Asks the user for his/her cellphone number - * + *

* @return User's cellphone number */ @Override @@ -360,7 +360,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Asks the user for his/her city's name - * + *

* @return City's name of the user */ @Override @@ -376,7 +376,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Asks the user for his/her city's name - * + *

* @return City's name of the user */ @Override @@ -392,7 +392,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Asks the user for his/her company name - * + *

* @return User's company name */ @Override @@ -408,7 +408,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Asks user for his/her own country code - * + *

* @return User's own country code */ @Override @@ -424,7 +424,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Asks user for his/her own country code - * + *

* @return User's own country code */ @Override @@ -440,7 +440,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Asks the user for family name - * + *

* @return Family name of the user */ @Override @@ -456,7 +456,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Asks the user for family name - * + *

* @return Family name of the user */ @Override @@ -472,23 +472,23 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Asks the user for surname - * + *

* @return Surname of the user */ @Override public String enterOwnFirstName () { // Trace message this.getLogger().trace("CALLED!"); //NOI18N - + // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); - + return client.enterString(2, 50, "Bitte geben Sie Ihren Vornamen ein: ", false); } /** * Asks the user for gender, until a valid has been entered - * + *

* @return Gender of the user */ @Override @@ -504,7 +504,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Asks the user for phone number - * + *

* @return Phone number of the user */ @Override @@ -520,7 +520,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Asks the user for own street (including number) - * + *

* @return Own street an number */ @Override @@ -536,7 +536,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Asks the user for own ZIP code - * + *

* @return ZIP code */ @Override @@ -615,7 +615,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Checks whether own contact is already added by checking all entries for * isOwnContact flag - * + *

* @return Whether own contact is already added */ @Override @@ -643,9 +643,8 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * Adds given contact to address book and flushes all entries to database - * - * @param contact Contact being added - * TODO Add check for book size + *

+ * @param contact Contact being added TODO Add check for book size */ @Override public void registerContact (final Contact contact) { @@ -658,10 +657,13 @@ public class AddressbookContactManager extends BaseManager implements Manageable throw new NullPointerException("contact is null"); //NOI18N } try { + // Debug message - /* NOISY-DEBUG: */ this.getLogger().debug(MessageFormat.format("Adding '{0}' '{1}' at pos '{2}' ...", contact.getFirstName(), contact.getFamilyName(), this.size())); //NOI18N + /* + * NOISY-DEBUG: + */ this.getLogger().debug(MessageFormat.format("Adding '{0}' '{1}' at pos '{2}' ...", contact.getFirstName(), contact.getFamilyName(), this.size())); //NOI18N - // Check if contact is found + // Check if contact is found if (((AddressbookContactFrontend) this.getFrontend()).isContactFound(contact)) { // Contact already added // TODO Do something here @@ -708,7 +710,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable String[] tokens = this.getArrayFromString(key, "."); //NOI18N // Token array must contain 4 elements (AddressbookContactManager.columnName.foo.text) - assert(tokens.length == 4) : MessageFormat.format("Array tokens contains not 4 elements: {0}", Arrays.toString(tokens)); //NOI18N + assert (tokens.length == 4) : MessageFormat.format("Array tokens contains not 4 elements: {0}", Arrays.toString(tokens)); //NOI18N // Get pre-last element String columnName = tokens[tokens.length - 2]; @@ -728,7 +730,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable /** * "Getter" for own contact instance or null if not found - * + *

* @return Contact instance or null * @throws java.sql.SQLException If an SQL error occurs * @throws java.io.IOException If an IO error occurs diff --git a/src/org/mxchange/addressbook/manager/contact/ManageableContactAddressbook.java b/src/org/mxchange/addressbook/manager/contact/ManageableContactAddressbook.java index f93c982..7fb7f01 100644 --- a/src/org/mxchange/addressbook/manager/contact/ManageableContactAddressbook.java +++ b/src/org/mxchange/addressbook/manager/contact/ManageableContactAddressbook.java @@ -26,97 +26,98 @@ import org.mxchange.jcore.model.contact.gender.Gender; /** * An interface for addressbook contact manager - * + *

* @author Roland Haeder */ public interface ManageableContactAddressbook extends Manageable { + /** * Allows the user to enter own cellphone number. - * + *

* @return Cellphone number */ public String enterOwnCellNumber (); /** * Allows the user to enter own city name. - * + *

* @return City name */ public String enterOwnCity (); /** * Allows the user to enter comment for own entry. - * + *

* @return Comment */ public String enterOwnComment (); /** * Allows the user to enter own company name. - * + *

* @return Company name */ public String enterOwnCompanyName (); /** * Allows the user to enter own country code. - * + *

* @return Country code */ public String enterOwnCountryCode (); /** * Allows the user to enter own email address. - * + *

* @return Email address */ public String enterOwnEmailAddress (); /** * Allows the user to enter own family name. - * + *

* @return Family name */ public String enterOwnFamilyName (); /** * Allows the user to enter own fax number. - * + *

* @return Fax number */ public String enterOwnFaxNumber (); /** * Allows the user to enter own gender. - * + *

* @return Gender */ public Gender enterOwnGender (); /** * Allows the user to enter own phone number. - * + *

* @return Phone number */ public String enterOwnPhoneNumber (); /** * Allows the user to enter own street and house number. - * + *

* @return Street and house number */ public String enterOwnStreet (); /** * Allows the user to enter own surname. - * + *

* @return Surname */ public String enterOwnFirstName (); /** * Allows the user to enter own ZIP code. - * + *

* @return ZIP code */ public int enterOwnZipCode (); @@ -128,17 +129,17 @@ public interface ManageableContactAddressbook extends Manageable { /** * Adds given contact to address book - * - * @param contact Contact being added - * TODO Add check for book size + *

+ * @param contact Contact being added TODO Add check for book size */ public void registerContact (final Contact contact); /** * Adds given Contact instance to list - * + *

* @param contact Contact instance to add - * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If the contact is already added + * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException + * If the contact is already added */ public void addContact (final Contact contact) throws ContactAlreadyAddedException; @@ -150,7 +151,7 @@ public interface ManageableContactAddressbook extends Manageable { /** * The user can change address data, like street, ZIP code, city and country * of given Contact instance. - * + *

* @param contact Instance to change data */ public void doChangeAddressData (final Contact contact); @@ -158,7 +159,7 @@ public interface ManageableContactAddressbook extends Manageable { /** * The user can change name data, like gender, surname, family name and * company name (if business contact). - * + *

* @param contact Instance to change data */ public void doChangeNameData (final Contact contact); @@ -170,20 +171,21 @@ public interface ManageableContactAddressbook extends Manageable { /** * The user can change other data, like phone numbers or comments. - * + *

* @param contact Instance to change data */ public void doChangeOtherData (final Contact contact); /** * Let the user change own data + *

* @throws java.sql.SQLException If an SQL error occurs * @throws java.io.IOException If an IO error occurs * @throws java.lang.NoSuchMethodException If a method cannot be found * @throws java.lang.IllegalAccessException If a method is not accessible * @throws java.lang.reflect.InvocationTargetException Any other problems? */ - public void doChangeOwnData () throws IOException , SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public void doChangeOwnData () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; /** * Let the user delete other address @@ -192,7 +194,9 @@ public interface ManageableContactAddressbook extends Manageable { /** * Asks user for own data - * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If own contact is already added + *

+ * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException + * If own contact is already added * @throws java.io.IOException If an IO error was found */ public void doEnterOwnData () throws ContactAlreadyAddedException, IOException; @@ -205,7 +209,7 @@ public interface ManageableContactAddressbook extends Manageable { /** * Checks whether own contact is already added by checking all entries for * isOwnContact flag - * + *

* @return Whether own contact is already added * @throws java.io.IOException If an IO error occurs */ @@ -213,39 +217,39 @@ public interface ManageableContactAddressbook extends Manageable { /** * Getter for translated column name at given index. - * + *

* @param columnIndex Column index - * @return Human-readable column name - * TODO: This is needed for TableModel in Swing + * @return Human-readable column name TODO: This is needed for TableModel in + * Swing */ public String getTranslatedColumnName (final int columnIndex); /** * Somewhat "getter" for value from given row and column index - * + *

* @param rowIndex Row index * @param columnIndex Column index * @return Value from given row/column * @throws java.lang.NoSuchMethodException If the method was not found - * @throws java.lang.IllegalAccessException If the accessed method was not public - * @throws java.lang.reflect.InvocationTargetException Something else happened? - * TODO: This is needed for TableModel in Swing + * @throws java.lang.IllegalAccessException If the accessed method was not + * public + * @throws java.lang.reflect.InvocationTargetException Something else + * happened? TODO: This is needed for TableModel in Swing */ public Object getValueFromRowColumn (final int rowIndex, final int columnIndex) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException; /** * Getter for column name at given index. - * + *

* @param columnIndex Column index - * @return Database column name - * TODO: This is needed for TableModel in Swing + * @return Database column name TODO: This is needed for TableModel in Swing */ public String getColumnName (final int columnIndex); /** * Getter for column count - * @return Column count - * TODO: This is needed for TableModel in Swing + *

+ * @return Column count TODO: This is needed for TableModel in Swing */ public int getColumnCount (); } diff --git a/src/org/mxchange/addressbook/menu/AddressbookMenu.java b/src/org/mxchange/addressbook/menu/AddressbookMenu.java index 7f7cc35..c939abd 100644 --- a/src/org/mxchange/addressbook/menu/AddressbookMenu.java +++ b/src/org/mxchange/addressbook/menu/AddressbookMenu.java @@ -25,14 +25,14 @@ import org.mxchange.jcore.client.Client; /** * Utility class for menu structure - * + *

* @author Roland Haeder */ public class AddressbookMenu extends BaseMenu { /** * Copies entries for given type into the menu list - * + *

* @param menuList Menu list for later showing * @param menuType Type of menu * @param client Client instance to call back diff --git a/src/org/mxchange/addressbook/menu/BaseMenu.java b/src/org/mxchange/addressbook/menu/BaseMenu.java index 3e9f79b..a02c885 100644 --- a/src/org/mxchange/addressbook/menu/BaseMenu.java +++ b/src/org/mxchange/addressbook/menu/BaseMenu.java @@ -44,7 +44,7 @@ public class BaseMenu extends BaseFrameworkSystem { /** * Size of menu items - * + *

* @return Count of menu items */ public int getMenuItemsCount () { @@ -53,7 +53,7 @@ public class BaseMenu extends BaseFrameworkSystem { /** * "Getter" for an iterator of this menu's items - * + *

* @return An iterator of all menu items */ public Iterator getMenuItemsIterator () { @@ -62,7 +62,7 @@ public class BaseMenu extends BaseFrameworkSystem { /** * Shows this menu - * + *

* @param client Client instance to call back */ public void show (final Client client) { @@ -96,7 +96,7 @@ public class BaseMenu extends BaseFrameworkSystem { /** * Getter for menu list - * + *

* @return menuList List of menu entries */ protected final List getMenuList () { @@ -105,7 +105,7 @@ public class BaseMenu extends BaseFrameworkSystem { /** * Initializes menu - * + *

* @param menuType Menu type to initialize * @param client CLient to call back */ diff --git a/src/org/mxchange/addressbook/menu/Menu.java b/src/org/mxchange/addressbook/menu/Menu.java index 6fe3c6a..e027a47 100644 --- a/src/org/mxchange/addressbook/menu/Menu.java +++ b/src/org/mxchange/addressbook/menu/Menu.java @@ -22,28 +22,27 @@ import org.mxchange.jcore.client.Client; /** * - * @author Roland Haeder - * TODO find better name + * @author Roland Haeder TODO find better name */ public interface Menu { /** * "Getter" for an iterator on all menu items of the current menu - * + *

* @return Iterator on all menu items */ public Iterator getMenuItemsIterator (); /** * Shows this menu - * + *

* @param client Client instance */ public void show (final Client client); /** * Size of all menu items - * + *

* @return */ public int getMenuItemsCount (); diff --git a/src/org/mxchange/addressbook/menu/MenuTools.java b/src/org/mxchange/addressbook/menu/MenuTools.java index ee03267..943962d 100644 --- a/src/org/mxchange/addressbook/menu/MenuTools.java +++ b/src/org/mxchange/addressbook/menu/MenuTools.java @@ -31,7 +31,7 @@ public class MenuTools extends BaseFrameworkSystem { /** * Gets an array with all available access keys back from given menu map. * This can later be handle to the client's enterChar() method. - * + *

* @param menus A Map with all menus and their entries * @param menuType Menu type * @return An array with available access chars diff --git a/src/org/mxchange/addressbook/menu/console/ConsoleMenu.java b/src/org/mxchange/addressbook/menu/console/ConsoleMenu.java index e4cc9b6..e2b840c 100644 --- a/src/org/mxchange/addressbook/menu/console/ConsoleMenu.java +++ b/src/org/mxchange/addressbook/menu/console/ConsoleMenu.java @@ -30,7 +30,7 @@ public class ConsoleMenu extends BaseMenu implements Menu { /** * Constructor for this menu - * + *

* @param menuType Menu type to initialize * @param client CLient to call back */ diff --git a/src/org/mxchange/addressbook/menu/item/SelectableMenuItem.java b/src/org/mxchange/addressbook/menu/item/SelectableMenuItem.java index a6de00a..f3cf4cc 100644 --- a/src/org/mxchange/addressbook/menu/item/SelectableMenuItem.java +++ b/src/org/mxchange/addressbook/menu/item/SelectableMenuItem.java @@ -26,21 +26,21 @@ public interface SelectableMenuItem { /** * Shows this menu item - * + *

* @param client Client instance */ public void show (final Client client); /** * Access key - * + *

* @return the accessKey */ public char getAccessKey (); /** * Text to user - * + *

* @return the text */ public String getText (); diff --git a/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java b/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java index 091787d..50f8500 100644 --- a/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java +++ b/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java @@ -40,7 +40,7 @@ public class ConsoleMenuItem extends BaseMenuItem implements SelectableMenuItem /** * Constructor for building a console menu with access key and text - * + *

* @param accessKey Access key for this menu entry * @param text Text to show to user */ @@ -51,7 +51,7 @@ public class ConsoleMenuItem extends BaseMenuItem implements SelectableMenuItem /** * Access key - * + *

* @return the accessKey */ @Override @@ -61,7 +61,7 @@ public class ConsoleMenuItem extends BaseMenuItem implements SelectableMenuItem /** * Access key - * + *

* @param accessKey the accessKey to set */ private void setAccessKey (char accessKey) { @@ -70,7 +70,7 @@ public class ConsoleMenuItem extends BaseMenuItem implements SelectableMenuItem /** * Text to user - * + *

* @return the text */ @Override @@ -80,7 +80,7 @@ public class ConsoleMenuItem extends BaseMenuItem implements SelectableMenuItem /** * Text to user - * + *

* @param text the text to set */ private void setText (String text) {