diff --git a/tdt4140-gr1800/.project b/tdt4140-gr1800/.project new file mode 100644 index 0000000000000000000000000000000000000000..0dc16e7e60e15eee7bb3f36218cebfcb20cf6cad --- /dev/null +++ b/tdt4140-gr1800/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>tdt4140-gr1800</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + </natures> +</projectDescription> diff --git a/tdt4140-gr1800/.settings/org.eclipse.jdt.core.prefs b/tdt4140-gr1800/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..abec6ca389ac6331e1f6466d9f67c8dd3406fb5a --- /dev/null +++ b/tdt4140-gr1800/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/tdt4140-gr1800/.settings/org.eclipse.m2e.core.prefs b/tdt4140-gr1800/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..f897a7f1cb2389f85fe6381425d29f0a9866fb65 --- /dev/null +++ b/tdt4140-gr1800/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/tdt4140-gr1800/app.core/.classpath b/tdt4140-gr1800/app.core/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..fae1a2b37d5e3386c9651caedb78b9bd107715bd --- /dev/null +++ b/tdt4140-gr1800/app.core/.classpath @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" output="target/classes" path="src/main/java"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="src" output="target/test-classes" path="src/test/java"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/tdt4140-gr1800/app.core/.project b/tdt4140-gr1800/app.core/.project new file mode 100644 index 0000000000000000000000000000000000000000..165572c0081477027e4fe0b0438c724866df372c --- /dev/null +++ b/tdt4140-gr1800/app.core/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>tdt4140.gr1800.app.core</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + </natures> +</projectDescription> diff --git a/tdt4140-gr1800/app.core/.settings/org.eclipse.jdt.core.prefs b/tdt4140-gr1800/app.core/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..13b3428acd87c3f94042e61eed221c15ce682bfa --- /dev/null +++ b/tdt4140-gr1800/app.core/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,13 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/tdt4140-gr1800/app.core/.settings/org.eclipse.m2e.core.prefs b/tdt4140-gr1800/app.core/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..f897a7f1cb2389f85fe6381425d29f0a9866fb65 --- /dev/null +++ b/tdt4140-gr1800/app.core/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/tdt4140-gr1800/app.core/pom.xml b/tdt4140-gr1800/app.core/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..b043414cdd8d5241327635180fa948e23dfa12e5 --- /dev/null +++ b/tdt4140-gr1800/app.core/pom.xml @@ -0,0 +1,36 @@ +<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> + <artifactId>tdt4140-gr1800.app.core</artifactId> + + <parent> + <groupId>tdt4140-gr1800</groupId> + <artifactId>tdt4140-gr1800</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + + <dependencies> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-core</artifactId> + <version>2.9.3</version> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + <version>2.9.3</version> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-annotations</artifactId> + <version>2.9.3</version> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> \ No newline at end of file diff --git a/tdt4140-gr1800/app.core/src/main/java/tdt4140/gr1800/app/core/App.java b/tdt4140-gr1800/app.core/src/main/java/tdt4140/gr1800/app/core/App.java new file mode 100644 index 0000000000000000000000000000000000000000..b6813c2fc487069a71bc60d7ce5c4bec0f13e7ba --- /dev/null +++ b/tdt4140-gr1800/app.core/src/main/java/tdt4140/gr1800/app/core/App.java @@ -0,0 +1,50 @@ +package tdt4140.gr1800.app.core; + +import java.net.URI; +import java.util.ArrayList; +import java.util.Collection; + +import tdt4140.gr1800.app.json.GeoLocationsJsonPersistence; + +public class App { + + private GeoLocationsPersistence geoLocationsLoader = new GeoLocationsJsonPersistence(); + + public void loadGeoLocations(URI uri) throws Exception { + geoLocations = geoLocationsLoader.loadLocations(uri.toURL().openStream()); + } + + private Collection<GeoLocations> geoLocations; + + public Iterable<String> getGeoLocationNames() { + Collection<String> names = new ArrayList<String>(geoLocations.size()); + if (geoLocations != null) { + for (GeoLocations geoLocations : geoLocations) { + names.add(geoLocations.getName()); + } + } + return names; + } + + public boolean hasGeoLocations(String name) { + if (geoLocations != null) { + for (GeoLocations geoLocations : geoLocations) { + if (name.equals(geoLocations.getName())) { + return true; + } + } + } + return false; + } + + public GeoLocations getGeoLocations(String name) { + if (geoLocations != null) { + for (GeoLocations geoLocations : geoLocations) { + if (name.equals(geoLocations.getName())) { + return geoLocations; + } + } + } + return null; + } +} diff --git a/tdt4140-gr1800/app.ui/.classpath b/tdt4140-gr1800/app.ui/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..fae1a2b37d5e3386c9651caedb78b9bd107715bd --- /dev/null +++ b/tdt4140-gr1800/app.ui/.classpath @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" output="target/classes" path="src/main/java"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="src" output="target/test-classes" path="src/test/java"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/tdt4140-gr1800/app.ui/.project b/tdt4140-gr1800/app.ui/.project new file mode 100644 index 0000000000000000000000000000000000000000..eca01e0c049149e992558b023b0e33ea96c2fb36 --- /dev/null +++ b/tdt4140-gr1800/app.ui/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>tdt4140.gr1800.app.ui</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + </natures> +</projectDescription> diff --git a/tdt4140-gr1800/app.ui/.settings/org.eclipse.jdt.core.prefs b/tdt4140-gr1800/app.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..13b3428acd87c3f94042e61eed221c15ce682bfa --- /dev/null +++ b/tdt4140-gr1800/app.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,13 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/tdt4140-gr1800/app.ui/.settings/org.eclipse.m2e.core.prefs b/tdt4140-gr1800/app.ui/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..f897a7f1cb2389f85fe6381425d29f0a9866fb65 --- /dev/null +++ b/tdt4140-gr1800/app.ui/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/tdt4140-gr1800/app.ui/pom.xml b/tdt4140-gr1800/app.ui/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..7deb2aea410c8b6bcd0ebb6c3eaffb813461a6cb --- /dev/null +++ b/tdt4140-gr1800/app.ui/pom.xml @@ -0,0 +1,48 @@ +<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> + <artifactId>tdt4140-gr1800.app.ui</artifactId> + + <parent> + <groupId>tdt4140-gr1800</groupId> + <artifactId>tdt4140-gr1800</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + + <dependencies> + <dependency> + <groupId>tdt4140-gr1800</groupId> + <artifactId>tdt4140-gr1800.app.core</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + + <!-- https://mvnrepository.com/artifact/com.lynden/GMapsFX --> + <dependency> + <groupId>com.lynden</groupId> + <artifactId>GMapsFX</artifactId> + <version>2.12.0</version> + </dependency> + <!-- <dependency> <groupId>fischer.clemens</groupId> <artifactId>fx-map-control</artifactId> + <version>1.0</version> </dependency> --> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.testfx</groupId> + <artifactId>testfx-core</artifactId> + <version>4.0.10-alpha</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.testfx</groupId> + <artifactId>testfx-junit</artifactId> + <version>4.0.10-alpha</version> + <scope>test</scope> + </dependency> + </dependencies> + +</project> diff --git a/tdt4140-gr1800/pom.xml b/tdt4140-gr1800/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..b619bf6a3ac8a4cd875bf796f789bb1a40f35d66 --- /dev/null +++ b/tdt4140-gr1800/pom.xml @@ -0,0 +1,19 @@ +<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> + <groupId>tdt4140-gr1800</groupId> + <artifactId>tdt4140-gr1800</artifactId> + <version>0.0.1-SNAPSHOT</version> + <packaging>pom</packaging> + + <properties> + <maven.compiler.source>1.8</maven.compiler.source> + <maven.compiler.target>1.8</maven.compiler.target> + </properties> + + <modules> + <module>app.core</module> + <module>app.ui</module> + + </modules> +</project> \ No newline at end of file