Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
ohj2
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
vvlaspa
ohj2
Commits
15773841
Commit
15773841
authored
1 month ago
by
Läspä Vili Valtteri
Browse files
Options
Downloads
Patches
Plain Diff
vaihe 5 lisätty uusien tulosten lisääminen/näyttäminen käyttöliittymään
parent
b0566609
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
puntti/src/fxPuntti/PunttiGUIController.java
+28
-2
28 additions, 2 deletions
puntti/src/fxPuntti/PunttiGUIController.java
with
28 additions
and
2 deletions
puntti/src/fxPuntti/PunttiGUIController.java
+
28
−
2
View file @
15773841
...
@@ -2,11 +2,11 @@ package fxPuntti;
...
@@ -2,11 +2,11 @@ package fxPuntti;
import
java.io.PrintStream
;
import
java.io.PrintStream
;
import
java.net.URL
;
import
java.net.URL
;
import
java.util.List
;
import
java.util.ResourceBundle
;
import
java.util.ResourceBundle
;
import
fi.jyu.mit.fxgui.Dialogs
;
import
fi.jyu.mit.fxgui.Dialogs
;
import
fi.jyu.mit.fxgui.ListChooser
;
import
fi.jyu.mit.fxgui.ListChooser
;
import
fi.jyu.mit.fxgui.ModalController
;
import
fi.jyu.mit.fxgui.TextAreaOutputStream
;
import
fi.jyu.mit.fxgui.TextAreaOutputStream
;
import
javafx.fxml.FXML
;
import
javafx.fxml.FXML
;
import
javafx.fxml.Initializable
;
import
javafx.fxml.Initializable
;
...
@@ -16,6 +16,7 @@ import javafx.scene.text.Font;
...
@@ -16,6 +16,7 @@ import javafx.scene.text.Font;
import
puntti.Liike
;
import
puntti.Liike
;
import
puntti.Puntti
;
import
puntti.Puntti
;
import
puntti.SailoException
;
import
puntti.SailoException
;
import
puntti.Tulos
;
/**
/**
...
@@ -64,7 +65,8 @@ public class PunttiGUIController implements Initializable{
...
@@ -64,7 +65,8 @@ public class PunttiGUIController implements Initializable{
}
}
@FXML
private
void
handleUusiTulos
()
{
@FXML
private
void
handleUusiTulos
()
{
ModalController
.
showModal
(
PunttiGUIController
.
class
.
getResource
(
"LisaaUusiTulosGUIView.fxml"
),
"Tulos"
,
null
,
""
);
//ModalController.showModal(PunttiGUIController.class.getResource("LisaaUusiTulosGUIView.fxml"), "Tulos", null, "");
uusiTulos
();
}
}
//___________________________________________________________________ ALLE JAVA
//___________________________________________________________________ ALLE JAVA
...
@@ -89,6 +91,7 @@ public class PunttiGUIController implements Initializable{
...
@@ -89,6 +91,7 @@ public class PunttiGUIController implements Initializable{
}
}
private
void
naytaLiike
()
{
private
void
naytaLiike
()
{
Liike
liikeKohdalla
=
chooserLiikkeet
.
getSelectedObject
();
Liike
liikeKohdalla
=
chooserLiikkeet
.
getSelectedObject
();
...
@@ -96,10 +99,18 @@ public class PunttiGUIController implements Initializable{
...
@@ -96,10 +99,18 @@ public class PunttiGUIController implements Initializable{
areaLiike
.
setText
(
""
);
areaLiike
.
setText
(
""
);
try
(
PrintStream
os
=
TextAreaOutputStream
.
getTextPrintStream
(
areaLiike
)){
try
(
PrintStream
os
=
TextAreaOutputStream
.
getTextPrintStream
(
areaLiike
)){
os
.
println
(
"_____________________________________"
);
liikeKohdalla
.
tulosta
(
os
);
liikeKohdalla
.
tulosta
(
os
);
os
.
println
(
"_____________________________________"
);
List
<
Tulos
>
tulokset
=
puntti
.
annaTulokset
(
liikeKohdalla
);
for
(
Tulos
tulo:
tulokset
)
tulo
.
tulosta
(
os
);
os
.
println
(
"_____________________________________"
);
}
}
}
}
private
void
lueTiedosto
(
@SuppressWarnings
(
"unused"
)
String
nimi
)
{
private
void
lueTiedosto
(
@SuppressWarnings
(
"unused"
)
String
nimi
)
{
// punttinimi = nimi;
// punttinimi = nimi;
// setTitle("Puntti - " + nimi);
// setTitle("Puntti - " + nimi);
...
@@ -159,6 +170,21 @@ public class PunttiGUIController implements Initializable{
...
@@ -159,6 +170,21 @@ public class PunttiGUIController implements Initializable{
hae
(
uusi
.
getLid
());
hae
(
uusi
.
getLid
());
}
}
/**
* Lisätään Punttiin uusi tulos
*/
private
void
uusiTulos
()
{
Liike
liikeKohdalla
=
chooserLiikkeet
.
getSelectedObject
();
if
(
liikeKohdalla
==
null
)
return
;
Tulos
tulo
=
new
Tulos
();
tulo
.
lisaaTulos
();
tulo
.
taytaPenkkiTulos
(
liikeKohdalla
.
getLid
());
puntti
.
lisaa
(
tulo
);
hae
(
liikeKohdalla
.
getLid
());
}
}
}
\ No newline at end of file
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