-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathServerListScreen.fxml
80 lines (73 loc) · 3 KB
/
ServerListScreen.fxml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?xml version="1.0" encoding="UTF-8"?>
<!-- Importing necessary JavaFX components -->
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.RowConstraints?>
<!-- Importing TableView and TableColumn components for displaying device information -->
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.cell.PropertyValueFactory?>
<!-- The root GridPane element for the server list screen UI -->
<GridPane xmlns="http://javafx.com/javafx/null" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ServerListScreenController">
<!-- Define column constraints -->
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS" />
</columnConstraints>
<!-- Define row constraints -->
<rowConstraints>
<RowConstraints percentHeight="10" />
<RowConstraints percentHeight="80" />
<RowConstraints percentHeight="10" />
</rowConstraints>
<children>
<!-- Label to display "Found Devices" -->
<Label text="Found Devices :">
<GridPane.margin>
<Insets left="20.0" />
</GridPane.margin>
</Label>
<!-- TableView to display list of devices -->
<TableView fx:id="serverTable" GridPane.rowIndex="1">
<GridPane.margin>
<Insets left="20.0" right="20.0" />
</GridPane.margin>
<columns>
<!-- TableColumn for device name -->
<TableColumn text="Name">
<cellValueFactory>
<PropertyValueFactory property="deviceName" />
</cellValueFactory>
</TableColumn>
<!-- TableColumn for device address -->
<TableColumn text="Address">
<cellValueFactory>
<PropertyValueFactory property="deviceAddress" />
</cellValueFactory>
</TableColumn>
</columns>
</TableView>
<!-- HBox for buttons at the bottom of the screen -->
<HBox alignment="CENTER_RIGHT" cache="true" GridPane.rowIndex="2">
<opaqueInsets>
<Insets />
</opaqueInsets>
<GridPane.margin>
<Insets left="20.0" right="20.0" />
</GridPane.margin>
<children>
<!-- Refresh button -->
<Button mnemonicParsing="false" text="Refresh" onAction="#refresh">
<HBox.margin>
<Insets right="10.0" />
</HBox.margin>
</Button>
<!-- Connect button -->
<Button mnemonicParsing="false" text="Connect" defaultButton="true" onAction="#connectToDevice" />
</children>
</HBox>
</children>
</GridPane>