From: Roland Haeder Date: Thu, 1 Oct 2015 12:49:10 +0000 (+0200) Subject: Continued rewriting: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=46b1cb3fbdbf823244f1a58adda62e7cca8ffc2f;p=jaddressbook-lib.git Continued rewriting: - added jcontacts-lib - updated jars - fixed imports Signed-off-by:Roland Häder --- diff --git a/lib/jcontacts-lib.jar b/lib/jcontacts-lib.jar new file mode 100644 index 00000000..60591263 Binary files /dev/null and b/lib/jcontacts-lib.jar differ diff --git a/lib/jcore-swing.jar b/lib/jcore-swing.jar index bcf9b930..c751f576 100644 Binary files a/lib/jcore-swing.jar and b/lib/jcore-swing.jar differ diff --git a/lib/jcore.jar b/lib/jcore.jar index 848bebf4..197b9734 100644 Binary files a/lib/jcore.jar and b/lib/jcore.jar differ diff --git a/nbproject/project.properties b/nbproject/project.properties index 4bf46acc..829a0034 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -30,6 +30,7 @@ dist.jar=${dist.dir}/addressbook-lib.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= +file.reference.jcontacts-lib.jar=lib/jcontacts-lib.jar file.reference.jcore-logger-lib.jar=lib/jcore-logger-lib.jar file.reference.jcore-swing.jar=lib/jcore-swing.jar file.reference.jcore.jar=lib/jcore.jar @@ -41,6 +42,7 @@ javac.classpath=\ ${file.reference.jcore.jar}:\ ${file.reference.jcore-swing.jar}:\ ${file.reference.jcore-logger-lib.jar}:\ + ${file.reference.jcontacts-lib.jar}:\ ${libs.jpa20-persistence.classpath} # Space-separated list of extra javac options javac.compilerargs=-Xlint:deprecation -Xlint:unchecked @@ -90,6 +92,7 @@ run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 +source.reference.jcontacts-lib.jar=../jcontacts-lib/src/ source.reference.jcore-logger-lib.jar=../jcore-logger-lib/src/ source.reference.jcore-swing.jar=../jcore-swing/src source.reference.jcore.jar=../jcore/src diff --git a/src/org/mxchange/addressbook/client/AddressbookClient.java b/src/org/mxchange/addressbook/client/AddressbookClient.java index 7045abe5..ff8442bb 100644 --- a/src/org/mxchange/addressbook/client/AddressbookClient.java +++ b/src/org/mxchange/addressbook/client/AddressbookClient.java @@ -17,11 +17,11 @@ 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.jcore.client.Client; import org.mxchange.jcore.exceptions.MenuInitializationException; import org.mxchange.jcore.exceptions.UnhandledUserChoiceException; -import org.mxchange.jcore.model.contact.Contact; -import org.mxchange.jcore.model.contact.gender.Gender; /** * A special client interface for addressbook applications. @@ -30,6 +30,34 @@ import org.mxchange.jcore.model.contact.gender.Gender; */ public interface AddressbookClient extends Client { + /** + * Displays a "box" for the address + *

+ * @param contact Contact to show address from + */ + public void displayAddressBox (final Contact contact); + + /** + * Displays a "box" for the name + *

+ * @param contact Contact to show name from + */ + public void displayNameBox (final Contact contact); + + /** + * Displays a "box" for other data + *

+ * @param contact Contact to show other data from + */ + public void displayOtherDataBox (final Contact contact); + + /** + * Shows given contact instamce + * + * @param contact Contact instance + */ + public void show (final Contact contact); + /** * The user changes own address data *

diff --git a/src/org/mxchange/addressbook/exceptions/ContactAlreadyAddedException.java b/src/org/mxchange/addressbook/exceptions/ContactAlreadyAddedException.java index c59909f7..53e3ac06 100644 --- a/src/org/mxchange/addressbook/exceptions/ContactAlreadyAddedException.java +++ b/src/org/mxchange/addressbook/exceptions/ContactAlreadyAddedException.java @@ -17,7 +17,7 @@ package org.mxchange.addressbook.exceptions; import java.text.MessageFormat; -import org.mxchange.jcore.model.contact.Contact; +import org.mxchange.jcontacts.contact.Contact; /** * Thrown if the given Contact instance is already added diff --git a/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java b/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java index 9b0a0b33..7670cecf 100644 --- a/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java +++ b/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java @@ -26,11 +26,11 @@ import java.util.Iterator; import java.util.List; import org.mxchange.addressbook.client.AddressbookClient; import org.mxchange.addressbook.exceptions.ContactAlreadyAddedException; +import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcontacts.contact.gender.Gender; import org.mxchange.jcore.client.Client; import org.mxchange.jcore.exceptions.UnhandledUserChoiceException; import org.mxchange.jcore.manager.BaseManager; -import org.mxchange.jcore.model.contact.Contact; -import org.mxchange.jcore.model.contact.gender.Gender; import org.mxchange.jcoreeelogger.beans.local.logger.Log; import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; @@ -238,12 +238,12 @@ public class AddressbookContactManager extends BaseManager implements Manageable // It must be found assert (contact instanceof Contact) : ": contact is not implementing Contact: " + contact; - // Display contact - this.getClient().show(contact); - // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); + // Display contact + client.show(contact); + try { // Ask user what to change client.userChooseChangeContactData(contact); diff --git a/src/org/mxchange/addressbook/manager/contact/ManageableContactAddressbook.java b/src/org/mxchange/addressbook/manager/contact/ManageableContactAddressbook.java index c288c377..ac9b1ebe 100644 --- a/src/org/mxchange/addressbook/manager/contact/ManageableContactAddressbook.java +++ b/src/org/mxchange/addressbook/manager/contact/ManageableContactAddressbook.java @@ -20,9 +20,9 @@ import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import org.mxchange.addressbook.exceptions.ContactAlreadyAddedException; +import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcontacts.contact.gender.Gender; import org.mxchange.jcore.manager.Manageable; -import org.mxchange.jcore.model.contact.Contact; -import org.mxchange.jcore.model.contact.gender.Gender; /** * An interface for addressbook contact manager