From 9751c29b55df512254d2e3f6d605d80f70836298 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 4 Sep 2015 22:22:26 +0200 Subject: [PATCH] =?utf8?q?Renamed=20interface=20...=20Signed-off-by:Roland?= =?utf8?q?=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../addressbook/client/BaseAddressbookClient.java | 4 ++-- .../addressbook/client/console/ConsoleClient.java | 14 +++++++------- .../addressbook/client/gui/AddressbookFrame.java | 10 +++++----- .../manager/contact/AddressbookContactManager.java | 2 +- ...tact.java => ManageableContactAddressbook.java} | 3 ++- 5 files changed, 17 insertions(+), 16 deletions(-) rename src/org/mxchange/addressbook/manager/contact/{ManageableAddressbookContact.java => ManageableContactAddressbook.java} (98%) diff --git a/src/org/mxchange/addressbook/client/BaseAddressbookClient.java b/src/org/mxchange/addressbook/client/BaseAddressbookClient.java index 8f0dc1a..a21dbec 100644 --- a/src/org/mxchange/addressbook/client/BaseAddressbookClient.java +++ b/src/org/mxchange/addressbook/client/BaseAddressbookClient.java @@ -21,7 +21,7 @@ import java.text.MessageFormat; import java.util.HashMap; import java.util.Map; import org.mxchange.addressbook.manager.contact.AddressbookContactManager; -import org.mxchange.addressbook.manager.contact.ManageableAddressbookContact; +import org.mxchange.addressbook.manager.contact.ManageableContactAddressbook; import org.mxchange.addressbook.menu.Menu; import org.mxchange.jcore.client.BaseClient; import org.mxchange.jcore.client.Client; @@ -114,7 +114,7 @@ public abstract class BaseAddressbookClient extends BaseClient implements Addres // Init contact manager with console client // TODO Static initial amount of contacts - ManageableAddressbookContact manager = new AddressbookContactManager((Client) this); + ManageableContactAddressbook manager = new AddressbookContactManager((Client) this); // Set it here this.setManager(manager); diff --git a/src/org/mxchange/addressbook/client/console/ConsoleClient.java b/src/org/mxchange/addressbook/client/console/ConsoleClient.java index 0df415e..082e49b 100644 --- a/src/org/mxchange/addressbook/client/console/ConsoleClient.java +++ b/src/org/mxchange/addressbook/client/console/ConsoleClient.java @@ -26,7 +26,7 @@ import org.mxchange.addressbook.application.AddressbookApplication; import org.mxchange.addressbook.client.AddressbookClient; import org.mxchange.addressbook.client.BaseAddressbookClient; import org.mxchange.addressbook.exceptions.ContactAlreadyAddedException; -import org.mxchange.addressbook.manager.contact.ManageableAddressbookContact; +import org.mxchange.addressbook.manager.contact.ManageableContactAddressbook; import org.mxchange.addressbook.menu.Menu; import org.mxchange.addressbook.menu.MenuTools; import org.mxchange.addressbook.menu.console.ConsoleMenu; @@ -169,7 +169,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC } // Get manager and cast it - ManageableAddressbookContact manager = (ManageableAddressbookContact) this.getManager(); + ManageableContactAddressbook manager = (ManageableContactAddressbook) this.getManager(); // Own street and number String streetNumber = manager.enterOwnStreet(); @@ -211,7 +211,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC } // Get manager and cast it - ManageableAddressbookContact manager = (ManageableAddressbookContact) this.getManager(); + ManageableContactAddressbook manager = (ManageableContactAddressbook) this.getManager(); // Gender: Gender gender = manager.enterOwnGender(); @@ -253,7 +253,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC } // Get manager and cast it - ManageableAddressbookContact manager = (ManageableAddressbookContact) this.getManager(); + ManageableContactAddressbook manager = (ManageableContactAddressbook) this.getManager(); // Phone number String phoneNumber = manager.enterOwnPhoneNumber(); @@ -287,7 +287,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.getLogger().trace("CALLED!"); //NOI18N // Get manager and cast it - ManageableAddressbookContact manager = (ManageableAddressbookContact) this.getManager(); + ManageableContactAddressbook manager = (ManageableContactAddressbook) this.getManager(); // First ask for gender Gender gender = manager.enterOwnGender(); @@ -340,7 +340,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC char choice = this.enterChar(accessKeys, "Bitte Auswahl eingeben (0=Programm beenden): "); // Get manager and cast it - ManageableAddressbookContact manager = (ManageableAddressbookContact) this.getManager(); + ManageableContactAddressbook manager = (ManageableContactAddressbook) this.getManager(); // Try it! try { @@ -641,7 +641,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC char choice = this.enterChar(new char[] {'n', 'a', 'o', 'x'}, "Welchen Daten möchten Sie ändern? (n=Namensdaten, a=Anschriftsdaten, o=Andere, x=Zurück zur Hauptauswahl) "); // Get manager and cast it - ManageableAddressbookContact manager = (ManageableAddressbookContact) this.getManager(); + ManageableContactAddressbook manager = (ManageableContactAddressbook) this.getManager(); // TODO Get rid of this ugly switch block, too switch (choice) { diff --git a/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java b/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java index bd0f448..1d0e3b9 100644 --- a/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java +++ b/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java @@ -50,7 +50,7 @@ import javax.swing.table.TableModel; import org.mxchange.addressbook.BaseAddressbookSystem; import org.mxchange.addressbook.application.AddressbookApplication; import org.mxchange.addressbook.exceptions.ContactAlreadyAddedException; -import org.mxchange.addressbook.manager.contact.ManageableAddressbookContact; +import org.mxchange.addressbook.manager.contact.ManageableContactAddressbook; import org.mxchange.jcore.client.Client; import org.mxchange.jcore.exceptions.FrameAlreadyInitializedException; import org.mxchange.jcore.model.contact.Contact; @@ -215,7 +215,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra this.getLogger().trace(MessageFormat.format("client={0}: CALLED!", client)); //NOI18N // Has the user entered own data? - if (((ManageableAddressbookContact) this.getClient().getManager()).isOwnContactAdded()) { + if (((ManageableContactAddressbook) this.getClient().getManager()).isOwnContactAdded()) { // Debug message this.getLogger().debug("Disabling menus: isOwnContactAdded()=false"); //NOI18N @@ -674,7 +674,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra @Override public void actionPerformed (final ActionEvent e) { try { - ((ManageableAddressbookContact) self.getClient().getManager()).doEnterOwnData(); + ((ManageableContactAddressbook) self.getClient().getManager()).doEnterOwnData(); } catch (final ContactAlreadyAddedException ex) { // Already added, log away // TODO maybe output message here? @@ -702,7 +702,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra @Override public void actionPerformed (final ActionEvent e) { try { - ((ManageableAddressbookContact) self.getClient().getManager()).doChangeOwnData(); + ((ManageableContactAddressbook) self.getClient().getManager()).doChangeOwnData(); } catch (final IOException | SQLException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { self.logException(ex); } @@ -722,7 +722,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ @Override public void actionPerformed (final ActionEvent e) { - ((ManageableAddressbookContact) self.getClient().getManager()).doAddOtherAddress(); + ((ManageableContactAddressbook) self.getClient().getManager()).doAddOtherAddress(); } }); diff --git a/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java b/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java index 072ff62..c7aed6a 100644 --- a/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java +++ b/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java @@ -38,7 +38,7 @@ import org.mxchange.jcore.model.contact.gender.Gender; * @author Roland Haeder * @version 0.0 */ -public class AddressbookContactManager extends BaseManager implements ManageableAddressbookContact { +public class AddressbookContactManager extends BaseManager implements ManageableContactAddressbook { /** * Column name list diff --git a/src/org/mxchange/addressbook/manager/contact/ManageableAddressbookContact.java b/src/org/mxchange/addressbook/manager/contact/ManageableContactAddressbook.java similarity index 98% rename from src/org/mxchange/addressbook/manager/contact/ManageableAddressbookContact.java rename to src/org/mxchange/addressbook/manager/contact/ManageableContactAddressbook.java index 21b3671..f93c982 100644 --- a/src/org/mxchange/addressbook/manager/contact/ManageableAddressbookContact.java +++ b/src/org/mxchange/addressbook/manager/contact/ManageableContactAddressbook.java @@ -25,10 +25,11 @@ import org.mxchange.jcore.model.contact.Contact; import org.mxchange.jcore.model.contact.gender.Gender; /** + * An interface for addressbook contact manager * * @author Roland Haeder */ -public interface ManageableAddressbookContact extends Manageable { +public interface ManageableContactAddressbook extends Manageable { /** * Allows the user to enter own cellphone number. * -- 2.39.5