Skip to content

Commit

Permalink
Merge pull request #8 from TH3steven/dev
Browse files Browse the repository at this point in the history
Dev to master, this time for real
  • Loading branch information
tkolenbrander committed May 6, 2016
2 parents 24c8ac6 + 63781fe commit e2fb002
Show file tree
Hide file tree
Showing 38 changed files with 1,925 additions and 29 deletions.
4 changes: 4 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
<accessrules>
<accessrule kind="accessible" pattern="javafx/**"/>
</accessrules>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/.idea/
/.settings/
/bin/
/target/
/*.iml
4 changes: 4 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
Expand Down
23 changes: 23 additions & 0 deletions Context-TFP.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<conelement value="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" />
<src_description expected_position="0">
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
</src_description>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="inheritedJdk" />
<orderEntry type="library" name="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" level="application" />
<orderEntry type="library" name="junit-4.12" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
</component>
</module>
2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Custom checkstyle rules for the TFP Context project
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="AnnotationUseStyle">
<property name="closingParens" value="always"/>
<property name="closingParens" value="never"/>
</module>
<module name="PackageAnnotation"/>
<module name="AvoidNestedBlocks">
Expand Down
Binary file added doc/Sprint plans/Sprintplan3.pdf
Binary file not shown.
Binary file not shown.
21 changes: 18 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source/>
<target/>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
Expand All @@ -29,13 +29,28 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
</dependencies>
</project>
29 changes: 9 additions & 20 deletions src/main/java/nl/tudelft/contextproject/ContextTFP.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import main.java.nl.tudelft.contextproject.gui.MenuController;

import java.io.IOException;

Expand All @@ -30,16 +30,16 @@
*/
public class ContextTFP extends Application {

private static BorderPane rootLayout;
private Stage primaryStage;
private BorderPane rootLayout;

@Override()
@Override
public void start(Stage primaryStage) throws Exception {
this.primaryStage = primaryStage;
this.primaryStage.setTitle("TFP Camera Control");

initRootLayout();
showMenuOverview();
MenuController.show();
}

/**
Expand All @@ -59,21 +59,6 @@ public void initRootLayout() {
}
}

/**
* Shows the menu overview inside the root layout.
*/
public void showMenuOverview() {
try {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(ContextTFP.class.getResource("view/MenuOverview.fxml"));
AnchorPane menuOverview = (AnchorPane) loader.load();

rootLayout.setCenter(menuOverview);
} catch (IOException e) {
e.printStackTrace();
}
}

/**
* The main class of the project. Calling this method will start the program.
*
Expand All @@ -89,6 +74,10 @@ public static void main(String[] args) {
* @return The main stage
*/
public Stage getPrimaryStage() {
return primaryStage;
return this.primaryStage;
}

public static BorderPane getRootLayout() {
return rootLayout;
}
}
123 changes: 123 additions & 0 deletions src/main/java/nl/tudelft/contextproject/camera/Camera.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
package main.java.nl.tudelft.contextproject.camera;

import java.util.Observable;

/**
* Class to represent a camera.
* Extends Observables so its settings can be observed.
*
* @author Bart van Oort
* @since 0.2
*/
public class Camera extends Observable {

private static int numCams = 0;

private int num;
private CameraSettings camSet;

/**
* Creates a Camera object with initial camera settings
* set to the lower limits of the camera.
*/
public Camera() {
camSet = new CameraSettings();
num = numCams++;
}

/**
* Creates a Camera object with initial camera settings
* as specified in the CameraSettings object.
*
* @param init Initial camera settings.
*/
public Camera(CameraSettings init) {
camSet = init;
num = numCams++;
}

/**
* Gets the camera number assigned to the camera.
* @return Camera number assigned to camera.
*/
public int getNumber() {
return num;
}

/**
* Returns the camera settings.
* @return Camera settings
*/
public CameraSettings getSettings() {
return camSet;
}

/**
* Sets the settings for this camera.
* Updates the observers.
*
* @param settings Camera settings to set.
*/
public void setSettings(CameraSettings settings) {
camSet = settings;
setChanged();
notifyObservers();
}

/**
* Pans the camera a certain offset. Cannot pan past
* the pan limits.
*
* @param offset The offset to pan the camera.
*/
public void pan(int offset) {
camSet.pan(offset);
setChanged();
notifyObservers();
}

/**
* Tilts the camera a certain offset. Cannot tilt past
* the tilt limits.
*
* @param offset The offset to tilt the camera.
*/
public void tilt(int offset) {
camSet.tilt(offset);
setChanged();
notifyObservers();
}

/**
* Zooms the camera a certain offset. Cannot zoom past
* the zoom limits.
*
* @param offset The offset to zoom the camera.
*/
public void zoom(int offset) {
camSet.zoom(offset);
setChanged();
notifyObservers();
}

/**
* Zooms the camera a certain focus. Cannot focus past
* the focus limits.
*
* @param offset The offset to focus the camera.
*/
public void focus(int offset) {
camSet.focus(offset);
setChanged();
notifyObservers();
}

/**
* This is still to be implemented but should be responsible for the taking
* of shots by a camera.
*/
public void takeShot() {

}

}
Loading

0 comments on commit e2fb002

Please sign in to comment.