-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from TH3steven/dev
Dev to master, this time for real
- Loading branch information
Showing
38 changed files
with
1,925 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
/.idea/ | ||
/.settings/ | ||
/bin/ | ||
/target/ | ||
/*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
src/main/java/nl/tudelft/contextproject/camera/Camera.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.