-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'javafx' of github.com:Cardshifter/Cardshifter into clie…
…nt-server
- Loading branch information
Showing
8 changed files
with
141 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
cardshifter-fx/src/main/java/com/cardshifter/client/InviteWindow.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.cardshifter.client; | ||
|
||
import com.cardshifter.api.both.InviteRequest; | ||
import javafx.fxml.FXML; | ||
import javafx.fxml.FXMLLoader; | ||
import javafx.scene.control.Label; | ||
import javafx.scene.layout.AnchorPane; | ||
|
||
public class InviteWindow { | ||
|
||
@FXML private AnchorPane rootPane; | ||
@FXML private Label nameLabel; | ||
@FXML private AnchorPane noButton; | ||
@FXML private AnchorPane yesButton; | ||
|
||
private final InviteRequest message; | ||
private final GameClientLobby lobby; | ||
|
||
public InviteWindow(InviteRequest message, GameClientLobby lobby) { | ||
try { | ||
FXMLLoader loader = new FXMLLoader(getClass().getResource("InviteWindowDocument.fxml")); | ||
loader.setController(this); | ||
loader.load(); | ||
} catch (Exception e) { | ||
throw new RuntimeException(e); | ||
} | ||
|
||
this.message = message; | ||
this.lobby = lobby; | ||
|
||
this.nameLabel.setText(message.getName()); | ||
this.yesButton.setOnMouseClicked(lobby::acceptGameRequest); | ||
this.noButton.setOnMouseClicked(lobby::declineGameRequest); | ||
} | ||
|
||
public AnchorPane getRootPane() { | ||
return this.rootPane; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
cardshifter-fx/src/main/resources/com/cardshifter/client/InviteWindowDocument.fxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.text.*?> | ||
<?import javafx.scene.shape.*?> | ||
<?import java.lang.*?> | ||
<?import java.util.*?> | ||
<?import javafx.scene.*?> | ||
<?import javafx.scene.control.*?> | ||
<?import javafx.scene.layout.*?> | ||
|
||
|
||
<AnchorPane fx:id="rootPane" prefHeight="240.0" prefWidth="400.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8"> | ||
<children> | ||
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#0055a4" height="240.0" stroke="BLACK" strokeType="INSIDE" width="400.0" /> | ||
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#b1bdff" height="120.0" layoutX="15.0" layoutY="14.0" stroke="BLACK" strokeType="INSIDE" width="370.0" /> | ||
<Label layoutX="28.0" layoutY="22.0" text="Accept invite from"> | ||
<font> | ||
<Font name="System Bold" size="36.0" /> | ||
</font> | ||
</Label> | ||
<Label fx:id="nameLabel" layoutX="166.0" layoutY="84.0" text="name" textAlignment="CENTER"> | ||
<font> | ||
<Font name="System Bold" size="24.0" /> | ||
</font> | ||
</Label> | ||
<AnchorPane fx:id="yesButton" layoutX="15.0" layoutY="152.0" prefHeight="73.0" prefWidth="151.0"> | ||
<children> | ||
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#2bab35" height="73.0" stroke="BLACK" strokeType="INSIDE" width="151.0" /> | ||
<Label layoutX="42.0" layoutY="15.0" text="Yes"> | ||
<font> | ||
<Font name="System Bold" size="36.0" /> | ||
</font> | ||
</Label> | ||
</children> | ||
</AnchorPane> | ||
<AnchorPane fx:id="noButton" layoutX="234.0" layoutY="152.0" prefHeight="73.0" prefWidth="151.0"> | ||
<children> | ||
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#a4300d" height="73.0" stroke="BLACK" strokeType="INSIDE" width="151.0" /> | ||
<Label layoutX="50.0" layoutY="15.0" text="No"> | ||
<font> | ||
<Font name="System Bold" size="36.0" /> | ||
</font> | ||
</Label> | ||
</children> | ||
</AnchorPane> | ||
</children> | ||
</AnchorPane> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters