Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
the hurlers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Herman Andersen Dyrkorn
the hurlers
Commits
c234ba5f
Commit
c234ba5f
authored
4 years ago
by
Andrea Magnussen
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into '11-ui-design'
# Conflicts: # src/sample/sample.fxml
parents
af1e26e7
a126ab9e
No related branches found
Branches containing commit
No related tags found
1 merge request
!14
Resolve "UI design"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/sample/Controller.java
+8
-7
8 additions, 7 deletions
src/sample/Controller.java
src/sample/Main.java
+4
-4
4 additions, 4 deletions
src/sample/Main.java
src/sample/ThoughtManager.java
+36
-0
36 additions, 0 deletions
src/sample/ThoughtManager.java
with
48 additions
and
11 deletions
src/sample/Controller.java
+
8
−
7
View file @
c234ba5f
...
...
@@ -11,18 +11,19 @@ public class Controller {
@FXML
private
void
handleSubmit
()
{
System
.
out
.
println
(
"Mamma sønn"
);
String
tmp
=
""
;
tmp
=
textArea
.
getText
();
//create new thought, parameter from textArea
Thought
t
=
new
Thought
(
textArea
.
getText
()
)
;
System
.
out
.
println
(
tmp
);
//clear textArea
textArea
.
clear
();
//Thought tmpThought = new Thought();
//get the thought manager and add the thought to the manager
ThoughtManager
tm
=
ThoughtManager
.
getInstance
();
tm
.
add
(
t
);
tm
.
displayList
();
// Button was clicked, do something...
//outputTextArea.appendText("Button Action\n");
}
}
This diff is collapsed.
Click to expand it.
src/sample/Main.java
+
4
−
4
View file @
c234ba5f
...
...
@@ -28,11 +28,11 @@ public class Main extends Application {
//get access to the text field:
ScrollPane
scrollyPlane
=
(
ScrollPane
)
sceneMain
.
lookup
(
"#scrollyboi"
);
Node
content
=
scrollyPlane
.
getContent
();
Text
ta
=
(
Text
)
content
.
lookup
(
"#thoughtId"
);
ta
.
setText
(
"testing"
);
ThoughtManager
tm
=
new
ThoughtManager
();
Text
ourTextField
=
(
Text
)
content
.
lookup
(
"#thoughtId"
);
ThoughtManager
tm
=
ThoughtManager
.
getInstance
();
//NOTE! if you reinitalize ThoughtManager it will just change where it will be writing to:
tm
.
initialize
(
ourTextField
);
tm
.
makeList
();
primaryStage
.
show
();
}
...
...
This diff is collapsed.
Click to expand it.
src/sample/ThoughtManager.java
+
36
−
0
View file @
c234ba5f
package
sample
;
import
javafx.scene.text.Text
;
import
java.util.*
;
public
class
ThoughtManager
{
//Making it a singleton:
private
static
final
ThoughtManager
INSTANCE
=
new
ThoughtManager
();
private
ThoughtManager
()
{}
public
static
ThoughtManager
getInstance
()
{
return
INSTANCE
;
}
//Singleton done.
//VARIABLES:
private
List
<
Thought
>
thoughts
=
new
ArrayList
<>();
private
Text
textfield
;
//string NOTE! veit ikke om vi burde gjøre detta for i veit ikke ka man kan gjøre:
private
String
text
=
new
String
();
public
void
makeList
()
{
Thought
t
=
new
Thought
(
"yeet1"
);
...
...
@@ -17,4 +34,23 @@ public class ThoughtManager {
this
.
thoughts
.
add
(
t4
);
this
.
thoughts
.
add
(
t5
);
}
void
initialize
(
Text
text
)
{
this
.
textfield
=
text
;
}
void
displayList
()
{
this
.
textfield
.
setText
(
this
.
text
);
}
void
add
(
Thought
thought
)
{
this
.
thoughts
.
add
(
thought
);
this
.
text
+=
thought
.
getThought
()
+
"\n"
;
}
void
hurl
()
{
this
.
text
=
""
;
this
.
thoughts
.
clear
();
}
}
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