Further Building the scene

This commit is contained in:
Sebastian Lenzlinger 2022-04-13 01:45:32 +02:00
parent e4f9776f7f
commit 3e2288026b
7 changed files with 39 additions and 9 deletions

View File

@ -5,15 +5,21 @@ import javafx.beans.property.ObjectProperty;
import javafx.collections.ObservableMap;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.Control;
import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.Toggle;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.Pane;
/**
* Represents toggling to broadcast to everyone
*/
public class BroadcastButton extends ChatTargetToggle implements Toggle {
Label l = new Label("Broadcast");
public class BroadcastButton extends Node implements ControlWrapper {
private static RadioButton broadcast = new RadioButton("Broadcast");
@Override
public Control getControl() {
return broadcast;
}
}

View File

@ -0,0 +1,9 @@
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
import javafx.scene.control.Control;
public interface ControlWrapper {
public Control getControl();
}

View File

@ -1,5 +1,7 @@
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
import javafx.scene.Node;
/**
* Any class that represents a JavaFX node and has children should implement this interface
*/
@ -7,7 +9,7 @@ public interface NodeWithChildren {
void create();
public default void getChildren(){};
public default Node getChildren(){};
void createNodeHierarchy();
}

View File

@ -18,7 +18,7 @@ public class OutMsgTargetChooserNode extends ToggleGroup implements NodeWithChil
}
@Override
public void getChildren() {
public Node getChildren() {
NodeWithChildren.super.getChildren();
}

View File

@ -0,0 +1,5 @@
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
public interface PropertyButton {
}

View File

@ -3,12 +3,16 @@ package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
import javafx.scene.Node;
import javafx.scene.control.Button;
/**
* Represents the button in the chat to send a chat message.
*/
public class SendButton extends Button implements UINode {
public SendButton() {
super("Send");
}
@Override
public void listen() {

View File

@ -1,12 +1,16 @@
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
import javafx.scene.control.Label;
import javafx.scene.control.Control;
import javafx.scene.control.RadioButton;
/**
* Represents the toggle for a whisper chat.
*/
public class WhisperButton extends ChatTargetToggle {
Label l = new Label("Whisper");
public class WhisperButton implements ControlWrapper {
private static RadioButton whisper = new RadioButton("Whisper");
@Override
public Control getControl() {
return null;
}
}