update projects.

This commit is contained in:
2026-02-11 20:21:12 -05:00
parent e3c1add817
commit 7750cf3b83
17 changed files with 534 additions and 8 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="bin/main" path="src/main/java"> <classpathentry kind="src" output="bin/main" path="src/main/resources">
<attributes> <attributes>
<attribute name="gradle_scope" value="main"/> <attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/> <attribute name="gradle_used_by_scope" value="main,test"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" output="bin/main" path="src/main/resources"> <classpathentry kind="src" output="bin/main" path="src/main/java">
<attributes> <attributes>
<attribute name="gradle_scope" value="main"/> <attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/> <attribute name="gradle_used_by_scope" value="main,test"/>
@@ -0,0 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=ignore
org.eclipse.jdt.core.compiler.codegen.targetPlatform=25
org.eclipse.jdt.core.compiler.compliance=25
org.eclipse.jdt.core.compiler.source=25
+3
View File
@@ -37,6 +37,9 @@ dependencies {
implementation 'org.openjfx:javafx-controls:25.0.1' implementation 'org.openjfx:javafx-controls:25.0.1'
implementation 'org.openjfx:javafx-graphics:25.0.1' implementation 'org.openjfx:javafx-graphics:25.0.1'
implementation 'org.openjfx:javafx-web:25.0.1' implementation 'org.openjfx:javafx-web:25.0.1'
implementation project(':edu.addressbook')
} }
// Apply a specific Java toolchain to ease working on different environments. // Apply a specific Java toolchain to ease working on different environments.
@@ -26,7 +26,7 @@ public class ApplicationView extends Application {
}); });
webEngine.setJavaScriptEnabled(true); webEngine.setJavaScriptEnabled(true);
primaryStage.setTitle("View"); primaryStage.setTitle("AddressBook View");
try { try {
String htmlUrl = getClass().getResource(page).toExternalForm(); String htmlUrl = getClass().getResource(page).toExternalForm();
webEngine.load(htmlUrl); webEngine.load(htmlUrl);
@@ -0,0 +1,45 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>View</title>
<script src="js/jquery.min.js"></script>
<link rel="stylesheet" href="css/datatables.min.css">
</head>
<body>
<main class="main">
<ul>
<li>Search</li>
<li><a href="index.html">Close</a></li>
</ul>
<div class="main-content" style="height: 600px; width: 400px;">
<table id="myTable" class="display">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Data 1</td>
<td>Row 1 Data 2</td>
</tr>
<tr>
<td>Row 2 Data 1</td>
<td>Row 2 Data 2</td>
</tr>
</tbody>
</table>
</div>
</main>
</body>
<script src="js/datatables.min.js"></script>
<script>
"use strict"
let table = new DataTable('#myTable');
</script>
</html>
File diff suppressed because one or more lines are too long
@@ -0,0 +1,50 @@
html {
padding: 0px;
margin: 0px;
}
body {
height: 100vh;
margin: 0;
min-width: 240px;
min-height: 610px;
}
main {
background-color: #af85db;
justify-content: center;
align-items: center;
}
ul.billboard {
display: block;
border-block-style: 2px solid #000;
}
ul.billboard li {
float: left;
list-style: none;
padding-left: 2rem;
}
div.billboard {
display: block;
padding-left: 300px;
padding-right: 300px;
padding-top: 200px;
padding-bottom: 300px;
background-color: #af85db;
border-block-style: 2px solid #000;
}
div.billboard-content {
display: block;
width: 200px;
background-color: #efefef;
padding-left: 1rem;
padding-right: 1rem;
padding-top: 1rem;
padding-bottom: 1rem;
border-radius: 8px;
}
@@ -5,12 +5,22 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>View</title> <title>View</title>
<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
<script src="js/jquery.js"></script>
</head> </head>
<body> <body>
<main> <main class="main">
<label>Hello World.</label> <ul class="billboard">
<li><a role="tab" href="book.html"><b>Browse</b></a></li>
</ul>
<div class="billboard">
<div class="billboard-content">
<div><b>Sherwin Price</b></div>
<hr />
<div><b>Address Book</b></div>
</div>
</div>
</main> </main>
</body> </body>
</html> </html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
"use strict";
document.addEventListener("readystatechange", (event) => {
const ul = document.getElementById('log');
const li = document.createElement('li');
const p = document.createElement('p');
p.textContent += `readystate: ${document.readyState}\n`;
li.appendChild(p);
ul.appendChild(li);
});
@@ -0,0 +1,114 @@
/**
* license: GPLv3
reservationsystem
*/
package edu.addressbook.model;
public final class Address{
String street;
String city;
String state;
String zip;
/** not used
*
*/
public Address() {
}
public Address(String street, String city, String state, String zip) {
this.street = street;
this.city = city;
this.state = state;
this.zip = zip;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getZip() {
return zip;
}
public void setZip(String zip) {
this.zip = zip;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((street == null) ? 0 : street.hashCode());
result = prime * result + ((city == null) ? 0 : city.hashCode());
result = prime * result + ((state == null) ? 0 : state.hashCode());
result = prime * result + ((zip == null) ? 0 : zip.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Address other = (Address) obj;
if (street == null) {
if (other.street != null)
return false;
} else if (!street.equals(other.street))
return false;
if (city == null) {
if (other.city != null)
return false;
} else if (!city.equals(other.city))
return false;
if (state == null) {
if (other.state != null)
return false;
} else if (!state.equals(other.state))
return false;
if (zip == null) {
if (other.zip != null)
return false;
} else if (!zip.equals(other.zip))
return false;
return true;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{ \"Address\":{");
sb.append("\"street\": \"" + street + "\",");
sb.append("\"city\": \"" + city + "\",");
sb.append("\"state\": \"" + state + "\",");
sb.append("\"zip\": \"" + zip + "\"");
sb.append("}}");
return sb.toString();
}
}
@@ -0,0 +1,144 @@
/**
* license: GPLv3
reservationsystem
*/
package edu.addressbook.model;
import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ListIterator;
/**
* Concrete account data class for account json storage record.
* Collects account attributes, and hash instance to enforce uniqueness.
*/
public class Contact {
private Integer contact_id = null;
private String phone_number;
private Address mailing_address;
private EmailAddress email_address;
public Contact() {
}
public Contact(
String phone_number,
Address mailing_address,
EmailAddress email_address) {
this.phone_number = phone_number;
this.mailing_address = mailing_address;
this.email_address = email_address;
}
public Contact(Address mailing_address, EmailAddress email_address)
throws IllegalArgumentException {
if (phone_number == null) {
throw new IllegalArgumentException(String.format("%s %s", "Account: requires phone number",
mailing_address.toString()));
}
if (mailing_address == null) {
throw new IllegalArgumentException(String.format("%s %s", "Account: requires mailing address",
phone_number.substring(phone_number.length() - 4)));
}
if (email_address == null) {
throw new IllegalArgumentException(String.format("%s %s", "Account: requires phone number",
mailing_address.toString()));
}
this.phone_number = phone_number;
this.mailing_address = mailing_address;
this.email_address = email_address;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{ \"Account\":{");
sb.append("\"account_number\": \"").append(contact_id).append("\",");
sb.append("\"phone_number\": \"").append(phone_number).append("\",");
sb.append("\"mailing_address\": ").append(mailing_address).append(",");
sb.append("\"email_address\": ").append(email_address).append(",");
sb.append("}}");
return sb.toString();
}
public static void Write(Contact acct) throws IOException {
}
public String getPhone_number() {
return phone_number;
}
public void setPhone_number(String phone_number) {
this.phone_number = phone_number;
}
public Address getMailing_address() {
return mailing_address;
}
public void setMailing_address(Address mailing_address) {
this.mailing_address = mailing_address;
}
public EmailAddress getEmail_address() {
return email_address;
}
public void setEmail_address(EmailAddress email_address) {
this.email_address = email_address;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((contact_id == null) ? 0 : contact_id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Contact other = (Contact) obj;
if (contact_id == null) {
if (other.contact_id != null)
return false;
} else if (!contact_id.equals(other.contact_id))
return false;
return true;
}
public boolean checkValid() throws IllegalArgumentException {
if (email_address == null) {
throw new IllegalArgumentException(
String.format("not valid, email_address %s", this.contact_id));
}
if (phone_number == null) {
throw new IllegalArgumentException(
String.format("not valid, phone_number: %s", this.contact_id));
}
if (getMailing_address() == null) {
throw new IllegalArgumentException(
String.format("not valid, mailing_address: %s", this.contact_id));
}
return true;
}
public void update(Contact acct) {
this.setEmail_address(acct.email_address);
this.setPhone_number(acct.phone_number);
this.setMailing_address(acct.mailing_address);
}
}
@@ -0,0 +1,56 @@
/**
* license: GPLv3
reservationsystem
*/
package edu.addressbook.model;
public class EmailAddress{
String email_address;
public EmailAddress(String email_address) {
this.email_address = email_address;
}
public String getEmail_address() {
return email_address;
}
public void setEmail_address(String email_address) {
this.email_address = email_address;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((email_address == null) ? 0 : email_address.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EmailAddress other = (EmailAddress) obj;
if (email_address == null) {
if (other.email_address != null)
return false;
} else if (!email_address.equals(other.email_address))
return false;
return true;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{ \"EmailAddress\":{");
sb.append("\"email\": \"" + email_address + "\"");
sb.append("}}");
return sb.toString();
}
}
@@ -1,3 +1,3 @@
module edu.addressbook { module edu.addressbook {
exports edu.addressbook;
} }
+49
View File
@@ -17,3 +17,52 @@ Tests with ASPECTJ:
/ or on linux: / or on linux:
sh ./gradlew edu.addressbook.view:run sh ./gradlew edu.addressbook.view:run
AspectJ Referee component will call the Game plays. AspectJ Referee component will call the Game plays.
schema
CREATE TABLE contact (
contact_id NUMBER PRIMARY KEY,
first_name TEXT,
last_name TEXT
);
CREATE TABLE phone (
contact_id NUMBER FOREIGN KEY,
phone_no TEXT
);
CREATE TABLE emailaddress (
contact_id NUMBER FOREIGN KEY,
email TEXT
);
CREATE TABLE address (
contact_id NUMBER FOREIGN KEY,
street TEXT,
city TEXT,
state TEXT,
zip TEXT
);
CREATE TABLE note (
contact_id NUMBER FOREIGN KEY,
note TEXT
);
CREATE TABLE activity (
activity_id NUMBER FOREIGN KEY,
activity_type TEXT,
activity_note TEXT
);
CREATE TABLE contact_activity (
activity_id NUMBER FOREIGN KEY,
contact_id NUMBER FOREIGN KEY
);
CREATE TABLE friends (
contact_id NUMBER FOREIGN KEY,
friend_contact_id NUMBER FORIEGN KEY
);