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
nikkijax
ohj2
Commits
128b2265
Commit
128b2265
authored
11 months ago
by
joonatan
Browse files
Options
Downloads
Patches
Plain Diff
lisäystä muokattu
parent
35d2a6e6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Pelaajatiedot
+2
-3
2 additions, 3 deletions
Pelaajatiedot
src/HT/fx/PadelMainGUIController.java
+51
-0
51 additions, 0 deletions
src/HT/fx/PadelMainGUIController.java
src/HT/fx/Pelaaja.java
+5
-0
5 additions, 0 deletions
src/HT/fx/Pelaaja.java
src/HT/fx/Pelaajat.java
+22
-1
22 additions, 1 deletion
src/HT/fx/Pelaajat.java
with
80 additions
and
4 deletions
Pelaajatiedot
+
2
−
3
View file @
128b2265
...
...
@@ -2,6 +2,5 @@
2|Joonatan|1998-02-24|1040|joonatan@gmail.com|1
3|Tommi|2002-04-01|960|tommi@gmail.com|0
4|Riku|2001-04-01|970|riku@gmail.com|0
5|Jussi|2003-04-01|1030|jussi@luukku.fi|1
6|Tuomas|2002-03-27|1030|tuomas@luukku.fi|0
7|Pepe|1996-09-03|990|pepe@ilomantsinponnistus.fi|1
5|Tuomas|2002-03-27|1030|tuomas@luukku.fi|0
6|Pepe|1996-09-03|990|pepe@ilomantsinponnistus.fi|1
This diff is collapsed.
Click to expand it.
src/HT/fx/PadelMainGUIController.java
+
51
−
0
View file @
128b2265
...
...
@@ -58,6 +58,18 @@ public class PadelMainGUIController {
public
void
handle
(
MouseEvent
arg0
)
{
int
m
=
boksi
.
getChildren
().
indexOf
(
uusiNappi
);
muokkaaPelaaja
(
null
,
"kanat"
,
m
);
poistaKaikkiKentat
();
int
i
=
0
;
while
(
i
<
karkelo
.
getPelaajia
())
{
lisaakentat
();
i
++;
}
syotatiedot
();
}
});
boksi
.
getChildren
().
add
(
uusiNappi
);
...
...
@@ -73,6 +85,12 @@ public class PadelMainGUIController {
@FXML
void
handleLisaapelaaja
()
{
//LisaaTestiPelaajat();
handleLisaaPelaaja
(
null
,
"kanat"
);
int
i
=
0
;
while
(
i
<
karkelo
.
getPelaajia
())
{
System
.
out
.
println
(
karkelo
.
annaPelaaja
(
i
).
getTiedot
());
i
++;
}
//LisaaPelaaja();
//Syotatiedot();
lisaakentat
();
...
...
@@ -117,6 +135,12 @@ public class PadelMainGUIController {
}
/**
* @param modalityStage -
* @param oletus -
* @param m luku
* @return controller
*/
public
static
String
muokkaaPelaaja
(
Stage
modalityStage
,
String
oletus
,
int
m
)
{
muokattava
=
m
;
return
ModalController
.
showModal
(
...
...
@@ -137,6 +161,27 @@ public class PadelMainGUIController {
"Lisää pelaaja"
,
modalityStage
,
oletus
);
}
/**
* @param boksi josta poistetaan
*/
public
void
poistaKentatYhdesta
(
VBox
boksi
)
{
boksi
.
getChildren
().
removeIf
(
node
->
node
instanceof
TextField
);
boksi
.
getChildren
().
removeIf
(
node
->
node
instanceof
Button
);
}
/**
*
*/
public
void
poistaKaikkiKentat
()
{
poistaKentatYhdesta
(
NimiVbox
);
poistaKentatYhdesta
(
IkaVbox
);
poistaKentatYhdesta
(
RatingVbox
);
poistaKentatYhdesta
(
SapoVbox
);
poistaKentatYhdesta
(
AutoVbox
);
poistaKentatYhdesta
(
MuokkaaVbox
);
}
/**
* Lisää tarvittavat kentät kun pelaaja luodaan
...
...
@@ -250,6 +295,12 @@ public class PadelMainGUIController {
*/
public
static
void
LisaaPelaaja
(
Pelaaja
uusi
)
{
/*int i = 1;
while(i<karkelo.getPelaajia()) {
System.out.println(karkelo.annaPelaaja(i).getTiedot());
i++;
}
*/
uusi
.
rekisteroi
();
//uusi.vastaaAkuAnkka();
try
{
...
...
This diff is collapsed.
Click to expand it.
src/HT/fx/Pelaaja.java
+
5
−
0
View file @
128b2265
...
...
@@ -244,6 +244,11 @@ public class Pelaaja {
}
public
static
void
setSeuraavaNro
(
int
i
)
{
seuraavaNro
=
i
;
}
...
...
This diff is collapsed.
Click to expand it.
src/HT/fx/Pelaajat.java
+
22
−
1
View file @
128b2265
...
...
@@ -202,8 +202,29 @@ public class Pelaajat {
}
i
++;
}
//lkm--;
alkiot
=
alkiot2
;
paivitaId
();
lkm
--;
System
.
out
.
println
(
" "
+
lkm
+
Pelaaja
.
getSeuraavaNro
());
}
public
void
paivitaId
()
{
int
i
=
0
;
while
(
i
<
alkiot
.
length
)
{
if
(
alkiot
[
i
].
getTunnusNro
()
!=
i
+
1
)
{
//System.out.println(alkiot[i].getTunnusNro() +" " +lkm );
alkiot
[
i
].
setTunnusNro
(
i
+
1
);
//System.out.println(alkiot[i].getTunnusNro() +" " +lkm );
}
i
++;
Pelaaja
.
setSeuraavaNro
(
i
+
1
);
}
}
}
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