From de52126ab1b449115b2b583e71d9a8eefa3b13e4 Mon Sep 17 00:00:00 2001 From: Sherwin Price Date: Wed, 18 Feb 2026 15:05:18 -0500 Subject: [PATCH] update project. --- .classpath | 4 +- .../executionHistory/executionHistory.bin | Bin 93429 -> 100511 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 17 bytes .gradle/9.3.1/fileHashes/fileHashes.bin | Bin 24297 -> 25247 bytes .gradle/9.3.1/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .../9.3.1/fileHashes/resourceHashesCache.bin | Bin 19279 -> 19551 bytes .../buildOutputCleanup.lock | Bin 17 -> 17 bytes .gradle/file-system.probe | Bin 8 -> 8 bytes .settings/org.eclipse.buildship.core.prefs | 12 +-- .vscode/launch.json | 11 ++- build.gradle | 11 ++- db/sample.db | 0 .../{View.java => AppSceneView.java} | 5 +- .../edu/bookocontacts/ControlDDXDialog.java | 79 ++++++++++++++++++ src/main/java/edu/bookocontacts/DATASET.java | 38 +++++++++ .../edu/bookocontacts/ViewController.java | 46 ++++++---- .../{PersonFactory.java => Factory.java} | 22 ++++- .../java/edu/bookocontacts/model/Person.java | 45 ++++------ .../media/ControlAddressDDXDialog.fxml | 59 +++++++++++++ 19 files changed, 274 insertions(+), 58 deletions(-) create mode 100644 db/sample.db rename src/main/java/edu/bookocontacts/{View.java => AppSceneView.java} (94%) create mode 100644 src/main/java/edu/bookocontacts/ControlDDXDialog.java create mode 100644 src/main/java/edu/bookocontacts/DATASET.java rename src/main/java/edu/bookocontacts/model/{PersonFactory.java => Factory.java} (70%) create mode 100644 src/main/resources/media/ControlAddressDDXDialog.fxml diff --git a/.classpath b/.classpath index 5dea8e9..ba36a3e 100644 --- a/.classpath +++ b/.classpath @@ -1,12 +1,12 @@ - + - + diff --git a/.gradle/9.3.1/executionHistory/executionHistory.bin b/.gradle/9.3.1/executionHistory/executionHistory.bin index 22f042b9a9030cbbe8a9a5f95773d6aaf4308420..82e44fe73d58f4577efe4db02ebb2789e732fc13 100755 G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radle/9.3.1/executionHistory/executionHistory.lock b/.gradle/9.3.1/executionHistory/executionHistory.lock index 6d9f647ec20fd0d6fc71869cb3bffbfcb65eb8da..88bcc6ecf0926f853a99a6b3b06d9faa06f1acb8 100755 GIT binary patch literal 17 UcmZSXH>umx74fHr0Rj#K05#_Y9smFU literal 17 UcmZSXH>umx74fHr0RlDw05#SH4FCWD diff --git a/.gradle/9.3.1/fileHashes/fileHashes.bin b/.gradle/9.3.1/fileHashes/fileHashes.bin index 761bfc0f1aa09a9eae65eb4deb612c8faf261e20..52eb60d4b7e31a6d381892d4d80b3659d617bc5b 100755 GIT binary patch delta 1761 zcmaF4mvR14#tkMCjO~+6B|ZpDJ^SaMqGHll1~7=_e%c|c;udX>g|OShoORwlh?{9Xgu9&CH<`1cLzi;VKvmQ z|Ibvn)jp}Qe-0HFoqSYALEz=HkY}QOY+Mk*#Os^y%1AH?h<^3*>*v3C10tGmck){~ z1p%?}Gpd3OA2ve-lX54s%3BC1nXOp(=5gdYh+tyzWK;Q*{KcD1n^_$9Ld4=;PW~!C zL%>!t%u9B9)p>|u{Nu^33Jn5&l6^0fcVt9D1d})?|5XSOi2QZ_?JZ5CDu`f$`(#%| zMg9{8`QAz|OCe(M^_ycA7cdG`t(D}?{QEl*D(XA=tCAKI&(4jCKg2g0Byewb^iUIE zDP&#!a&vaX4ko)oUU7biQqF%23=De43=9mK3=9m4AS|%G#Q(~R@2BtYJiYy&@u7kS z1_s7Cg}mbF5FHWgCnrYVmgiflvGs$_P7CqZ%rEZW>;(dJslz5R}mmV<^T*V>1h+4b3cJh!GoO^+4_~fygpk!s7mjeb*#CzW&~9 z(z^Wf=KcL3w-xe=PlD)}Q#)BUPK~9I*L?A0_c*=!LSFNo5E-5$m}YVAYrhzExkO=a ztC#bpE}b}tS>{i`I%aJHQD~vpm1$_-wJt0wc>>EH+ape2AUZ5ggOoCKuULR)M?Hh0 zfY80{z2;xu2C>X8?AvWSClaJ3@8}z7`eIf>)54%A@XIB+aMk3ua@{lKu6)X#{u81j zkr`|W1B)%D4*6@dbpjSolbQTad5gFIN`J79bB3SmAzHZdFtsF$PIp_9e*572Q&*cm zOg-)i(GsBz(IH%csbiCs=f`0G!v!nF{{A>INs0%eqpldDgEbUW2cNv~$rENru0J^R zO~bgC$rX~2&MkTj)#5Ta&{tUAlD{Wn!k@XK9v4>>wk+BWGPaOQ(ifsetZH&$fN*`t zE~#^e+ZIbzt?pf3`JxuAhF4q^qK2&+)9Q=mAJ;huCw;rzuq&(I;f)qlhcrY7>qkr- zBHB?i^$%PX$eO$8t+AAS0#pYmei-T*7y`5d_h}t^i6$Xj+VRE@sXAmYv7B^#3-Wx>fI?T7n^3ICU|dwQAo)HDLwD*AsMP za|~kkwnBA;KyDIm-H~Vp2}2Cp7^??zd=x~M z;S#3fSG@LEwa^LWLKm+=`h1HESkV$E*b)3N7eXgnmE$cWL@}Rq=JToQOWteN3y#hg5LfxyObw?=Ui9ugdZxtb@EZk27&D755E-gHl2V7 z`bbZR2BTyEcwSaFD~s{e)sVXg`F2MRUDdReb%BZw6a!;WsBwGuo6raS5vo?F6z_q zDSSGie(EJ<^~ab>D!ZmDSB~T{W$H{_hJ{6F8OQk9%vq~#7T5eSQA->Vz Lf#_yO4?bo97jP1- diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index bae36ae5555a62f480ae42fc8a7be056b382cf8c..1d3ff0ab0418593d83dd170430509e7cc3b968c1 100755 GIT binary patch literal 17 VcmZRUJyE!~bl?1H1~6cJ001_m1w{Y= literal 17 VcmZRUJyE!~bl?1H1~6dU4*)iU1tb6f diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe index 0058cb92cd18789f0d5ac373b33ac05d42f4449e..80b0e7dc0c507b609a49d31d525ee7326bf6b4de 100755 GIT binary patch literal 8 PcmZQzV4PFPZTJ!Z21)`n literal 8 PcmZQzV4Rb-JLoF_2z&zu diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs index e479558..8e50e0f 100644 --- a/.settings/org.eclipse.buildship.core.prefs +++ b/.settings/org.eclipse.buildship.core.prefs @@ -1,13 +1,13 @@ -arguments= -auto.sync=false +arguments=--init-script /home/sherwinp/.config/VSCodium/User/globalStorage/redhat.java/1.50.0/config_linux/org.eclipse.osgi/58/0/.cp/gradle/init/init.gradle --init-script /home/sherwinp/.config/VSCodium/User/globalStorage/redhat.java/1.50.0/config_linux/org.eclipse.osgi/58/0/.cp/gradle/protobuf/init.gradle +auto.sync=true build.scans.enabled=false connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) connection.project.dir= eclipse.preferences.version=1 gradle.user.home= -java.home= +java.home=/usr/lib/jvm/java-25-openjdk jvm.arguments= offline.mode=false -override.workspace.settings=false -show.console.view=false -show.executions.view=false +override.workspace.settings=true +show.console.view=true +show.executions.view=true diff --git a/.vscode/launch.json b/.vscode/launch.json index 0f3c80c..8c2a506 100755 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,18 +4,25 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "type": "java", + "name": "View", + "request": "launch", + "mainClass": "edu.bookocontacts.AppSceneView", + "projectName": "bookocontacts" + }, { "type": "java", "name": "Windows Current File", "request": "launch", - "mainClass": "${file}", + "mainClass": "edu.bookocontacts.AppSceneView", "vmArgs": " --module-path 'C://Program Files//javafx-25//lib' --add-modules ALL-MODULE-PATH --enable-native-access=javafx.graphics" }, { "type": "java", "name": "Linux Current File", "request": "launch", - "mainClass": "${file}", + "mainClass": "edu.bookocontacts.AppSceneView", "vmArgs": " --module-path '/home/sherwinp/workspace/javafx-sdk/lib/' --add-modules ALL-MODULE-PATH --enable-native-access=javafx.graphics" } ] diff --git a/build.gradle b/build.gradle index 66b3107..95429ef 100755 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ repositories { } application { - mainClass = 'edu.bookocontacts.View' + mainClass = 'edu.bookocontacts.AppSceneView' } sourceSets { @@ -44,9 +44,12 @@ dependencies { implementation("ch.qos.logback:logback-classic:1.5.26") implementation("org.aspectj:aspectjrt:1.9.25") - implementation 'org.openjfx:javafx-base:25.0.2' - implementation 'org.openjfx:javafx-fxml:25.0.2' - implementation 'org.openjfx:javafx-controls:25.0.2' + implementation 'org.xerial:sqlite-jdbc:3.51.2.0' + implementation 'jakarta.activation:jakarta.activation-api:2.1.4' + + implementation 'org.openjfx:javafx-base:25.0.2' + implementation 'org.openjfx:javafx-fxml:25.0.2' + implementation 'org.openjfx:javafx-controls:25.0.2' } diff --git a/db/sample.db b/db/sample.db new file mode 100644 index 0000000..e69de29 diff --git a/src/main/java/edu/bookocontacts/View.java b/src/main/java/edu/bookocontacts/AppSceneView.java similarity index 94% rename from src/main/java/edu/bookocontacts/View.java rename to src/main/java/edu/bookocontacts/AppSceneView.java index 5669337..7b79ba8 100755 --- a/src/main/java/edu/bookocontacts/View.java +++ b/src/main/java/edu/bookocontacts/AppSceneView.java @@ -15,7 +15,7 @@ import javafx.stage.Stage; /** * */ -public class View extends Application { +public class AppSceneView extends Application { private Stage stage; @Override @@ -47,6 +47,9 @@ public class View extends Application { in.close(); } } + + DATASET.FINDDATA(); + } catch (Exception ex) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); } diff --git a/src/main/java/edu/bookocontacts/ControlDDXDialog.java b/src/main/java/edu/bookocontacts/ControlDDXDialog.java new file mode 100644 index 0000000..fb28502 --- /dev/null +++ b/src/main/java/edu/bookocontacts/ControlDDXDialog.java @@ -0,0 +1,79 @@ +package edu.bookocontacts; + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; +import javafx.scene.control.ButtonType; +import javafx.scene.control.Dialog; +import javafx.scene.control.TextField; +import javafx.util.Callback; + +import edu.bookocontacts.model.Address; + +public class ControlDDXDialog extends Dialog
{ + + @FXML + private TextField tfStreet; + @FXML + private TextField tfCity; + @FXML + private TextField tfState; + @FXML + private TextField tfZip; + + public ControlDDXDialog() { + super(); + String fxml = "/media/ControlAddressDDXDialog.fxml"; + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getClassLoader().getResource(fxml)); + fxmlLoader.setController(this); + fxmlLoader.setLocation(getClass().getResource(fxml)); + try { + fxmlLoader.load(); + } catch (IOException exception) { + throw new RuntimeException(exception); + } + getDialogPane().setContent(fxmlLoader.getRoot()); + getDialogPane().getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL); + setTitle("Contact Address Dialog"); + setHeaderText("Enter Details"); + setPropertyBindings(); + setResultConverter(); + } + + private void setPropertyBindings() { + Logger.getLogger(getClass().getName()).log(Level.INFO, "setPropertyBindings called."); + } + + private void setResultConverter() { + Logger.getLogger(getClass().getName()).log(Level.INFO, "setResultConverter called."); + Callback aRC = (buttonType) -> { + if (buttonType == ButtonType.OK) { + if (getStreet().isEmpty() || getCity().isEmpty() || getState().isEmpty() || getZip().isEmpty()) { + return null; + } + return new Address(getStreet(), getCity(), getState(), getZip()); + } + return null; + }; + setResultConverter(aRC); + } + + private String getZip() { + return tfZip.getText(); + } + + private String getState() { + return tfState.getText(); + } + + private String getCity() { + return tfCity.getText(); + } + + private String getStreet() { + return tfStreet.getText(); + } +} diff --git a/src/main/java/edu/bookocontacts/DATASET.java b/src/main/java/edu/bookocontacts/DATASET.java new file mode 100644 index 0000000..4d27d93 --- /dev/null +++ b/src/main/java/edu/bookocontacts/DATASET.java @@ -0,0 +1,38 @@ +package edu.bookocontacts; + +import java.io.File; +import java.io.PrintWriter; +import java.nio.file.Files; +import java.util.ListIterator; +import java.util.logging.Level; +import java.util.logging.Logger; + +import org.sqlite.SQLiteDataSource; + +import edu.bookocontacts.model.Contact; + +public final class DATASET { + public final static ListIterator FINDDATA() { + try { + File rootDir = new File(String.format("%s", DataRepositoryConfig.getPath())); + Files.createDirectories(rootDir.toPath()); + + SQLiteDataSource dataSource = new SQLiteDataSource(); + dataSource.setUrl(String.format("jdbc:sqlite:%ssample.db", DataRepositoryConfig.getPath())); + + dataSource.getConnection(); + } catch (Exception ex) { + Logger.getLogger(DATASET.class.getName()).log(Level.SEVERE, null, ex); + } + + return null; + } + + public final static class DataRepositoryConfig { + public final static String getPath() { + String home = System.getenv("HOME") != null ? System.getenv("HOME") + : System.getenv("HOMEDRIVE") + System.getenv("HOMEPATH"); + return home.replace('\\', '/') + "/workspace/bookocontacts/db/"; + } + } +} diff --git a/src/main/java/edu/bookocontacts/ViewController.java b/src/main/java/edu/bookocontacts/ViewController.java index bb37565..0dcec57 100755 --- a/src/main/java/edu/bookocontacts/ViewController.java +++ b/src/main/java/edu/bookocontacts/ViewController.java @@ -7,12 +7,15 @@ package edu.bookocontacts; import java.util.logging.Level; import java.util.logging.Logger; +import edu.bookocontacts.model.Factory; import edu.bookocontacts.model.Person; -import edu.bookocontacts.model.PersonFactory; +import edu.bookocontacts.model.Address; +import edu.bookocontacts.model.Contact; import java.net.URL; import java.util.Collections; import java.util.Comparator; +import java.util.Optional; import java.util.ResourceBundle; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; @@ -68,18 +71,17 @@ public class ViewController implements Initializable { private int currentPageIndex = 0; private boolean order = true; - private void log(String message){ + private void log(String message) { logger.log(Level.FINE, message); } /** * Initializes the controller class. */ - @Override - public void initialize(URL url, ResourceBundle rb) { + public void initialize(URL location, ResourceBundle resources) { log("initialize"); - persons = FXCollections.observableArrayList(PersonFactory.getAllPersons()); - log(String.format("Person size: %d" , persons.size())); + persons = FXCollections.observableArrayList(Factory.getAll(new Person())); + log(String.format("Person size: %d", persons.size())); sort(); initializeTable(); @@ -100,12 +102,22 @@ public class ViewController implements Initializable { save.setOnAction(new javafx.event.EventHandler() { @Override public void handle(javafx.event.ActionEvent t) { - persons.add(new Person(idTxt.getText(), nameTxt.getText(), Integer.valueOf(ageTxt.getText()))); - sort(); - updatePersonView(); - idTxt.setText(null); - nameTxt.setText(null); - ageTxt.setText(null); + + ControlDDXDialog dialog = new ControlDDXDialog(); + + Optional
result = dialog.showAndWait(); + + if (result.isPresent()) { + System.out.println("result is present."); + // add to storage + // persons.add((Address) result.get()); + // bind to model + // tvInventory.refresh(); + // + // sort(); + // updatePersonView(); + + } } }); @@ -137,7 +149,11 @@ public class ViewController implements Initializable { public void updatePersonView() { log("updatePersonView"); - personView.getItems().setAll(persons.subList(currentPageIndex * itemsPerPage, ((currentPageIndex * itemsPerPage + itemsPerPage <= persons.size()) ? currentPageIndex * itemsPerPage + itemsPerPage : persons.size()))); + personView.getItems() + .setAll(persons.subList(currentPageIndex * itemsPerPage, + ((currentPageIndex * itemsPerPage + itemsPerPage <= persons.size()) + ? currentPageIndex * itemsPerPage + itemsPerPage + : persons.size()))); } private void initializeTable() { @@ -148,7 +164,8 @@ public class ViewController implements Initializable { personViewNameCol.setCellValueFactory(new PropertyValueFactory("Name")); personViewNameCol.sortTypeProperty().addListener(new ChangeListener() { @Override - public void changed(ObservableValue paramObservableValue, SortType paramT1, SortType paramT2) { + public void changed(ObservableValue paramObservableValue, SortType paramT1, + SortType paramT2) { log("NAME Clicked -- sortType = " + paramT1 + ", SortType=" + paramT2); id.setGraphic(null); } @@ -181,4 +198,5 @@ public class ViewController implements Initializable { log("floatCount=" + floatCount + ", intCount=" + intCount); return ((floatCount > intCount) ? ++intCount : intCount); } + } diff --git a/src/main/java/edu/bookocontacts/model/PersonFactory.java b/src/main/java/edu/bookocontacts/model/Factory.java similarity index 70% rename from src/main/java/edu/bookocontacts/model/PersonFactory.java rename to src/main/java/edu/bookocontacts/model/Factory.java index 6339ecf..60855f9 100755 --- a/src/main/java/edu/bookocontacts/model/PersonFactory.java +++ b/src/main/java/edu/bookocontacts/model/Factory.java @@ -10,8 +10,16 @@ import java.util.List; /** * */ -public class PersonFactory { +public class Factory { static int id=0; + + public static List getAll(Person clazz){ + return getAllPersons(); + } + + public static List getAll(Contact clazz){ + return getAllContacts(); + } public static List getAllPersons() { ArrayList list = new ArrayList<>(); @@ -31,8 +39,18 @@ public class PersonFactory { list.add(createPerson("Martha Has a very Long Name", 18)); return list; } - + static Person createPerson(String _name, int _age) { return new Person(Integer.toString(id++),_name, _age); } + + public static List getAllContacts() { + ArrayList list = new ArrayList<>(); + return list; + } + + static Person createContact(String _name, int _age) { + return new Person(Integer.toString(id++),_name, _age); + } + } diff --git a/src/main/java/edu/bookocontacts/model/Person.java b/src/main/java/edu/bookocontacts/model/Person.java index c7fa868..930c91c 100755 --- a/src/main/java/edu/bookocontacts/model/Person.java +++ b/src/main/java/edu/bookocontacts/model/Person.java @@ -8,49 +8,40 @@ package edu.bookocontacts.model; * */ public class Person { - String id; - String name; - int age; + String Id; String Name; int Age; + + public Person(final String Id, final String Name, final int Age) { + this.Id=Id; + this.Name = Name; + this.Age = Age; + } public Person() { + this("", "", 0); } - public Person(String id, String name, int age) { - this.id = id; - this.name = name; - this.age = age; - } - - public String getId() { - return id; + return Id; } - public void setId(String id) { - this.id = id; + public void setId(final String id) { + Id = id; } public String getName() { - return name; + return Name; } - public void setName(String name) { - this.name = name; + public void setName(final String name) { + Name = name; } public int getAge() { - return age; + return Age; } - public void setAge(int age) { - this.age = age; + public void setAge(final int age) { + Age = age; } - @Override - public String toString() { - return "Person{" + "id=" + id + ", name=" + name + ", age=" + age + '}'; - } - - - -} +} \ No newline at end of file diff --git a/src/main/resources/media/ControlAddressDDXDialog.fxml b/src/main/resources/media/ControlAddressDDXDialog.fxml new file mode 100644 index 0000000..7e5f1b5 --- /dev/null +++ b/src/main/resources/media/ControlAddressDDXDialog.fxml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + +