Updated UI (again)

This commit is contained in:
delvh 2020-06-28 22:30:14 +02:00
parent 63aa7859d3
commit 6eb726af31
8 changed files with 369 additions and 297 deletions

View File

@ -5,11 +5,14 @@ import java.util.logging.Logger;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.*; import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType; import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.ButtonType;
import javafx.scene.control.ListView;
import envoy.client.data.LocalDB; import envoy.client.data.LocalDB;
import envoy.client.event.SendEvent; import envoy.client.event.SendEvent;
import envoy.client.ui.ClearableTextField;
import envoy.client.ui.ContactListCell; import envoy.client.ui.ContactListCell;
import envoy.client.ui.SceneContext; import envoy.client.ui.SceneContext;
import envoy.data.Contact; import envoy.data.Contact;
@ -31,19 +34,7 @@ import envoy.util.EnvoyLog;
public class ContactSearchScene { public class ContactSearchScene {
@FXML @FXML
private Button backButton; private ClearableTextField searchBar;
@FXML
private Button clearButton;
@FXML
private Button searchButton;
@FXML
private Button newGroupButton;
@FXML
private TextField searchBar;
@FXML @FXML
private ListView<Contact> contactList; private ListView<Contact> contactList;
@ -78,20 +69,12 @@ public class ContactSearchScene {
* @since Envoy Client v0.1-beta * @since Envoy Client v0.1-beta
*/ */
@FXML @FXML
private void checkClearButton() { private void sendRequest() {
final var containsContent = searchBar.getText().strip().isEmpty(); final var text = searchBar.getTextField().getText().strip();
clearButton.setDisable(containsContent); if (!text.isBlank()) eventBus.dispatch(new SendEvent(new ContactSearchRequest(text)));
searchButton.setDisable(containsContent); else contactList.getItems().clear();
} }
/**
* Sends a {@link ContactSearchRequest} to the server.
*
* @since Envoy Client v0.1-beta
*/
@FXML
private void suggestContacts() { eventBus.dispatch(new SendEvent(new ContactSearchRequest(searchBar.getText()))); }
/** /**
* Clears the text in the search bar and the items shown in the list. * Clears the text in the search bar and the items shown in the list.
* Additionally disables both clear and search button. * Additionally disables both clear and search button.
@ -100,10 +83,8 @@ public class ContactSearchScene {
*/ */
@FXML @FXML
private void clear() { private void clear() {
searchBar.setText(null); searchBar.getTextField().setText(null);
contactList.getItems().clear(); contactList.getItems().clear();
clearButton.setDisable(true);
searchButton.setDisable(true);
} }
/** /**

View File

@ -9,6 +9,7 @@ import javafx.scene.control.Alert.AlertType;
import envoy.client.data.LocalDB; import envoy.client.data.LocalDB;
import envoy.client.event.SendEvent; import envoy.client.event.SendEvent;
import envoy.client.ui.ClearableTextField;
import envoy.client.ui.ContactListCell; import envoy.client.ui.ContactListCell;
import envoy.client.ui.SceneContext; import envoy.client.ui.SceneContext;
import envoy.data.Contact; import envoy.data.Contact;
@ -30,7 +31,7 @@ public class GroupCreationScene {
private Button createButton; private Button createButton;
@FXML @FXML
private TextField groupNameField; private ClearableTextField groupNameField;
@FXML @FXML
private ListView<Contact> contactList; private ListView<Contact> contactList;
@ -63,7 +64,18 @@ public class GroupCreationScene {
* @since Envoy Client v0.1-beta * @since Envoy Client v0.1-beta
*/ */
@FXML @FXML
private void contactListClicked() { createButton.setDisable(contactList.getSelectionModel().isEmpty()); } private void contactListClicked() {
createButton.setDisable(contactList.getSelectionModel().isEmpty() || groupNameField.getTextField().getText().isBlank());
}
/**
* Checks, whether the {@code createButton} can be enabled because text is
* present in the textfield.
*
* @since Envoy Client v0.1-beta
*/
@FXML
private void textUpdated() { createButton.setDisable(groupNameField.getTextField().getText().isBlank()); }
/** /**
* Sends a {@link GroupCreation} to the server and closes this scene. * Sends a {@link GroupCreation} to the server and closes this scene.
@ -74,10 +86,10 @@ public class GroupCreationScene {
*/ */
@FXML @FXML
private void createButtonClicked() { private void createButtonClicked() {
final var name = groupNameField.getText(); final var name = groupNameField.getTextField().getText();
if (!Bounds.isValidContactName(name)) { if (!Bounds.isValidContactName(name)) {
new Alert(AlertType.ERROR, "The entered group name is not valid (" + Bounds.CONTACT_NAME_PATTERN + ")").showAndWait(); new Alert(AlertType.ERROR, "The entered group name is not valid (" + Bounds.CONTACT_NAME_PATTERN + ")").showAndWait();
groupNameField.clear(); groupNameField.getTextField().clear();
} else { } else {
eventBus.dispatch(new SendEvent(new GroupCreation(name, eventBus.dispatch(new SendEvent(new GroupCreation(name,
contactList.getSelectionModel().getSelectedItems().stream().map(Contact::getID).collect(Collectors.toSet())))); contactList.getSelectionModel().getSelectedItems().stream().map(Contact::getID).collect(Collectors.toSet()))));

View File

@ -13,6 +13,7 @@ import javafx.scene.control.Alert.AlertType;
import envoy.client.data.*; import envoy.client.data.*;
import envoy.client.net.Client; import envoy.client.net.Client;
import envoy.client.ui.ClearableTextField;
import envoy.client.ui.SceneContext; import envoy.client.ui.SceneContext;
import envoy.client.ui.Startup; import envoy.client.ui.Startup;
import envoy.data.LoginCredentials; import envoy.data.LoginCredentials;
@ -38,7 +39,7 @@ import envoy.util.EnvoyLog;
public final class LoginScene { public final class LoginScene {
@FXML @FXML
private TextField userTextField; private ClearableTextField userTextField;
@FXML @FXML
private PasswordField passwordField; private PasswordField passwordField;
@ -116,17 +117,17 @@ public final class LoginScene {
if (registerCheckBox.isSelected() && !passwordField.getText().equals(repeatPasswordField.getText())) { if (registerCheckBox.isSelected() && !passwordField.getText().equals(repeatPasswordField.getText())) {
new Alert(AlertType.ERROR, "The entered password is unequal to the repeated one").showAndWait(); new Alert(AlertType.ERROR, "The entered password is unequal to the repeated one").showAndWait();
repeatPasswordField.clear(); repeatPasswordField.clear();
} else if (!Bounds.isValidContactName(userTextField.getText())) { } else if (!Bounds.isValidContactName(userTextField.getTextField().getText())) {
new Alert(AlertType.ERROR, "The entered user name is not valid (" + Bounds.CONTACT_NAME_PATTERN + ")").showAndWait(); new Alert(AlertType.ERROR, "The entered user name is not valid (" + Bounds.CONTACT_NAME_PATTERN + ")").showAndWait();
userTextField.clear(); userTextField.getTextField().clear();
} else } else performHandshake(new LoginCredentials(userTextField.getTextField().getText(), passwordField.getText().toCharArray(),
performHandshake( registerCheckBox.isSelected(), Startup.VERSION));
new LoginCredentials(userTextField.getText(), passwordField.getText().toCharArray(), registerCheckBox.isSelected(), Startup.VERSION));
} }
@FXML @FXML
private void offlineModeButtonPressed() { private void offlineModeButtonPressed() {
attemptOfflineMode(new LoginCredentials(userTextField.getText(), passwordField.getText().toCharArray(), false, Startup.VERSION)); attemptOfflineMode(
new LoginCredentials(userTextField.getTextField().getText(), passwordField.getText().toCharArray(), false, Startup.VERSION));
} }
@FXML @FXML

View File

@ -12,9 +12,9 @@
<?import javafx.scene.layout.GridPane?> <?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?> <?import javafx.scene.layout.RowConstraints?>
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" <GridPane hgap="5.0" maxHeight="-Infinity" maxWidth="-Infinity"
minHeight="400.0" minWidth="350.0" prefHeight="400.0" prefWidth="600.0" minHeight="400.0" minWidth="350.0" prefHeight="400.0" prefWidth="600.0"
xmlns="http://javafx.com/javafx/11.0.1" vgap="2.0" xmlns="http://javafx.com/javafx/11.0.1"
xmlns:fx="http://javafx.com/fxml/1" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="envoy.client.ui.controller.ChatScene"> fx:controller="envoy.client.ui.controller.ChatScene">
<columnConstraints> <columnConstraints>
@ -47,7 +47,7 @@
prefHeight="211.0" prefWidth="300.0" GridPane.rowIndex="1" prefHeight="211.0" prefWidth="300.0" GridPane.rowIndex="1"
GridPane.rowSpan="2147483647"> GridPane.rowSpan="2147483647">
<GridPane.margin> <GridPane.margin>
<Insets bottom="10.0" left="10.0" right="5.0" top="5.0" /> <Insets bottom="10.0" left="10.0" />
</GridPane.margin> </GridPane.margin>
<padding> <padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
@ -64,7 +64,7 @@
<Label fx:id="contactLabel" prefHeight="16.0" prefWidth="250.0" <Label fx:id="contactLabel" prefHeight="16.0" prefWidth="250.0"
text="Select a contact to chat with" GridPane.columnSpan="2"> text="Select a contact to chat with" GridPane.columnSpan="2">
<GridPane.margin> <GridPane.margin>
<Insets left="15.0" right="5.0" top="5.0" /> <Insets left="10.0" />
</GridPane.margin> </GridPane.margin>
<padding> <padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
@ -75,17 +75,18 @@
GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.columnIndex="1" GridPane.columnSpan="2"
GridPane.halignment="RIGHT" GridPane.valignment="CENTER"> GridPane.halignment="RIGHT" GridPane.valignment="CENTER">
<GridPane.margin> <GridPane.margin>
<Insets bottom="10.0" left="5.0" right="10.0" top="10.0" /> <Insets bottom="10.0" right="10.0" top="10.0" />
</GridPane.margin> </GridPane.margin>
<padding> <padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding> </padding>
</Button> </Button>
<ListView fx:id="messageList" prefHeight="257.0" <ListView fx:id="messageList" prefHeight="257.0"
prefWidth="465.0" GridPane.columnIndex="1" GridPane.columnSpan="2" prefWidth="465.0" GridPane.columnIndex="1"
GridPane.rowIndex="1" GridPane.rowSpan="2"> GridPane.columnSpan="2147483647" GridPane.rowIndex="1"
GridPane.rowSpan="2">
<GridPane.margin> <GridPane.margin>
<Insets bottom="5.0" left="5.0" right="10.0" top="5.0" /> <Insets left="5.0" right="10.0" />
</GridPane.margin> </GridPane.margin>
<padding> <padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
@ -111,11 +112,8 @@
GridPane.halignment="CENTER" GridPane.rowIndex="4" GridPane.halignment="CENTER" GridPane.rowIndex="4"
GridPane.valignment="BOTTOM"> GridPane.valignment="BOTTOM">
<GridPane.margin> <GridPane.margin>
<Insets bottom="10.0" left="5.0" right="10.0" /> <Insets bottom="10.0" right="10.0" />
</GridPane.margin> </GridPane.margin>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
<tooltip> <tooltip>
<Tooltip anchorLocation="WINDOW_TOP_LEFT" autoHide="true" <Tooltip anchorLocation="WINDOW_TOP_LEFT" autoHide="true"
maxWidth="350.0" maxWidth="350.0"
@ -130,6 +128,9 @@
</items> </items>
</ContextMenu> </ContextMenu>
</contextMenu> </contextMenu>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</Button> </Button>
<TextArea fx:id="messageTextArea" disable="true" <TextArea fx:id="messageTextArea" disable="true"
onInputMethodTextChanged="#messageTextUpdated" onInputMethodTextChanged="#messageTextUpdated"
@ -137,7 +138,7 @@
prefHeight="200.0" prefWidth="200.0" wrapText="true" prefHeight="200.0" prefWidth="200.0" wrapText="true"
GridPane.columnIndex="1" GridPane.rowIndex="4"> GridPane.columnIndex="1" GridPane.rowIndex="4">
<GridPane.margin> <GridPane.margin>
<Insets bottom="10.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="10.0" left="5.0" top="3.0" />
</GridPane.margin> </GridPane.margin>
<opaqueInsets> <opaqueInsets>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
@ -163,7 +164,7 @@
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</GridPane.margin> </GridPane.margin>
<padding> <padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" top="5.0" />
</padding> </padding>
<opaqueInsets> <opaqueInsets>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />

View File

@ -1,77 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import envoy.client.ui.ClearableTextField?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?> <?import javafx.scene.control.Button?>
<?import javafx.scene.control.ListView?> <?import javafx.scene.control.ListView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.Tooltip?> <?import javafx.scene.control.Tooltip?>
<?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="envoy.client.ui.controller.ContactSearchScene"> <VBox maxHeight="-Infinity" maxWidth="-Infinity"
<children> minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0"
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0"> prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1"
<children> xmlns:fx="http://javafx.com/fxml/1"
<TextField fx:id="searchBar" onInputMethodTextChanged="#checkClearButton" onKeyTyped="#checkClearButton" prefColumnCount="22" promptText="Enter username to search for"> fx:controller="envoy.client.ui.controller.ContactSearchScene">
<HBox.margin> <children>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0">
</HBox.margin> <children>
<padding> <ClearableTextField fx:id="searchBar"
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> prefWidth="310.0">
</padding> <textField onInputMethodTextChanged="#sendRequest"
<tooltip> onKeyTyped="#sendRequest" prefColumnCount="22"
<Tooltip text="Enter a name. If an account by that name exists, it will be displayed below." wrapText="true" /> promptText="Enter username to search for">
</tooltip> </textField>
</TextField> <HBox.margin>
<Button fx:id="clearButton" disable="true" mnemonicParsing="true" onAction="#clear" prefHeight="26.0" prefWidth="110.0" text="Clea_r"> <Insets bottom="5.0" left="5.0" right="5.0" top="15.0" />
<tooltip> </HBox.margin>
<Tooltip autoHide="true" text="Clears the text to the left and the elements below" wrapText="true" /> <padding>
</tooltip> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<HBox.margin> </padding>
<Insets bottom="5.0" left="5.0" right="10.0" top="5.0" /> <tooltip>
</HBox.margin> <Tooltip
<padding> text="Enter a name. If an account by that name exists, it will be displayed below."
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> wrapText="true" />
</padding> </tooltip>
</Button> </ClearableTextField>
<Button fx:id="searchButton" defaultButton="true" disable="true" mnemonicParsing="true" onAction="#suggestContacts" prefHeight="26.0" prefWidth="124.0" text="_Search" textOverrun="LEADING_WORD_ELLIPSIS"> <Button mnemonicParsing="false"
<padding> onAction="#newGroupButtonClicked" prefHeight="26.0"
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> prefWidth="139.0" text="New Group">
</padding> <HBox.margin>
<HBox.margin> <Insets bottom="5.0" left="30.0" right="5.0" top="5.0" />
<Insets bottom="5.0" right="20.0" top="5.0" /> </HBox.margin>
</HBox.margin> <padding>
<tooltip> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<Tooltip autoHide="true" text="Search for accounts with the name entered to the left" wrapText="true" /> </padding>
</tooltip> </Button>
</Button> </children>
<Button mnemonicParsing="false" onAction="#newGroupButtonClicked" prefHeight="26.0" prefWidth="139.0" text="New Group"> </HBox>
<HBox.margin> <ListView fx:id="contactList"
<Insets bottom="5.0" left="20.0" right="5.0" top="5.0" /> onMouseClicked="#contactListClicked" prefHeight="314.0"
</HBox.margin> prefWidth="600.0">
<padding> <padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding> </padding>
</Button> <VBox.margin>
</children> <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox> </VBox.margin>
<ListView fx:id="contactList" onMouseClicked="#contactListClicked" prefHeight="314.0" prefWidth="600.0"> </ListView>
<padding> <Button cancelButton="true" mnemonicParsing="true"
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> onAction="#backButtonClicked" text="_Back">
</padding> <VBox.margin>
<VBox.margin> <Insets bottom="10.0" left="10.0" />
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> </VBox.margin>
</VBox.margin></ListView> <padding>
<Button fx:id="backButton" cancelButton="true" mnemonicParsing="true" onAction="#backButtonClicked" text="_Back"> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<VBox.margin> </padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <tooltip>
</VBox.margin> <Tooltip autoHide="true"
<padding> text="Takes you back to the screen where you can chat with others"
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> wrapText="true" />
</padding> </tooltip>
<tooltip> </Button>
<Tooltip autoHide="true" text="Takes you back to the screen where you can chat with others" wrapText="true" /> </children>
</tooltip>
</Button>
</children>
</VBox> </VBox>

View File

@ -1,67 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import envoy.client.ui.ClearableTextField?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?> <?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?> <?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?> <?import javafx.scene.control.ListView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.Tooltip?> <?import javafx.scene.control.Tooltip?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="envoy.client.ui.controller.GroupCreationScene"> <VBox maxHeight="-Infinity" maxWidth="-Infinity"
<children> minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0"
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0"> prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1"
<children> xmlns:fx="http://javafx.com/fxml/1"
<TextField fx:id="groupNameField" prefColumnCount="22" promptText="Enter Group Name"> fx:controller="envoy.client.ui.controller.GroupCreationScene">
<HBox.margin> <children>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0">
</HBox.margin> <children>
<padding> <ClearableTextField fx:id="groupNameField">
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <textField prefColumnCount="22"
</padding> promptText="Enter Group Name"
<tooltip> onInputMethodTextChanged="#textUpdated" onKeyTyped="#textUpdated" />
<Tooltip text="Enter a name. If an account by that name exists, it will be displayed below." wrapText="true" /> <HBox.margin>
</tooltip> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</TextField> </HBox.margin>
</children> <padding>
</HBox> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<Label text="Choose Members:"> </padding>
<font> <tooltip>
<Font size="16.0" /> <Tooltip
</font> text="Enter something. A group with this name will be created."
<VBox.margin> wrapText="true" />
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> </tooltip>
</VBox.margin> </ClearableTextField>
<padding> </children>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> </HBox>
</padding> <Label text="Choose Members:">
</Label> <font>
<ListView fx:id="contactList" onMouseClicked="#contactListClicked" prefHeight="314.0" prefWidth="600.0"> <Font size="16.0" />
<VBox.margin> </font>
<Insets bottom="5.0" left="10.0" right="10.0" top="5.0" /> <padding>
</VBox.margin> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<padding> </padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> </Label>
</padding></ListView> <ListView fx:id="contactList"
<Button fx:id="createButton" defaultButton="true" disable="true" mnemonicParsing="false" onAction="#createButtonClicked" text="Create"> onMouseClicked="#contactListClicked" prefHeight="314.0"
<VBox.margin> prefWidth="600.0">
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <VBox.margin>
</VBox.margin> <Insets bottom="5.0" left="10.0" right="10.0" top="5.0" />
<padding> </VBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <padding>
</padding></Button> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<Button cancelButton="true" mnemonicParsing="true" onAction="#backButtonClicked" text="_Back"> </padding>
<VBox.margin> </ListView>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <BorderPane prefHeight="50.0">
</VBox.margin> <left>
<padding> <Button cancelButton="true" mnemonicParsing="true"
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> onAction="#backButtonClicked" text="_Back"
</padding> BorderPane.alignment="CENTER">
<tooltip> <padding>
<Tooltip autoHide="true" text="Takes you back to the screen where you can chat with others" wrapText="true" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</tooltip> </padding>
</Button> <tooltip>
</children> <Tooltip autoHide="true"
text="Takes you back to the screen where you can chat with others"
wrapText="true" />
</tooltip>
<BorderPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</BorderPane.margin>
</Button>
</left>
<right>
<Button fx:id="createButton" alignment="CENTER_RIGHT"
defaultButton="true" disable="true" mnemonicParsing="false"
onAction="#createButtonClicked" text="Create"
BorderPane.alignment="CENTER">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
<BorderPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</BorderPane.margin>
</Button>
</right>
</BorderPane>
</children>
</VBox> </VBox>

View File

@ -1,104 +1,149 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import envoy.client.ui.ClearableTextField?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?> <?import javafx.scene.control.Button?>
<?import javafx.scene.control.ButtonBar?>
<?import javafx.scene.control.CheckBox?> <?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.Label?> <?import javafx.scene.control.Label?>
<?import javafx.scene.control.PasswordField?> <?import javafx.scene.control.PasswordField?>
<?import javafx.scene.control.TextField?> <?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.ColumnConstraints?> <?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?> <?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?> <?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<VBox prefHeight="206.0" prefWidth="440.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="envoy.client.ui.controller.LoginScene"> <VBox prefHeight="206.0" prefWidth="440.0"
<children> xmlns="http://javafx.com/javafx/11.0.1"
<Label text="User Login"> xmlns:fx="http://javafx.com/fxml/1"
<font> fx:controller="envoy.client.ui.controller.LoginScene">
<Font size="26.0" /> <children>
</font> <Label text="User Login">
<VBox.margin> <font>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Font size="26.0" />
</VBox.margin> </font>
<padding> <VBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding> </VBox.margin>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</Label>
<GridPane hgap="5.0" vgap="10.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES"
minWidth="10.0" percentWidth="40.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES"
minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0"
vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0"
vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0"
vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="User Name:">
<GridPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</GridPane.margin>
<padding>
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0" />
</padding>
</Label> </Label>
<GridPane> <Label text="Password:" GridPane.rowIndex="1">
<columnConstraints> <padding>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="40.0" prefWidth="100.0" /> <Insets bottom="2.0" left="2.0" right="2.0" top="2.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> </padding>
</columnConstraints> <GridPane.margin>
<rowConstraints> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> </GridPane.margin>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> </Label>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <Label fx:id="repeatPasswordLabel" text="Repeat Password:"
</rowConstraints> visible="false" GridPane.rowIndex="2">
<children> <GridPane.margin>
<Label text="User Name:"> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<GridPane.margin> </GridPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <padding>
</GridPane.margin> <Insets bottom="2.0" left="2.0" right="2.0" top="2.0" />
<padding> </padding>
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0" /> </Label>
</padding></Label> <ClearableTextField fx:id="userTextField"
<Label text="Password" GridPane.rowIndex="1"> GridPane.columnIndex="1">
<padding> <GridPane.margin>
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0" /> <Insets bottom="10.0" left="5.0" right="5.0" top="5.0" />
</padding> </GridPane.margin>
<GridPane.margin> </ClearableTextField>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <PasswordField fx:id="passwordField"
</GridPane.margin></Label> GridPane.columnIndex="1" GridPane.rowIndex="1">
<Label fx:id="repeatPasswordLabel" text="Repeat Password:" visible="false" GridPane.rowIndex="2"> <GridPane.margin>
<GridPane.margin> <Insets bottom="10.0" left="5.0" right="5.0" top="10.0" />
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> </GridPane.margin>
</GridPane.margin> <padding>
<padding> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0" /> </padding>
</padding></Label> </PasswordField>
<TextField fx:id="userTextField" GridPane.columnIndex="1"> <PasswordField fx:id="repeatPasswordField"
<GridPane.margin> visible="false" GridPane.columnIndex="1" GridPane.rowIndex="2">
<Insets bottom="10.0" left="5.0" right="5.0" top="5.0" /> <GridPane.margin>
</GridPane.margin> <Insets bottom="5.0" left="5.0" right="5.0" top="10.0" />
<padding> </GridPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <padding>
</padding></TextField> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<PasswordField fx:id="passwordField" GridPane.columnIndex="1" GridPane.rowIndex="1"> </padding>
<GridPane.margin> </PasswordField>
<Insets bottom="10.0" left="5.0" right="5.0" top="10.0" /> </children>
</GridPane.margin> <VBox.margin>
<padding> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> </VBox.margin>
</padding></PasswordField> </GridPane>
<PasswordField fx:id="repeatPasswordField" visible="false" GridPane.columnIndex="1" GridPane.rowIndex="2"> <CheckBox fx:id="registerCheckBox" mnemonicParsing="true"
<GridPane.margin> onAction="#registerCheckboxChanged" prefHeight="17.0"
<Insets bottom="5.0" left="5.0" right="5.0" top="10.0" /> prefWidth="181.0" text="_Register">
</GridPane.margin> <VBox.margin>
<padding> <Insets left="5.0" right="3.0" />
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> </VBox.margin>
</padding></PasswordField> </CheckBox>
</children> <Label fx:id="connectionLabel">
</GridPane> <VBox.margin>
<CheckBox fx:id="registerCheckBox" mnemonicParsing="true" onAction="#registerCheckboxChanged" prefHeight="17.0" prefWidth="181.0" text="_Register"> <Insets left="5.0" />
<padding> </VBox.margin>
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0" /> </Label>
</padding> <BorderPane prefWidth="200.0">
<VBox.margin> <left>
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" /> <Button cancelButton="true" mnemonicParsing="false"
</VBox.margin></CheckBox> onAction="#abortLogin" text="Close" BorderPane.alignment="CENTER">
<Label fx:id="connectionLabel" /> <padding>
<ButtonBar prefHeight="40.0" prefWidth="200.0"> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<buttons> </padding>
<Button mnemonicParsing="false" onAction="#abortLogin" text="Close"> <BorderPane.margin>
<padding> <Insets />
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> </BorderPane.margin>
</padding> </Button>
</Button> </left>
<Button mnemonicParsing="false" onAction="#offlineModeButtonPressed" text="Offline mode" /> <center>
<Button defaultButton="true" mnemonicParsing="false" onAction="#loginButtonPressed" text="Login" /> <Button mnemonicParsing="false"
</buttons> onAction="#offlineModeButtonPressed" text="Offline mode"
</ButtonBar> BorderPane.alignment="CENTER">
</children> <BorderPane.margin>
<Insets />
</BorderPane.margin>
</Button>
</center>
<right>
<Button defaultButton="true" mnemonicParsing="false"
onAction="#loginButtonPressed" text="Login"
BorderPane.alignment="CENTER">
<BorderPane.margin>
<Insets />
</BorderPane.margin>
</Button>
</right>
<VBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" />
</VBox.margin>
</BorderPane>
</children>
</VBox> </VBox>

View File

@ -7,39 +7,50 @@
<?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<VBox alignment="TOP_RIGHT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="envoy.client.ui.controller.SettingsScene"> <VBox alignment="TOP_RIGHT" maxHeight="-Infinity"
maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
prefHeight="400.0" prefWidth="600.0"
xmlns="http://javafx.com/javafx/11.0.1"
xmlns:fx="http://javafx.com/fxml/1"
fx:controller="envoy.client.ui.controller.SettingsScene">
<children> <children>
<HBox prefHeight="389.0" prefWidth="600.0"> <HBox prefHeight="389.0" prefWidth="600.0">
<children> <children>
<ListView fx:id="settingsList" onMouseClicked="#settingsListClicked" prefHeight="200.0" prefWidth="200.0"> <ListView fx:id="settingsList"
<opaqueInsets> onMouseClicked="#settingsListClicked" prefHeight="200.0"
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> prefWidth="200.0">
</opaqueInsets> <opaqueInsets>
<HBox.margin> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<Insets bottom="10.0" left="10.0" right="5.0" top="10.0" /> </opaqueInsets>
</HBox.margin> <HBox.margin>
<padding> <Insets bottom="10.0" left="10.0" right="5.0" top="10.0" />
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> </HBox.margin>
</padding></ListView> <padding>
<TitledPane fx:id="titledPane" collapsible="false" prefHeight="325.0" prefWidth="300.0"> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<HBox.margin> </padding>
<Insets bottom="10.0" left="5.0" right="10.0" top="10.0" /> </ListView>
</HBox.margin> <TitledPane fx:id="titledPane" collapsible="false"
<padding> prefHeight="325.0" prefWidth="300.0">
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <HBox.margin>
</padding></TitledPane> <Insets bottom="10.0" left="5.0" right="10.0" top="10.0" />
</children> </HBox.margin>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</TitledPane>
</children>
</HBox> </HBox>
<Button defaultButton="true" mnemonicParsing="true" onMouseClicked="#backButtonClicked" text="_Back"> <Button defaultButton="true" mnemonicParsing="true"
<opaqueInsets> onMouseClicked="#backButtonClicked" text="_Back">
<Insets /> <opaqueInsets>
</opaqueInsets> <Insets />
<padding> </opaqueInsets>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <padding>
</padding> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<VBox.margin> </padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <VBox.margin>
</VBox.margin> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</Button> </VBox.margin>
</Button>
</children> </children>
</VBox> </VBox>