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
052a717d
Commit
052a717d
authored
4 years ago
by
Anders Langlie
Browse files
Options
Downloads
Plain Diff
Merge branch '9-displaylist-v3' into 'master'
Resolve "DisplayList v3" Closes
#9
See merge request
!12
parents
d5ea620c
b55f60d0
No related branches found
Branches containing commit
No related tags found
1 merge request
!12
Resolve "DisplayList v3"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/sample/Main.java
+4
-4
4 additions, 4 deletions
src/sample/Main.java
src/sample/ThoughtManager.java
+32
-0
32 additions, 0 deletions
src/sample/ThoughtManager.java
src/sample/sample.fxml
+1
-1
1 addition, 1 deletion
src/sample/sample.fxml
with
37 additions
and
5 deletions
src/sample/Main.java
+
4
−
4
View file @
052a717d
...
...
@@ -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
+
32
−
0
View file @
052a717d
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
=
""
;
public
void
makeList
()
{
Thought
t
=
new
Thought
(
"yeet1"
);
...
...
@@ -17,4 +34,19 @@ public class ThoughtManager {
this
.
thoughts
.
add
(
t4
);
this
.
thoughts
.
add
(
t5
);
}
void
initialize
(
Text
text
)
{
}
void
displayList
()
{
this
.
textfield
.
setText
(
this
.
text
);
}
void
add
(
Thought
thought
)
{
this
.
thoughts
.
add
(
thought
);
this
.
text
+=
thought
.
getThought
()
+
"\n"
;
}
}
This diff is collapsed.
Click to expand it.
src/sample/sample.fxml
+
1
−
1
View file @
052a717d
...
...
@@ -13,7 +13,7 @@
<Text
id=
"thoughtField"
layoutX=
"65.0"
layoutY=
"31.0"
strokeType=
"OUTSIDE"
strokeWidth=
"0.0"
text=
"Your thoughts"
/>
<ScrollPane
id=
"scrollyboi"
layoutX=
"1.0"
layoutY=
"40.0"
prefHeight=
"258.0"
prefWidth=
"700.0"
>
<content>
<Text
id=
"thoughtId"
strokeType=
"OUTSIDE"
strokeWidth=
"20.0"
text=
"Text"
wrappingWidth=
"
33.22460746765137
"
/>
<Text
id=
"thoughtId"
strokeType=
"OUTSIDE"
strokeWidth=
"20.0"
wrappingWidth=
"
700"
text=
"Text
"
/>
</content>
</ScrollPane>
</children>
...
...
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