Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
grid change
  • Loading branch information
JCS12011 committed Dec 5, 2016
1 parent ebd302b commit b1cc2b3
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 14 deletions.
9 changes: 9 additions & 0 deletions .classpath
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="Nonrobust_Algorithms_jar/Nonrobust_Algorithms.jar"/>
<classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/algorithm-robustness/Nonrobust_Algorithms_jar/Nonrobust_Algorithms.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
.idea
out
Nonrobust_Algorithms.iml
/bin/
17 changes: 17 additions & 0 deletions .project
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>CompGeoProj</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
11 changes: 11 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
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.source=1.8
1 change: 1 addition & 0 deletions src/main/Controller.java
Expand Up @@ -119,6 +119,7 @@ public class Controller {

public static void update(GraphicsContext gc) {


gc.clearRect(0, 0, gc.getCanvas().widthProperty().intValue(), gc.getCanvas().widthProperty().intValue());

for(Drawable item : drawableObjects) {
Expand Down
30 changes: 16 additions & 14 deletions src/main/GridStuff.java
Expand Up @@ -10,9 +10,9 @@ import javafx.scene.canvas.GraphicsContext;

public class GridStuff{

int red = 1;
int yellow = -1;
int white = 0;
//int red = 1;
//int yellow = -1;
//int white = 0;

int MAX_RESOLUTION = 100;

Expand All @@ -21,13 +21,22 @@ public class GridStuff{
private double canvasWidth = 769;
private double canvasHeight = 769;

private double n = 10;
private double m = 10;
private double n;
private double m;

double getWidth = canvasWidth / 10;
double getHeight = canvasHeight /10;
double getWidth;
double getHeight;

GridStuff [][] map = new GridStuff[(int) n][(int) m];

public void setZoom(double val) {

n = m = 10 / val;
getHeight = canvasHeight / m;
getWidth = canvasWidth / n;
draw();

}

public void draw() {
for (int i = 0; i < n; i++) {
Expand All @@ -54,14 +63,7 @@ public class GridStuff{
}
}

public void setZoom(double val) {

n -= 10 / val;
getHeight = canvasHeight / m;
getWidth = canvasWidth / n;
draw();

}

public GridStuff(Canvas canvas, double zoom){
this.gc = canvas.getGraphicsContext2D();
Expand Down

0 comments on commit b1cc2b3

Please sign in to comment.