Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mappe - programmering 2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sverre Grønhaug Halvorsen
Mappe - programmering 2
Commits
2b523148
Commit
2b523148
authored
1 year ago
by
Sverre Grønhaug Halvorsen
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Fix bug where stepCounter counter got doubled unnecessary
parent
ac37398a
Branches
Branches containing commit
No related tags found
2 merge requests
!41
final delivery
,
!33
Resolve "Fix bug where altering c in Julia with mouse lags"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/edu/ntnu/idatt2003/controller/MainPageController.java
+2
-9
2 additions, 9 deletions
...ava/edu/ntnu/idatt2003/controller/MainPageController.java
src/main/java/edu/ntnu/idatt2003/view/MainPageView.java
+0
-1
0 additions, 1 deletion
src/main/java/edu/ntnu/idatt2003/view/MainPageView.java
with
2 additions
and
10 deletions
src/main/java/edu/ntnu/idatt2003/controller/MainPageController.java
+
2
−
9
View file @
2b523148
...
@@ -3,15 +3,12 @@ package edu.ntnu.idatt2003.controller;
...
@@ -3,15 +3,12 @@ package edu.ntnu.idatt2003.controller;
import
edu.ntnu.idatt2003.model.ChaosGame
;
import
edu.ntnu.idatt2003.model.ChaosGame
;
import
edu.ntnu.idatt2003.model.ChaosGameDescription
;
import
edu.ntnu.idatt2003.model.ChaosGameDescription
;
import
edu.ntnu.idatt2003.model.ChaosGameDescriptionFactory
;
import
edu.ntnu.idatt2003.model.ChaosGameDescriptionFactory
;
import
edu.ntnu.idatt2003.model.ChaosGameDescriptionFactory.descriptionTypeEnum
;
import
edu.ntnu.idatt2003.model.ChaosGameFileHandler
;
import
edu.ntnu.idatt2003.model.ChaosGameFileHandler
;
import
edu.ntnu.idatt2003.model.ChaosGameFileHandler
;
import
edu.ntnu.idatt2003.model.Complex
;
import
edu.ntnu.idatt2003.model.Complex
;
import
edu.ntnu.idatt2003.model.JuliaTransform
;
import
edu.ntnu.idatt2003.model.JuliaTransform
;
import
edu.ntnu.idatt2003.model.Transform2D
;
import
edu.ntnu.idatt2003.model.Transform2D
;
import
edu.ntnu.idatt2003.model.Vector2d
;
import
edu.ntnu.idatt2003.model.Vector2d
;
import
edu.ntnu.idatt2003.view.MainPageView
;
import
edu.ntnu.idatt2003.view.MainPageView
;
import
edu.ntnu.idatt2003.view.MainPageView.TransformationType
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -43,7 +40,7 @@ public class MainPageController {
...
@@ -43,7 +40,7 @@ public class MainPageController {
private
static
final
String
TRANSFORMATIONS_PATH
=
"src/main/resources/transformations/"
;
private
static
final
String
TRANSFORMATIONS_PATH
=
"src/main/resources/transformations/"
;
private
static
final
String
SERIALIZED_GAME_PATH
=
"src/main/resources/savedTransformation.ser"
;
private
static
final
String
SERIALIZED_GAME_PATH
=
"src/main/resources/savedTransformation.ser"
;
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
MainPageController
.
class
.
getName
());
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
MainPageController
.
class
.
getName
());
private
static
int
stepsCounter
;
private
int
stepsCounter
;
static
{
static
{
try
{
try
{
...
@@ -104,10 +101,6 @@ public class MainPageController {
...
@@ -104,10 +101,6 @@ public class MainPageController {
LOGGER
.
log
(
Level
.
INFO
,
"Chaos game simulation ran {0} steps successfully."
,
steps
);
LOGGER
.
log
(
Level
.
INFO
,
"Chaos game simulation ran {0} steps successfully."
,
steps
);
}
}
public
int
getSteps
()
{
return
stepsCounter
;
}
/**
/**
* Validates the file that is uploaded., and calls storeFile if the
* Validates the file that is uploaded., and calls storeFile if the
* file exists and is formatted correctly.
* file exists and is formatted correctly.
...
@@ -234,7 +227,6 @@ public class MainPageController {
...
@@ -234,7 +227,6 @@ public class MainPageController {
new
ChaosGameDescription
(
minCoords
,
maxCoords
,
transform
);
new
ChaosGameDescription
(
minCoords
,
maxCoords
,
transform
);
chaosGameFileHandler
chaosGameFileHandler
.
writeToFile
(
newChaosGameDescription
,
TRANSFORMATIONS_PATH
+
transformationName
+
".txt"
);
.
writeToFile
(
newChaosGameDescription
,
TRANSFORMATIONS_PATH
+
transformationName
+
".txt"
);
System
.
out
.
println
(
transformationName
);
customTransformations
.
add
(
transformationName
);
customTransformations
.
add
(
transformationName
);
view
.
render
();
view
.
render
();
}
}
...
@@ -266,6 +258,7 @@ public class MainPageController {
...
@@ -266,6 +258,7 @@ public class MainPageController {
list
.
add
(
new
JuliaTransform
(
complex
,
-
1
));
list
.
add
(
new
JuliaTransform
(
complex
,
-
1
));
ChaosGameDescription
chaosGameDescription
=
new
ChaosGameDescription
(
min
,
max
,
list
);
ChaosGameDescription
chaosGameDescription
=
new
ChaosGameDescription
(
min
,
max
,
list
);
game
.
setDescription
(
chaosGameDescription
);
game
.
setDescription
(
chaosGameDescription
);
game
.
runSteps
(
stepsCounter
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/edu/ntnu/idatt2003/view/MainPageView.java
+
0
−
1
View file @
2b523148
...
@@ -550,7 +550,6 @@ public class MainPageView extends Scene implements ChaosGameObserver {
...
@@ -550,7 +550,6 @@ public class MainPageView extends Scene implements ChaosGameObserver {
*/
*/
private
void
updateValues
(
double
x
,
double
y
)
{
private
void
updateValues
(
double
x
,
double
y
)
{
controller
.
changeJuliaTransformationDynamic
(
x
,
y
);
controller
.
changeJuliaTransformationDynamic
(
x
,
y
);
controller
.
runSteps
(
controller
.
getSteps
());
xField
.
setText
(
String
.
format
(
"X: %.1f"
,
x
));
xField
.
setText
(
String
.
format
(
"X: %.1f"
,
x
));
yField
.
setText
(
String
.
format
(
"Y: %.1f"
,
y
));
yField
.
setText
(
String
.
format
(
"Y: %.1f"
,
y
));
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment