Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Quentin DRUAULT-AUBIN
lo23-project
Commits
fdceeea7
Commit
fdceeea7
authored
Jan 03, 2018
by
Peining Li
Browse files
Merge branch 'ihm-main/develop' into 'develop'
Ihm main/develop See merge request
!171
parents
4d1f9a13
614fd879
Changes
4
Hide whitespace changes
Inline
Side-by-side
Battleship/src/main/java/com/utclo23/data/facade/IDataIHMMain.java
View file @
fdceeea7
...
...
@@ -205,4 +205,4 @@ public interface IDataIHMMain {
* @throws DataException
*/
public
int
getNumberAbandonsBelgian
()
throws
DataException
;
}
\ No newline at end of file
}
Battleship/src/main/java/com/utclo23/ihmmain/controller/GameListController.java
View file @
fdceeea7
...
...
@@ -61,8 +61,9 @@ public class GameListController extends AbstractController{
private
StatGame
selectedGame
;
private
TableView
<
StatGame
>
gameList
;
private
B
oolean
isLoading
;
private
b
oolean
isLoading
;
private
Game
receivedGame
;
//game received with asynchronous load
private
boolean
isGameSelected
;
/**
* Method called at the beginning of the application.
...
...
@@ -74,6 +75,7 @@ public class GameListController extends AbstractController{
createGameListTableView
();
addOnMoussClickEventOnGameList
();
enableAllButtons
();
selectedGame
=
null
;
gameListPane
.
setFitToWidth
(
true
);
gameListPane
.
setFitToHeight
(
true
);
avatarImageView
.
setImage
(
super
.
retrievePlayerAvatar
());
...
...
@@ -89,7 +91,7 @@ public class GameListController extends AbstractController{
@Override
public
void
handle
(
MouseEvent
event
)
{
Node
node
=
((
Node
)
event
.
getTarget
()).
getParent
();
TableRow
row
;
TableRow
row
=
null
;
if
(!(
node
instanceof
TableView
)){
if
(
node
instanceof
TableRow
){
row
=
(
TableRow
)
node
;
...
...
@@ -99,16 +101,20 @@ public class GameListController extends AbstractController{
if
(
node
.
getParent
()
instanceof
TableRow
){
row
=
(
TableRow
)
node
.
getParent
();
}
else
{
row
=
(
TableRow
)
node
.
getParent
().
getParent
();
if
(
node
.
getParent
().
getParent
()
instanceof
TableRow
){
row
=
(
TableRow
)
node
.
getParent
().
getParent
();
}
}
}
StatGame
selected
=
(
StatGame
)
row
.
getItem
();
selectedGame
=
selected
;
if
(
row
!=
null
){
StatGame
selected
=
(
StatGame
)
row
.
getItem
();
selectedGame
=
selected
;
}
}
}
});
}
/**
* Create the table of games.
*/
...
...
@@ -190,7 +196,6 @@ public class GameListController extends AbstractController{
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
ObservableList
<
StatGame
>
data
=
FXCollections
.
observableArrayList
(
newGameList
);
// Update the list in the GUI
gameList
.
setItems
(
data
);
...
...
@@ -213,6 +218,8 @@ public class GameListController extends AbstractController{
if
(
selectedGame
!=
null
){
getFacade
().
iDataIHMMain
.
gameConnectionRequestGame
(
selectedGame
.
getId
(),
"player"
);
loadingScreen
();
}
else
{
showSuccessPopup
(
"Please select a game"
,
"Please select a game to join"
,
"Create a game or Find a friend and add his ip if you don't have any game in list"
);
}
}
...
...
@@ -227,6 +234,8 @@ public class GameListController extends AbstractController{
System
.
out
.
println
(
"ihm main watch request"
);
getFacade
().
iDataIHMMain
.
gameConnectionRequestGame
(
selectedGame
.
getId
(),
"spectator"
);
loadingScreen
();
}
else
{
showSuccessPopup
(
"Please select a game"
,
"Please select a game to watch"
,
"Find a friend and add his ip if you don't have any game in list"
);
}
}
...
...
Battleship/src/main/java/com/utclo23/ihmmain/controller/PlayerListController.java
View file @
fdceeea7
...
...
@@ -161,7 +161,7 @@ public class PlayerListController extends AbstractController{
PlayerProfileController
.
class
.
getName
()).
log
(
Level
.
INFO
,
"Waiting."
);
Thread
.
sleep
(
5
00
);
Thread
.
sleep
(
2
00
);
}
}
catch
(
InterruptedException
e
)
{
}
...
...
Battleship/src/main/java/com/utclo23/ihmmain/controller/PlayerProfileController.java
View file @
fdceeea7
...
...
@@ -93,7 +93,6 @@ public class PlayerProfileController extends AbstractController{
private
List
<
Integer
>
dataBelgian
;
private
List
<
Integer
>
dataTotal
;
private
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"dd/MM/yyyy"
);
@FXML
@Override
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment