Shemplo/Neerc-chat-client

View on GitHub
src/main/resources/fxml/main.fxml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.layout.StackPane?>

<?import javafx.scene.layout.VBox?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.Button?>
<?import javafx.geometry.Insets?>

<?import javafx.scene.image.ImageView?>
<?import javafx.scene.image.Image?>

<?import javafx.scene.control.Separator?>
<?import com.panemu.tiwulfx.control.DetachableTabPane?>

<StackPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml"
           minHeight="500"
           fx:id="root">
    <VBox minWidth="700"
          minHeight="650">
        <HBox spacing="8"
              alignment="CENTER_LEFT"
              styleClass="top-panel">
            <padding>
                <Insets top="8" right="8" bottom="8" left="8"/>
            </padding>

            <Label styleClass="message-source"
                   style="-fx-font-size: 11pt"
                   alignment="BASELINE_RIGHT"
                   fx:id="login"/>
            <ImageView fx:id="connection_status_icon">
                <Image url="/gfx/offline.png"/>
            </ImageView>
            <Button fx:id="reconnect"
                    text="Reconnect"
                    styleClass="metal-button"
                    disable="true"/>
            <Label fx:id="connection_status"/>
        </HBox>
        <SplitPane VBox.vgrow="ALWAYS"
                   styleClass="splitter"
                   dividerPositions="1.0">
            <!-- was just a HBox -->
            <HBox>
                <VBox minWidth="150">
                    <ScrollPane vbarPolicy="NEVER"
                                hbarPolicy="NEVER"
                                pannable="true"
                                fx:id="users_horizon_v"
                                VBox.vgrow="ALWAYS">
                        <VBox alignment="CENTER_LEFT"
                              spacing="8"
                              fx:id="users_v">
                            <padding>
                                <Insets top="4" right="4" bottom="4" left="8"/>
                            </padding>
                        </VBox>
                    </ScrollPane>
                    <Button minWidth="85"
                            styleClass="metal-button"
                            fx:id="join_room"
                            text="Join room">
                        <VBox.margin>
                            <Insets top="5" left="8" bottom="10" right="4"/>
                        </VBox.margin>
                    </Button>
                </VBox>
                
                <VBox minWidth="350"
                      styleClass="left-column"
                      HBox.hgrow="ALWAYS">
                    
                    <!--
                    <HBox styleClass="top-left-panel">
                        <padding>
                            <Insets top="4"/>
                        </padding>
                        <ScrollPane vbarPolicy="NEVER"
                                    hbarPolicy="NEVER"
                                    pannable="true"
                                    fx:id="users_horizon_h"
                                    HBox.hgrow="ALWAYS">
                            <HBox alignment="CENTER_LEFT"
                                  spacing="8"
                                  fx:id="users_h">
                                <padding>
                                    <Insets top="4" right="4" bottom="4" left="8"/>
                                </padding>
                            </HBox>
                        </ScrollPane>
                        <Button minWidth="85"
                                styleClass="metal-button"
                                fx:id="join_room"
                                text="Join room">
                            <HBox.margin>
                                <Insets top="5" right="8" bottom="5" left="4"/>
                            </HBox.margin>
                        </Button>
                    </HBox>
                    -->
                    <VBox HBox.hgrow="ALWAYS" VBox.vgrow="ALWAYS">
                        <!-- this is KOSTYL for HiDPI screens -->
                        <DetachableTabPane fx:id="conversations"
                                           VBox.vgrow="ALWAYS"
                                           prefHeight="9999"
                                           minHeight="200"
                                           minWidth="350">
                        </DetachableTabPane>
                    </VBox>
                </VBox>
            </HBox>
            <VBox minWidth="350">
                <HBox spacing="4"
                      fx:id="clock_horizon">
                    <padding>
                        <Insets top="8" right="8" bottom="8" left="8"/>
                    </padding>
                    <Label text="Clock: "
                           styleClass="clockHorizonSeparator"/>
                    <Label fx:id="clock_time"/>
                    <Label text="/"
                           styleClass="clockHorizonSeparator"/>
                    <Label fx:id="clock_total"/>
                    <Label text="-"
                           styleClass="clockHorizonSeparator"/>
                    <Label fx:id="clock_status"/>
                </HBox>
                <Separator/>
                <ScrollPane VBox.vgrow="ALWAYS"
                            fitToWidth="true"
                            hbarPolicy="NEVER"
                            styleClass="right-column"
                            fx:id="tasks_column"
                            pannable="true">
                    <VBox spacing="8"
                          fx:id="tasks">
                        <padding>
                            <Insets top="8" right="8" bottom="8" left="8"/>
                        </padding>
                    </VBox>
                </ScrollPane>
            </VBox>
        </SplitPane>
    </VBox>
</StackPane>