master
王宇洋 3 years ago
parent 32f87ce7e0
commit 745e07c286

@ -0,0 +1,10 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<Languages>
<language minSize="105" name="Java" />
</Languages>
</inspection_tool>
</profile>
</component>

@ -0,0 +1,5 @@
hahaha
================
This File is 1.a
================

@ -0,0 +1,5 @@
2222222222222222
================
This File is 2.a
================

@ -0,0 +1,5 @@
hahaha
================
This File is 1.a
================

@ -0,0 +1,5 @@
0000000000000000
================
This File is 0.a
================

@ -0,0 +1,5 @@
2222222222222222
================
This File is 2.a
================

@ -1,4 +1,4 @@
3333333333333333
1111111111111111
================
This File is 1.b
================

Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 KiB

@ -16,8 +16,6 @@ import java.security.NoSuchAlgorithmException;
* @Description:
**/
public class Util {
public static final int RMI_PORT = 1099;
public static String getIP() {
try {
InetAddress ip4 = Inet4Address.getLocalHost();

@ -13,6 +13,7 @@ import com.echo.p2p_project.server.interfaces.HelloRegistryFacade;
import com.echo.p2p_project.server.interfaces.SyncingRegistry;
import com.echo.p2p_project.u_model.Peer;
import com.echo.p2p_project.u_model.Resource;
import com.sun.javafx.collections.ObservableMapWrapper;
import java.io.File;
import java.io.FileNotFoundException;
@ -32,9 +33,10 @@ import java.util.*;
* @Description:
**/
public class ClientMain {
private static final String MainServerIP = "127.0.0.1";
public static String MainServerIP = "127.0.0.1";
public static int RMI_PORT = 1099;
public static Peer peer;
public static HashMap<UUID, Resource> DHRT = new LinkedHashMap();
public static ObservableMapWrapper<UUID, Resource> DHRT = new ObservableMapWrapper<>(new LinkedHashMap<>());
public static Integer retry_times = 0;
private static String name = "Peer";
private static String IP = Util.getIP();
@ -102,7 +104,7 @@ public class ClientMain {
}
}
private static void download(String file_name_to_download) {
public static void download(String file_name_to_download) {
HashMap resources = look_up_file(file_name_to_download);
download(resources);
download_retry_count = 0;
@ -131,7 +133,7 @@ public class ClientMain {
Boolean file_status = false;
hasStarted = false;
try {
registry = LocateRegistry.getRegistry(MainServerIP, Util.RMI_PORT);
registry = LocateRegistry.getRegistry(MainServerIP, RMI_PORT);
center_status = lookup_registry() && register_peer() ? true : false;
} catch (RemoteException e) {
// e.printStackTrace();
@ -207,10 +209,8 @@ public class ClientMain {
}
private static Boolean reg_file(String name) {
public static Boolean reg_file(String name) {
File file = new File("res/" + name);
String hash = Util.createSha1(file);
System.out.println(hash);
if (!file.exists()) {
System.out.println("File not exists !");
System.out.println("This File is not exist in your file system !");
@ -219,6 +219,8 @@ public class ClientMain {
System.out.println("File ok.");
System.out.println("File length: " + file.length());
}
String hash = Util.createSha1(file);
System.out.println(hash);
try {
Resource resource = constructRegistry.ConstructResource(peer.getGUID(), name, hash);
ClientMain.DHRT.put(resource.getGUID(), resource);
@ -255,7 +257,8 @@ public class ClientMain {
@Override
public void run() {
try {
DHRT = syncingRegistry.syncUHRT();
HashMap hashMap = syncingRegistry.syncUHRT();
DHRT.putAll(hashMap);
System.out.println(Thread.currentThread() + "sync UHRT Finished.");
} catch (RemoteException e) {
e.printStackTrace();
@ -269,7 +272,8 @@ public class ClientMain {
else
return result;
try {
DHRT = syncingRegistry.syncUHRT();
HashMap hashMap = syncingRegistry.syncUHRT();
DHRT.putAll(hashMap);
System.out.println("DHRT Sync Finished !");
} catch (RemoteException e) {
e.printStackTrace();
@ -286,7 +290,7 @@ public class ClientMain {
return result;
}
private static void download(HashMap<UUID, Resource> resources) {
public static void download(HashMap<UUID, Resource> resources) {
if (resources.size() <= 0) {
System.out.println("Resource can not be download !");
return;
@ -364,8 +368,19 @@ public class ClientMain {
P2P_download(p, resource);
}
}
public static void sync_DHRT(){
HashMap hashMap = null;
try {
System.out.println("Start syncUHRT");
hashMap = syncingRegistry.syncUHRT();
DHRT.putAll(hashMap);
} catch (RemoteException e) {
e.printStackTrace();
}
System.out.println("END syncUHRT");
}
private static void P2P_download(Peer p, Resource resource) {
public static void P2P_download(Peer p, Resource resource) {
Integer port = p.getP2P_port();
String IP = p.getIP();
Registry p2pRegistry = null;
@ -376,11 +391,15 @@ public class ClientMain {
P2P_FileRegistry p2PFileRegistry = (P2P_FileRegistry) p2pRegistry.lookup("p2PFileRegistry");
System.out.println("Connected.");
System.out.println("Downloading FROM: " + p.getGUID());
file = p2PFileRegistry.download(resource.getGUID());
byte[] file_byte = p2PFileRegistry.download(resource.getGUID());
System.out.println("File byte[] length: " + file_byte.length);
file = FileUtil.writeBytes(file_byte, new File("res/" + resource.getName()));
} catch (RemoteException e) {
System.out.println("RemoteException");
try {
DHRT = syncingRegistry.syncUHRT();
HashMap hashMap = syncingRegistry.syncUHRT();
DHRT.putAll(hashMap);
download(resource.getName(), download_retry_count);
return;
} catch (RemoteException ex) {

@ -1,5 +1,31 @@
package com.echo.p2p_project.client.gui;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.watch.WatchMonitor;
import cn.hutool.core.io.watch.Watcher;
import cn.hutool.core.lang.Console;
import com.echo.p2p_project.client.ClientMain;
import com.echo.p2p_project.u_model.Peer;
import com.echo.p2p_project.u_model.Resource;
import com.sun.javafx.collections.ObservableListWrapper;
import javafx.application.Platform;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ObservableValue;
import javafx.collections.MapChangeListener;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.control.*;
import javafx.util.Callback;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.WatchEvent;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.UUID;
/**
* @Author: WangYuyang
* @Date: 2021/10/23-17:11
@ -8,4 +34,215 @@ package com.echo.p2p_project.client.gui;
* @Description:
**/
public class ClientIndexController {
public TextField server_ip;
public TextField server_port;
public Button connect_button;
public ChoiceBox download_datalist;
public Button download_button;
public ChoiceBox reg_datalist;
public Button reg_button;
public TableView<Resource> DHRT_Table;
public TextArea log_field;
public TableColumn<Resource, String> DHRT_GUID;
public TableColumn<Resource, String> DHRT_NAME;
public TableColumn<Resource, String> DHRT_HASH;
public Button sync_button;
public void initialize() {
ObservableList<String> local_file_list = new ObservableListWrapper<>(Collections.synchronizedList(new ArrayList<>()));
ObservableList<Resource> remote_file_list = new ObservableListWrapper<>(Collections.synchronizedList(new ArrayList<>()));
ClientMain.DHRT.addListener(new MapChangeListener<UUID, Resource>() {
@Override
public void onChanged(Change<? extends UUID, ? extends Resource> change) {
log_field.appendText(change.toString());
ObservableList<Resource> resources = new ObservableListWrapper<Resource>(new ArrayList<>(ClientMain.DHRT.values()));
DHRT_Table.setItems(resources);
Platform.runLater(new Runnable() {
@Override
public void run() {
synchronized (remote_file_list) {
if (change.wasAdded()) {
remote_file_list.add(change.getValueAdded());
}
if (change.wasRemoved()) {
remote_file_list.remove(change.getValueRemoved());
}
}
if(remote_file_list.size() >= 1){
download_datalist.setValue(remote_file_list.get(0));
}
}
});
}
});
download_datalist.setItems(remote_file_list);
File[] files = FileUtil.ls(System.getProperty("user.dir") + "/res/");
local_file_list.clear();
for (File f : files) {
local_file_list.add(f.getName());
}
//这里只监听文件或目录的修改事件
// 修改res-> 0.a
// 修改res-> 0.a
// 修改res-> 0.a
// 创建res-> 123 copy.db
// 创建res-> ddd.db
// 删除res-> 123 copy.db
// 删除res-> ddd.db
// 修改res-> .DS_Store
WatchMonitor watchMonitor = WatchMonitor.create(System.getProperty("user.dir") + "/res/", WatchMonitor.EVENTS_ALL);
watchMonitor.setWatcher(new Watcher() {
@Override
public void onCreate(WatchEvent<?> event, Path currentPath) {
Object obj = event.context();
Console.log("Create{}-> {}", currentPath, obj);
File[] files = FileUtil.ls(System.getProperty("user.dir") + "/res/");
Platform.runLater(new Runnable() {
@Override
public void run() {
local_file_list.clear();
for (File f : files) {
local_file_list.add(f.getName());
}
}
});
}
@Override
public void onModify(WatchEvent<?> event, Path currentPath) {
Object obj = event.context();
Console.log("Modify{}-> {}", currentPath, obj);
File[] files = FileUtil.ls(System.getProperty("user.dir") + "/res/");
Platform.runLater(new Runnable() {
@Override
public void run() {
local_file_list.clear();
for (File f : files) {
local_file_list.add(f.getName());
}
}
});
}
@Override
public void onDelete(WatchEvent<?> event, Path currentPath) {
Object obj = event.context();
Console.log("Delete{}-> {}", currentPath, obj);
File[] files = FileUtil.ls(System.getProperty("user.dir") + "/res/");
Platform.runLater(new Runnable() {
@Override
public void run() {
local_file_list.clear();
for (File f : files) {
local_file_list.add(f.getName());
}
}
});
}
@Override
public void onOverflow(WatchEvent<?> event, Path currentPath) {
Object obj = event.context();
Console.log("Overflow{}-> {}", currentPath, obj);
}
});
//启动监听
watchMonitor.start();
reg_datalist.setItems(local_file_list);
if (local_file_list.size() >= 1)
reg_datalist.setValue(local_file_list.get(0));
connect_button.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
ClientMain.MainServerIP = server_ip.getText();
ClientMain.RMI_PORT = Integer.valueOf(server_port.getText()).intValue();
new Thread(new Runnable() {
@Override
public void run() {
ClientMain.recover();
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
ClientMain.sync_DHRT();
}
}).start();
download_button.setDisable(false);
reg_button.setDisable(false);
sync_button.setDisable(false);
}
});
DHRT_GUID.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Resource, String>, ObservableValue<String>>() {
@Override
public ObservableValue<String> call(TableColumn.CellDataFeatures<Resource, String> param) {
return new SimpleStringProperty(param.getValue().getGUID().toString());
}
});
DHRT_NAME.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Resource, String>, ObservableValue<String>>() {
@Override
public ObservableValue<String> call(TableColumn.CellDataFeatures<Resource, String> param) {
return new SimpleStringProperty(param.getValue().getName().toString());
}
});
DHRT_HASH.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Resource, String>, ObservableValue<String>>() {
@Override
public ObservableValue<String> call(TableColumn.CellDataFeatures<Resource, String> param) {
return new SimpleStringProperty(param.getValue().getHash().toString());
}
});
sync_button.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
ClientMain.sync_DHRT();
}
});
reg_button.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
String filename = String.valueOf(reg_datalist.getValue());
ClientMain.reg_file(filename);
}
});
download_button.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
Resource r = (Resource) download_datalist.getValue();
if (r != null) {
System.out.println(r);
ArrayList<Peer> processed_peers = new ArrayList<>();
for (Peer p : r.possessedBy.values()) {
processed_peers.add(p);
}
processed_peers.sort(new Comparator<Peer>() {
@Override
public int compare(Peer o1, Peer o2) {
return o1.getRoutingMetric() - o2.getRoutingMetric();
}
});
for (Peer p : processed_peers) {
System.out.println(p.getGUID().toString() + " <> " + p.getRoutingMetric());
}
ClientMain.P2P_download(processed_peers.get(0), r);
Dialog dialog = new Dialog();
dialog.show();
}
}
});
}
}

@ -22,7 +22,7 @@ public class ClientIndexView extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(ResourceUtil.getResource("gui/client_index.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 320, 240);
Scene scene = new Scene(fxmlLoader.load());
stage.setTitle("Client!");
stage.setScene(scene);
stage.show();

@ -1,23 +0,0 @@
package com.echo.p2p_project.client.gui;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
public class HelloApplication extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("hello-view.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 320, 240);
stage.setTitle("Hello!");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}

@ -1,14 +0,0 @@
package com.echo.p2p_project.client.gui;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
public class HelloController {
@FXML
private Label welcomeText;
@FXML
protected void onHelloButtonClick() {
welcomeText.setText("Welcome to JavaFX Application!");
}
}

@ -13,5 +13,5 @@ import java.util.UUID;
* @Description:
**/
public interface P2P_FileRegistry extends Remote {
File download(UUID resID) throws RemoteException;
byte[] download(UUID resID) throws RemoteException;
}

@ -1,5 +1,6 @@
package com.echo.p2p_project.client.model;
import cn.hutool.core.io.FileUtil;
import com.echo.p2p_project.client.ClientMain;
import com.echo.p2p_project.client.interfaces.P2P_FileRegistry;
import com.echo.p2p_project.u_model.Resource;
@ -34,17 +35,20 @@ public class P2PFileImpl extends UnicastRemoteObject implements P2P_FileRegistry
@Override
public File download(UUID resID) throws RemoteException{
public byte[] download(UUID resID) throws RemoteException{
System.out.println("Income connection.");
Resource resource = ClientMain.DHRT.get(resID);
if(resource == null){
System.out.println("Resource Not in local DHRT.");
return null;
}
File file = new File("res/" + resource.getName());
byte[] file_byte = FileUtil.readBytes(file);
System.out.println("File byte[] length: " + file_byte.length);
if (file==null) {
System.out.println("Resource Not in File System.");
return null;
}
return file;
return file_byte;
}
}

@ -25,6 +25,7 @@ import java.util.*;
* @Description:
**/
public class ServerMain{
public static final int RMI_PORT = 1099;
public static ObservableMapWrapper<UUID, Peer> UHPT = new ObservableMapWrapper<>(new LinkedHashMap<>());
public static ObservableMapWrapper<UUID, Resource> UHRT = new ObservableMapWrapper<>(new LinkedHashMap<>());
private static Registry registry;
@ -64,7 +65,7 @@ public class ServerMain{
public static void init() {
try {
// Start Registry, Port: 1099
registry = LocateRegistry.createRegistry(Util.RMI_PORT);
registry = LocateRegistry.createRegistry(RMI_PORT);
reg_services();

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="com.echo.p2p_project.client.gui.ClientIndexController"
prefHeight="400.0" prefWidth="600.0">
</AnchorPane>

@ -1,18 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.*?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.echo.p2p_project.client.gui.ClientIndexController">
<children>
<VBox prefHeight="451.0" prefWidth="679.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<HBox alignment="CENTER">
<children>
<Button mnemonicParsing="false" text="Button" />
<VBox alignment="TOP_CENTER">
<children>
<HBox alignment="CENTER">
<children>
<Label text="Server IP ">
<padding>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</padding>
</Label>
<TextField fx:id="server_ip" maxWidth="-Infinity" minHeight="-Infinity" prefHeight="30.0" promptText="127.0.0.1" text="127.0.0.1">
<HBox.margin>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</HBox.margin>
</TextField>
</children>
<VBox.margin>
<Insets />
</VBox.margin>
</HBox>
<HBox alignment="CENTER">
<children>
<Label text="Server Port">
<padding>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</padding>
</Label>
<TextField fx:id="server_port" maxHeight="-Infinity" minHeight="-Infinity" prefHeight="30.0" promptText="1099" text="1099">
<HBox.margin>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</HBox.margin>
</TextField>
</children>
</HBox>
<Button fx:id="connect_button" mnemonicParsing="false" text="Connect">
<padding>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
</padding>
<VBox.margin>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
</VBox.margin>
</Button>
<VBox alignment="CENTER">
<children>
<HBox alignment="CENTER_LEFT">
<children>
<Label text="Download">
<padding>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</padding>
</Label>
<ChoiceBox fx:id="download_datalist" prefWidth="150.0" />
<Button fx:id="download_button" disable="true" mnemonicParsing="false" text="Download">
<HBox.margin>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</HBox.margin>
</Button>
</children>
<padding>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
</padding>
</HBox>
</children>
<VBox.margin>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</VBox.margin>
</VBox>
<VBox alignment="TOP_CENTER">
<children>
<HBox alignment="CENTER_LEFT">
<children>
<Label text="Upload ">
<padding>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</padding>
</Label>
<ChoiceBox fx:id="reg_datalist" prefWidth="150.0" />
<Button fx:id="reg_button" disable="true" mnemonicParsing="false" text="Register Resource">
<HBox.margin>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</HBox.margin>
</Button>
</children>
<padding>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
</padding>
</HBox>
</children>
<VBox.margin>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</VBox.margin>
</VBox>
<Button fx:id="sync_button" disable="true" mnemonicParsing="false" text="SYNC DHRT" textFill="#ff4700" />
</children>
</VBox>
<VBox alignment="TOP_CENTER">
<children>
<Label text="DHRT" />
<TableView fx:id="DHRT_Table" prefHeight="200.0">
<columns>
<TableColumn fx:id="DHRT_GUID" prefWidth="75.0" text="GUID" />
<TableColumn fx:id="DHRT_NAME" prefWidth="75.0" text="NAME" />
<TableColumn fx:id="DHRT_HASH" prefWidth="75.0" text="HASH" />
</columns>
</TableView>
<VBox alignment="CENTER">
<children>
<Label text="Log">
<padding>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
</padding>
</Label>
<TextArea fx:id="log_field" prefHeight="200.0" wrapText="true">
<VBox.margin>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</VBox.margin>
</TextArea>
</children>
</VBox>
</children>
</VBox>
</children>
</VBox>
<padding>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</padding>
</HBox>
</children>
</AnchorPane>

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="com.echo.p2p_project.client.gui.ClientIndexController"
prefHeight="400.0" prefWidth="600.0">
</AnchorPane>

@ -1,18 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.*?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.echo.p2p_project.client.gui.ClientIndexController">
<children>
<VBox prefHeight="451.0" prefWidth="679.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<HBox alignment="CENTER">
<children>
<Button mnemonicParsing="false" text="Button" />
<VBox alignment="TOP_CENTER">
<children>
<HBox alignment="CENTER">
<children>
<Label text="Server IP ">
<padding>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</padding>
</Label>
<TextField fx:id="server_ip" maxWidth="-Infinity" minHeight="-Infinity" prefHeight="30.0" promptText="127.0.0.1" text="127.0.0.1">
<HBox.margin>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</HBox.margin>
</TextField>
</children>
<VBox.margin>
<Insets />
</VBox.margin>
</HBox>
<HBox alignment="CENTER">
<children>
<Label text="Server Port">
<padding>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</padding>
</Label>
<TextField fx:id="server_port" maxHeight="-Infinity" minHeight="-Infinity" prefHeight="30.0" promptText="1099" text="1099">
<HBox.margin>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</HBox.margin>
</TextField>
</children>
</HBox>
<Button fx:id="connect_button" mnemonicParsing="false" text="Connect">
<padding>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
</padding>
<VBox.margin>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
</VBox.margin>
</Button>
<VBox alignment="CENTER">
<children>
<HBox alignment="CENTER_LEFT">
<children>
<Label text="Download">
<padding>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</padding>
</Label>
<ChoiceBox fx:id="download_datalist" prefWidth="150.0" />
<Button fx:id="download_button" disable="true" mnemonicParsing="false" text="Download">
<HBox.margin>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</HBox.margin>
</Button>
</children>
<padding>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
</padding>
</HBox>
</children>
<VBox.margin>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</VBox.margin>
</VBox>
<VBox alignment="TOP_CENTER">
<children>
<HBox alignment="CENTER_LEFT">
<children>
<Label text="Upload ">
<padding>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</padding>
</Label>
<ChoiceBox fx:id="reg_datalist" prefWidth="150.0" />
<Button fx:id="reg_button" disable="true" mnemonicParsing="false" text="Register Resource">
<HBox.margin>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</HBox.margin>
</Button>
</children>
<padding>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
</padding>
</HBox>
</children>
<VBox.margin>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</VBox.margin>
</VBox>
<Button fx:id="sync_button" disable="true" mnemonicParsing="false" text="SYNC DHRT" textFill="#ff4700" />
</children>
</VBox>
<VBox alignment="TOP_CENTER">
<children>
<Label text="DHRT" />
<TableView fx:id="DHRT_Table" prefHeight="200.0">
<columns>
<TableColumn fx:id="DHRT_GUID" prefWidth="75.0" text="GUID" />
<TableColumn fx:id="DHRT_NAME" prefWidth="75.0" text="NAME" />
<TableColumn fx:id="DHRT_HASH" prefWidth="75.0" text="HASH" />
</columns>
</TableView>
<VBox alignment="CENTER">
<children>
<Label text="Log">
<padding>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
</padding>
</Label>
<TextArea fx:id="log_field" prefHeight="200.0" wrapText="true">
<VBox.margin>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</VBox.margin>
</TextArea>
</children>
</VBox>
</children>
</VBox>
</children>
</VBox>
<padding>
<Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
</padding>
</HBox>
</children>
</AnchorPane>

Loading…
Cancel
Save