Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions starter/catpoint-parent/Image/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.udacity.catpoint</groupId>
<artifactId>catpoint-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>Image</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Image</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>22</maven.compiler.source>
<maven.compiler.target>22</maven.compiler.target>
</properties>

<dependencies>
<!-- <dependency>-->
<!-- <groupId>org.mockito</groupId>-->
<!-- <artifactId>mockito-core</artifactId>-->
<!-- <version>2.22.0</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.0-alpha7</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>auth</artifactId>
<version>2.22.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/software.amazon.awssdk/rekognition -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>rekognition</artifactId>
<version>2.21.23</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.16</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>software.amazon.awssdk</groupId>-->
<!-- <artifactId>aws-core</artifactId>-->
<!-- <version>2.17.191</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/software.amazon.awssdk/regions &ndash;&gt;-->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>regions</artifactId>
<version>2.28.16</version>
</dependency>

</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.udacity.catpoint.service;
package com.udacity.catpoint.image;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.udacity.catpoint.service;
package com.udacity.catpoint.image;

import java.awt.image.BufferedImage;
import java.util.Random;
Expand Down
10 changes: 10 additions & 0 deletions starter/catpoint-parent/Image/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module com.udacity.catpoint.image {
// requires org.slf4j;
requires software.amazon.awssdk.core;
requires software.amazon.awssdk.auth;
requires software.amazon.awssdk.services.rekognition;
requires java.desktop;
requires software.amazon.awssdk.regions;
requires org.slf4j;
exports com.udacity.catpoint.image;
}
214 changes: 214 additions & 0 deletions starter/catpoint-parent/Security/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.udacity.catpoint</groupId>
<artifactId>catpoint-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>Security</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Security</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>22</maven.compiler.source>
<maven.compiler.target>22</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>com.udacity.catpoint</groupId>
<artifactId>Image</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compiler</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>5.14.1</version>
<scope>test</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.mockito</groupId>-->
<!-- <artifactId>mockito-core</artifactId>-->
<!-- <version>2.22.0</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>6.1.13</version>
<scope>test</scope>
</dependency>


<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout-swing</artifactId>
<version>5.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>13.0-rc1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.11.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<!-- <dependency>-->
<!-- <groupId>org.slf4j</groupId>-->
<!-- <artifactId>slf4j-api</artifactId>-->
<!-- <version>2.0.16</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/software.amazon.awssdk/auth &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>software.amazon.awssdk</groupId>-->
<!-- <artifactId>auth</artifactId>-->
<!-- <version>2.28.13</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/software.amazon.awssdk/rekognition &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>software.amazon.awssdk</groupId>-->
<!-- <artifactId>rekognition</artifactId>-->
<!-- <version>2.28.13</version>-->
<!-- </dependency>-->

<!-- &lt;!&ndash; https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-params &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.junit.jupiter</groupId>-->
<!-- <artifactId>junit-jupiter-params</artifactId>-->
<!-- <version>5.11.1</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->

<!-- &lt;!&ndash; https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.junit.jupiter</groupId>-->
<!-- <artifactId>junit-jupiter-api</artifactId>-->
<!-- <version>5.11.1</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->



<!-- &lt;!&ndash; https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.mockito</groupId>-->
<!-- <artifactId>mockito-junit-jupiter</artifactId>-->
<!-- <version>5.14.1</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->

</dependencies>


<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>
com.udacity.catpoint.application.CatpointApp
</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<!-- <pluginManagement>&lt;!&ndash; lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) &ndash;&gt;-->
<!-- <plugins>-->
<!-- &lt;!&ndash; clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle &ndash;&gt;-->
<!-- <plugin>-->
<!-- <artifactId>maven-clean-plugin</artifactId>-->
<!-- <version>3.1.0</version>-->
<!-- </plugin>-->
<!-- &lt;!&ndash; default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging &ndash;&gt;-->
<!-- <plugin>-->
<!-- <artifactId>maven-resources-plugin</artifactId>-->
<!-- <version>3.0.2</version>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <artifactId>maven-compiler-plugin</artifactId>-->
<!-- <version>3.8.0</version>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <artifactId>maven-surefire-plugin</artifactId>-->
<!-- <version>2.22.1</version>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <artifactId>maven-jar-plugin</artifactId>-->
<!-- <version>3.0.2</version>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <artifactId>maven-install-plugin</artifactId>-->
<!-- <version>2.5.2</version>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <artifactId>maven-deploy-plugin</artifactId>-->
<!-- <version>2.8.2</version>-->
<!-- </plugin>-->
<!-- &lt;!&ndash; site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle &ndash;&gt;-->
<!-- <plugin>-->
<!-- <artifactId>maven-site-plugin</artifactId>-->
<!-- <version>3.9.1</version>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <artifactId>maven-project-info-reports-plugin</artifactId>-->
<!-- <version>3.1.1</version>-->
<!-- </plugin>-->

<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-assembly-plugin</artifactId>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <phase>package</phase>-->
<!-- <goals>-->
<!-- <goal>single</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <archive>-->
<!-- <manifest>-->
<!-- <mainClass>-->
<!-- com.udacity.catpoint.security.application.CatpointApp-->
<!-- </mainClass>-->
<!-- </manifest>-->
<!-- </archive>-->
<!-- <descriptorRefs>-->
<!-- <descriptorRef>jar-with-dependencies</descriptorRef>-->
<!-- </descriptorRefs>-->
<!-- <appendAssemblyId>false</appendAssemblyId>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </pluginManagement>-->
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.udacity.catpoint.security.application;

/**
* This is the main class that launches the application.
*/
public class CatpointApp {
public static void main(String[] args) {
CatpointGui gui = new CatpointGui();
gui.setVisible(true);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.udacity.catpoint.security.application;



import com.udacity.catpoint.image.FakeImageService;
import com.udacity.catpoint.security.data.PretendDatabaseSecurityRepositoryImpl;
import com.udacity.catpoint.security.data.SecurityRepository;
import com.udacity.catpoint.security.service.SecurityService;
import net.miginfocom.swing.MigLayout;

import javax.swing.*;

/**
* This is the primary JFrame for the application that contains all the top-level JPanels.
*
* We're not using any dependency injection framework, so this class also handles constructing
* all our dependencies and providing them to other classes as necessary.
*/
public class CatpointGui extends JFrame {
private SecurityRepository securityRepository = new PretendDatabaseSecurityRepositoryImpl();
private FakeImageService imageService = new FakeImageService();
private SecurityService securityService = new SecurityService(securityRepository, imageService);
private DisplayPanel displayPanel = new DisplayPanel(securityService);
private ControlPanel controlPanel = new ControlPanel(securityService);
private SensorPanel sensorPanel = new SensorPanel(securityService);
private ImagePanel imagePanel = new ImagePanel(securityService);

public CatpointGui() {
setLocation(100, 100);
setSize(600, 850);
setTitle("Very Secure App");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JPanel mainPanel = new JPanel();
mainPanel.setLayout(new MigLayout());
mainPanel.add(displayPanel, "wrap");
mainPanel.add(imagePanel, "wrap");
mainPanel.add(controlPanel, "wrap");
mainPanel.add(sensorPanel);

getContentPane().add(mainPanel);

}
}
Loading