From 1c1b944684d8a96e4a8a3da9d337c62a7f83531f Mon Sep 17 00:00:00 2001 From: Martin Goik <goik@hdm-stuttgart.de> Date: Mon, 19 Jan 2015 14:11:58 +0100 Subject: [PATCH] Fixing library dependencied and screwed javadocs --- Sd1/P/crab/V1/pom.xml | 11 ++++++++--- Sd1/P/crab/V2/pom.xml | 13 ++++++++++--- Sd1/P/life/V3/pom.xml | 12 +++++------- Sd1/P/life/V3/src/main/java/Cell.java | 7 ++++++- Sd1/P/life/V3/src/main/java/LifeWorld.java | 18 +++++++++++++----- 5 files changed, 42 insertions(+), 19 deletions(-) diff --git a/Sd1/P/crab/V1/pom.xml b/Sd1/P/crab/V1/pom.xml index 4d2df609d..97b9d7982 100644 --- a/Sd1/P/crab/V1/pom.xml +++ b/Sd1/P/crab/V1/pom.xml @@ -38,9 +38,9 @@ </links> <additionalDependencies> <additionalDependency> - <groupId>org.greenfoot</groupId> - <artifactId>greenfoot-core</artifactId> - <version>2.5</version> + <groupId>de.hdm-stuttgart.mi</groupId> + <artifactId>greenfoot</artifactId> + <version>2.3.0</version> </additionalDependency> </additionalDependencies> </configuration> @@ -64,5 +64,10 @@ <version>4.11</version> <scope>test</scope> </dependency> + <dependency> + <groupId>de.hdm-stuttgart.mi</groupId> + <artifactId>greenfoot</artifactId> + <version>2.3.0</version> + </dependency> </dependencies> </project> diff --git a/Sd1/P/crab/V2/pom.xml b/Sd1/P/crab/V2/pom.xml index c641bb184..f6f769afd 100644 --- a/Sd1/P/crab/V2/pom.xml +++ b/Sd1/P/crab/V2/pom.xml @@ -38,9 +38,9 @@ </links> <additionalDependencies> <additionalDependency> - <groupId>org.greenfoot</groupId> - <artifactId>greenfoot-core</artifactId> - <version>2.5</version> + <groupId>de.hdm-stuttgart.mi</groupId> + <artifactId>greenfoot</artifactId> + <version>2.3.0</version> </additionalDependency> </additionalDependencies> @@ -65,5 +65,12 @@ <version>4.11</version> <scope>test</scope> </dependency> + + <dependency> + <groupId>de.hdm-stuttgart.mi</groupId> + <artifactId>greenfoot</artifactId> + <version>2.3.0</version> + </dependency> + </dependencies> </project> diff --git a/Sd1/P/life/V3/pom.xml b/Sd1/P/life/V3/pom.xml index 03e0d7775..3de816165 100644 --- a/Sd1/P/life/V3/pom.xml +++ b/Sd1/P/life/V3/pom.xml @@ -36,15 +36,13 @@ <links> <link>http://www.greenfoot.org/files/javadoc/</link> </links> -<!-- <additionalDependencies> <additionalDependency> - <groupId>org.greenfoot</groupId> - <artifactId>greenfoot-core</artifactId> - <version>2.5</version> + <groupId>de.hdm-stuttgart.mi</groupId> + <artifactId>greenfoot</artifactId> + <version>2.3.0</version> </additionalDependency> </additionalDependencies> ---> </configuration> </plugin> @@ -69,8 +67,8 @@ </dependency> <dependency> <groupId>de.hdm-stuttgart.mi</groupId> - <artifactId>greenfoot</artifactId> - <version>2.3.0</version> + <artifactId>greenfoot</artifactId> + <version>2.3.0</version> </dependency> </dependencies> </project> diff --git a/Sd1/P/life/V3/src/main/java/Cell.java b/Sd1/P/life/V3/src/main/java/Cell.java index ce0768ed3..abc4a54aa 100755 --- a/Sd1/P/life/V3/src/main/java/Cell.java +++ b/Sd1/P/life/V3/src/main/java/Cell.java @@ -27,7 +27,6 @@ public class Cell extends Actor { /** * Create the cell body's image and initialize state. * - * @param cellSize The cell's size in pixel units, * @param intialState Indicating {@link CellState#ALIVE} or {@link CellState#DEAD} */ public Cell(final CellState intialState) { @@ -67,6 +66,9 @@ public class Cell extends Actor { previousState = currentState; } + /** + * @return Number of living neighbouring cells + */ public int getLivingNeighbourCount() { int sum = 0; for (final Cell neighbor: neighbours) { @@ -75,6 +77,9 @@ public class Cell extends Actor { return sum; } + /** + * Set cell alive + */ public void setAlive() { setState(CellState.ALIVE); } diff --git a/Sd1/P/life/V3/src/main/java/LifeWorld.java b/Sd1/P/life/V3/src/main/java/LifeWorld.java index f714aa0c2..c47231bd2 100755 --- a/Sd1/P/life/V3/src/main/java/LifeWorld.java +++ b/Sd1/P/life/V3/src/main/java/LifeWorld.java @@ -10,17 +10,25 @@ import java.awt.Color; * */ public class LifeWorld extends World { - + static private final int initialLivingPercentage = 25 ,width = 80 ,height = 50; + /** + * default cell size + */ public static final int cellSize = 10; // Minimum of 3 pixel in width here yields a (cellSize-2)x(cellSize-2) pixel visible cell - static public GreenfootImage - imageAlive = new GreenfootImage(cellSize, cellSize) - ,imageDead = new GreenfootImage(cellSize, cellSize); + /** + * image of living cell + */ + static public GreenfootImage imageAlive = new GreenfootImage(cellSize, cellSize); + /** + * image of dead cell + */ + static public GreenfootImage imageDead = new GreenfootImage(cellSize, cellSize); // "Class" constructor initializing static fields. You may want to read Ivor Horton's // "Using Initialization Blocks" / "Initializing Data Members" subsection. @@ -163,7 +171,7 @@ public class LifeWorld extends World { } /** Randomly return the two states {@link CellState#ALIVE} and {@link CellState#DEAD}. The - * corresponding probabilities are {@link #setInitialLivingPercentage(int)} / 100 and + * corresponding probabilities are initialLivingPercentage/100 and * its complement. * * @return Either {@link CellState#ALIVE} or {@link CellState#DEAD}. -- GitLab