Merge branch 'guiSeb' into 'master'
Client GUI Application Elements, namely the Chat See merge request cs108-fs22/Gruppe-8!3
This commit is contained in:
commit
5a36988cd2
@ -261,6 +261,10 @@ Stand 17:30 Uhr:
|
|||||||
lebt. LISTL wurde auch implementiert aber noch nicht getestet.
|
lebt. LISTL wurde auch implementiert aber noch nicht getestet.
|
||||||
|
|
||||||
|
|
||||||
|
12.04.2022 - Sebastian
|
||||||
|
Nach dem durchstöbern vieler Literatur endlich die Grundidee für den Chat-GUI. Insbesondere mit Hinblick
|
||||||
|
auf Integration in einen grösseres GUI-Modul. Wir werden wohl JavaFX(openFX) verwenden.
|
||||||
|
|
||||||
ToDo:
|
ToDo:
|
||||||
Spiellogik: - Send() methode von Passenger mit Client-Server verknüpfen(Seraina)
|
Spiellogik: - Send() methode von Passenger mit Client-Server verknüpfen(Seraina)
|
||||||
- NoiseHandler (Alex)
|
- NoiseHandler (Alex)
|
||||||
|
|||||||
@ -0,0 +1,5 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui;
|
||||||
|
|
||||||
|
public class ClientController {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui;
|
||||||
|
|
||||||
|
public class ClientModel {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui;
|
||||||
|
|
||||||
|
public class ClientView {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
|
||||||
|
|
||||||
|
import javafx.beans.property.BooleanProperty;
|
||||||
|
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 Node implements ControlWrapper {
|
||||||
|
|
||||||
|
private static RadioButton broadcast = new RadioButton("Broadcast");
|
||||||
|
@Override
|
||||||
|
public Control getControl() {
|
||||||
|
return broadcast;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
|
||||||
|
|
||||||
|
public class ChatController {
|
||||||
|
|
||||||
|
public void setChatView(){};
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
|
||||||
|
|
||||||
|
public interface ChatMsg {
|
||||||
|
|
||||||
|
public String display(String msg);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
|
||||||
|
|
||||||
|
public interface ChatObserver {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,81 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
|
||||||
|
|
||||||
|
import javafx.beans.property.BooleanProperty;
|
||||||
|
import javafx.beans.property.ObjectProperty;
|
||||||
|
import javafx.beans.property.Property;
|
||||||
|
import javafx.collections.ObservableMap;
|
||||||
|
import javafx.scene.Node;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.control.RadioButton;
|
||||||
|
import javafx.scene.control.Toggle;
|
||||||
|
import javafx.scene.control.ToggleGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If this is toggled than the client chat is operating in whisper mode.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public abstract class ChatTargetToggle extends Node implements Toggle{
|
||||||
|
|
||||||
|
BooleanProperty isToggled;
|
||||||
|
ObjectProperty<ToggleGroup> myFriends;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns The {@link ToggleGroup} to which this {@code Toggle} belongs.
|
||||||
|
*
|
||||||
|
* @return The {@link ToggleGroup} to which this {@code Toggle} belongs.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ToggleGroup getToggleGroup() {
|
||||||
|
return myFriends.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the {@link ToggleGroup} to which this {@code Toggle} belongs.
|
||||||
|
*
|
||||||
|
* @param toggleGroup The new {@link ToggleGroup}.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setToggleGroup(ToggleGroup toggleGroup) {
|
||||||
|
myFriends.bindBidirectional((Property<ToggleGroup>) toggleGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The {@link ToggleGroup} to which this {@code Toggle} belongs.
|
||||||
|
*
|
||||||
|
* @return the toggle group property
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ObjectProperty<ToggleGroup> toggleGroupProperty() {
|
||||||
|
return myFriends;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether this {@code Toggle} is selected.
|
||||||
|
*
|
||||||
|
* @return {@code true} if this {@code Toggle} is selected.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean isSelected() {
|
||||||
|
return isToggled.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets this {@code Toggle} as selected or unselected.
|
||||||
|
*
|
||||||
|
* @param selected {@code true} to make this {@code Toggle} selected.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setSelected(boolean selected) {
|
||||||
|
this.isToggled.set(selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The selected state for this {@code Toggle}.
|
||||||
|
*
|
||||||
|
* @return the selected property
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BooleanProperty selectedProperty() {
|
||||||
|
return isToggled;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
|
||||||
|
|
||||||
|
import javafx.geometry.Orientation;
|
||||||
|
import javafx.scene.Node;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.control.SplitPane;
|
||||||
|
import javafx.scene.control.TextArea;
|
||||||
|
import javafx.scene.layout.AnchorPane;
|
||||||
|
import javafx.scene.layout.HBox;
|
||||||
|
import javafx.scene.layout.Pane;
|
||||||
|
import javax.print.attribute.standard.OrientationRequested;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the view of the client chat gui.
|
||||||
|
*/
|
||||||
|
public class ChatView extends Node implements NodeWithChildren, ChildNode {
|
||||||
|
|
||||||
|
|
||||||
|
private Pane root;
|
||||||
|
|
||||||
|
public void createNodeHierarchy(){
|
||||||
|
Button send = new SendButton();
|
||||||
|
AnchorPane whereTheSendFieldLives = new AnchorPane();
|
||||||
|
whereTheSendFieldLives.getChildren().add(send);
|
||||||
|
|
||||||
|
OutMsgTargetChooserNode chooseTarget = new OutMsgTargetChooserNode();
|
||||||
|
AnchorPane whereTheTargetFieldLives = new AnchorPane();
|
||||||
|
whereTheTargetFieldLives.getChildren().add(chooseTarget.getChildren());
|
||||||
|
|
||||||
|
TextArea clientOutgoingChatMsg = new TextArea();
|
||||||
|
AnchorPane whereOutTextLives = new AnchorPane();
|
||||||
|
whereOutTextLives.getChildren().add(clientOutgoingChatMsg);
|
||||||
|
|
||||||
|
|
||||||
|
TextArea target = new TextArea();
|
||||||
|
|
||||||
|
|
||||||
|
SplitPane inputOutputSeperation = new SplitPane();
|
||||||
|
SplitPane sendAndToggleSeperation = new SplitPane();
|
||||||
|
HBox buttonAndTextSeperation = new HBox();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
sendAndToggleSeperation.setOrientation(Orientation.HORIZONTAL);
|
||||||
|
sendAndToggleSeperation.getItems().add(whereTheSendFieldLives);
|
||||||
|
sendAndToggleSeperation.getItems().add(whereTheTargetFieldLives);
|
||||||
|
/*
|
||||||
|
buttonAndTextSeperation.a
|
||||||
|
buttonAndTextSeperation.getItems().add(sendAndToggleSeperation);
|
||||||
|
buttonAndTextSeperation.getItems().add()
|
||||||
|
*/
|
||||||
|
|
||||||
|
inputOutputSeperation.setOrientation(Orientation.HORIZONTAL);
|
||||||
|
inputOutputSeperation.getItems().add(sendAndToggleSeperation);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Pane getRootPane() {
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ChildNode getInstance() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Node getChildren() {
|
||||||
|
//TODO implement
|
||||||
|
return NodeWithChildren.super.getChildren();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
|
||||||
|
|
||||||
|
import javafx.scene.layout.Pane;
|
||||||
|
|
||||||
|
public interface ChildNode {
|
||||||
|
|
||||||
|
public Pane getRootPane();
|
||||||
|
public ChildNode getInstance();
|
||||||
|
|
||||||
|
}
|
||||||
@ -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();
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
|
||||||
|
|
||||||
|
public interface InChatObserver {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,225 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
|
||||||
|
|
||||||
|
import javafx.beans.InvalidationListener;
|
||||||
|
import javafx.beans.property.Property;
|
||||||
|
import javafx.beans.value.ChangeListener;
|
||||||
|
import javafx.beans.value.ObservableValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents an incoming chat message to be displayed by the clients gui. When creating
|
||||||
|
* an instance we should make sure we are also passing a String, otherwise {@code incomingChatMsg}
|
||||||
|
* will have a null value. For now the {@code getValue()} and {@code setValue(Object value)} are the
|
||||||
|
* main focus.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class InComingChMsg implements Property {
|
||||||
|
|
||||||
|
private String incomingChatMsg;
|
||||||
|
|
||||||
|
public InComingChMsg(String incomingChatMsg) {
|
||||||
|
this.incomingChatMsg = incomingChatMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public InComingChMsg() {
|
||||||
|
this.incomingChatMsg = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a unidirection binding for this {@code Property}.
|
||||||
|
* <p>
|
||||||
|
* Note that JavaFX has all the bind calls implemented through weak listeners. This means the
|
||||||
|
* bound property can be garbage collected and stopped from being updated.
|
||||||
|
*
|
||||||
|
* @param observable The observable this {@code Property} should be bound to.
|
||||||
|
* @throws NullPointerException if {@code observable} is {@code null}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void bind(ObservableValue observable) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the unidirectional binding for this {@code Property}.
|
||||||
|
* <p>
|
||||||
|
* If the {@code Property} is not bound, calling this method has no effect.
|
||||||
|
*
|
||||||
|
* @see #bind(ObservableValue)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void unbind() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Can be used to check, if a {@code Property} is bound.
|
||||||
|
*
|
||||||
|
* @return {@code true} if the {@code Property} is bound, {@code false} otherwise
|
||||||
|
* @see #bind(ObservableValue)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean isBound() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a bidirectional binding between this {@code Property} and another one. Bidirectional
|
||||||
|
* bindings exists independently of unidirectional bindings. So it is possible to add
|
||||||
|
* unidirectional binding to a property with bidirectional binding and vice-versa. However, this
|
||||||
|
* practice is discouraged.
|
||||||
|
* <p>
|
||||||
|
* It is possible to have multiple bidirectional bindings of one Property.
|
||||||
|
* <p>
|
||||||
|
* JavaFX bidirectional binding implementation use weak listeners. This means bidirectional
|
||||||
|
* binding does not prevent properties from being garbage collected.
|
||||||
|
*
|
||||||
|
* @param other the other {@code Property}
|
||||||
|
* @throws NullPointerException if {@code other} is {@code null}
|
||||||
|
* @throws IllegalArgumentException if {@code other} is {@code this}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void bindBidirectional(Property other) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a bidirectional binding between this {@code Property} and another one.
|
||||||
|
* <p>
|
||||||
|
* If no bidirectional binding between the properties exists, calling this method has no effect.
|
||||||
|
* <p>
|
||||||
|
* It is possible to unbind by a call on the second property. This code will work:
|
||||||
|
*
|
||||||
|
* <blockquote><pre>
|
||||||
|
* property1.bindBirectional(property2);
|
||||||
|
* property2.unbindBidirectional(property1);
|
||||||
|
* </pre></blockquote>
|
||||||
|
*
|
||||||
|
* @param other the other {@code Property}
|
||||||
|
* @throws NullPointerException if {@code other} is {@code null}
|
||||||
|
* @throws IllegalArgumentException if {@code other} is {@code this}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void unbindBidirectional(Property other) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the {@code Object} that contains this property. If this property is not contained in an
|
||||||
|
* {@code Object}, {@code null} is returned.
|
||||||
|
*
|
||||||
|
* @return the containing {@code Object} or {@code null}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getBean() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the name of this property. If the property does not have a name, this method returns an
|
||||||
|
* empty {@code String}.
|
||||||
|
*
|
||||||
|
* @return the name or an empty {@code String}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a {@link ChangeListener} which will be notified whenever the value of the {@code
|
||||||
|
* ObservableValue} changes. If the same listener is added more than once, then it will be
|
||||||
|
* notified more than once. That is, no check is made to ensure uniqueness.
|
||||||
|
* <p>
|
||||||
|
* Note that the same actual {@code ChangeListener} instance may be safely registered for
|
||||||
|
* different {@code ObservableValues}.
|
||||||
|
* <p>
|
||||||
|
* The {@code ObservableValue} stores a strong reference to the listener which will prevent the
|
||||||
|
* listener from being garbage collected and may result in a memory leak. It is recommended to
|
||||||
|
* either unregister a listener by calling {@link #removeListener(ChangeListener) removeListener}
|
||||||
|
* after use or to use an instance of {@link WeakChangeListener} avoid this situation.
|
||||||
|
*
|
||||||
|
* @param listener The listener to register
|
||||||
|
* @throws NullPointerException if the listener is null
|
||||||
|
* @see #removeListener(ChangeListener)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void addListener(ChangeListener listener) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the given listener from the list of listeners that are notified whenever the value of
|
||||||
|
* the {@code ObservableValue} changes.
|
||||||
|
* <p>
|
||||||
|
* If the given listener has not been previously registered (i.e. it was never added) then this
|
||||||
|
* method call is a no-op. If it had been previously added then it will be removed. If it had been
|
||||||
|
* added more than once, then only the first occurrence will be removed.
|
||||||
|
*
|
||||||
|
* @param listener The listener to remove
|
||||||
|
* @throws NullPointerException if the listener is null
|
||||||
|
* @see #addListener(ChangeListener)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void removeListener(ChangeListener listener) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current value of this {@code ObservableValue}
|
||||||
|
*
|
||||||
|
* @return The current value
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getValue() {
|
||||||
|
return this.incomingChatMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the wrapped value.
|
||||||
|
*
|
||||||
|
* @param value The new value
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setValue(Object value) {
|
||||||
|
this.incomingChatMsg = (String) value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds an {@link InvalidationListener} which will be notified whenever the {@code Observable}
|
||||||
|
* becomes invalid. If the same listener is added more than once, then it will be notified more
|
||||||
|
* than once. That is, no check is made to ensure uniqueness.
|
||||||
|
* <p>
|
||||||
|
* Note that the same actual {@code InvalidationListener} instance may be safely registered for
|
||||||
|
* different {@code Observables}.
|
||||||
|
* <p>
|
||||||
|
* The {@code Observable} stores a strong reference to the listener which will prevent the
|
||||||
|
* listener from being garbage collected and may result in a memory leak. It is recommended to
|
||||||
|
* either unregister a listener by calling {@link #removeListener(InvalidationListener)
|
||||||
|
* removeListener} after use or to use an instance of {@link WeakInvalidationListener} avoid this
|
||||||
|
* situation.
|
||||||
|
*
|
||||||
|
* @param listener The listener to register
|
||||||
|
* @throws NullPointerException if the listener is null
|
||||||
|
* @see #removeListener(InvalidationListener)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void addListener(InvalidationListener listener) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the given listener from the list of listeners, that are notified whenever the value of
|
||||||
|
* the {@code Observable} becomes invalid.
|
||||||
|
* <p>
|
||||||
|
* If the given listener has not been previously registered (i.e. it was never added) then this
|
||||||
|
* method call is a no-op. If it had been previously added then it will be removed. If it had been
|
||||||
|
* added more than once, then only the first occurrence will be removed.
|
||||||
|
*
|
||||||
|
* @param listener The listener to remove
|
||||||
|
* @throws NullPointerException if the listener is null
|
||||||
|
* @see #addListener(InvalidationListener)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void removeListener(InvalidationListener listener) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
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
|
||||||
|
*/
|
||||||
|
public interface NodeWithChildren {
|
||||||
|
|
||||||
|
void create();
|
||||||
|
|
||||||
|
public default Node getChildren() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
void createNodeHierarchy();
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
|
||||||
|
|
||||||
|
public interface OutChatObserver {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
|
||||||
|
|
||||||
|
import javafx.collections.ObservableList;
|
||||||
|
import javafx.scene.Node;
|
||||||
|
import javafx.scene.control.Toggle;
|
||||||
|
import javafx.scene.control.ToggleGroup;
|
||||||
|
import javafx.scene.layout.HBox;
|
||||||
|
import javafx.scene.layout.Pane;
|
||||||
|
|
||||||
|
public class OutMsgTargetChooserNode extends ToggleGroup implements NodeWithChildren {
|
||||||
|
|
||||||
|
private Pane root;
|
||||||
|
private ObservableList<Node> targets;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Node getChildren() {
|
||||||
|
return NodeWithChildren.super.getChildren();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createNodeHierarchy() {
|
||||||
|
this.root = new HBox();
|
||||||
|
for(Node n : targets)
|
||||||
|
root.getChildren().add(n);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
|
||||||
|
|
||||||
|
public interface PropertyButton {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
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() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Any class that represents a JavaFX node that takes user input should implement this interface.
|
||||||
|
*/
|
||||||
|
public interface UINode {
|
||||||
|
|
||||||
|
void listen();
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat;
|
||||||
|
|
||||||
|
import javafx.scene.control.Control;
|
||||||
|
import javafx.scene.control.RadioButton;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the toggle for a whisper chat.
|
||||||
|
*/
|
||||||
|
public class WhisperButton implements ControlWrapper {
|
||||||
|
|
||||||
|
private static RadioButton whisper = new RadioButton("Whisper");
|
||||||
|
@Override
|
||||||
|
public Control getControl() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user