Add Split/Merge functions

master
Dmitry Isaenko 2020-01-19 21:35:44 +03:00
parent ea97bcd2eb
commit 4dc6d0ae0c
5 changed files with 99 additions and 2 deletions

View File

@ -39,6 +39,9 @@ public class NSLMainController implements Initializable {
@FXML
public FrontController FrontTabController; // Accessible from Mediator | todo: incapsulate
@FXML
private SplitMergeController SplitMergeTabController;
private Task<Void> usbNetCommunications;
private Thread workThread;

View File

@ -0,0 +1,18 @@
package nsusbloader.Controllers;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.ToggleGroup;
import java.net.URL;
import java.util.ResourceBundle;
public class SplitMergeController implements Initializable {
@FXML
private ToggleGroup splitMergeTogGrp;
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
splitMergeTogGrp.selectToggle(splitMergeTogGrp.getToggles().get(0));
}
}

View File

@ -12,7 +12,7 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.SVGPath?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onDragDropped="#handleDrop" onDragOver="#handleDragOver" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="nsusbloader.Controllers.NSLMainController">
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onDragDropped="#handleDrop" onDragOver="#handleDragOver" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="nsusbloader.Controllers.NSLMainController">
<children>
<VBox AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
@ -50,6 +50,16 @@
<SVGPath content="M9,22A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4C2,2.89 2.9,2 4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9M10,16V19.08L13.08,16H20V4H4V16H10M17,11H15V9H17V11M13,11H11V9H13V11M9,11H7V9H9V11Z" />
</graphic>
</Tab>
<Tab closable="false">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<fx:include fx:id="SplitMergeTab" source="SplitMergeTab.fxml" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" VBox.vgrow="ALWAYS" />
</AnchorPane>
</content>
<graphic>
<SVGPath content="M 2.4003906 2 C 1.0683906 2 2.9605947e-16 3.1125 0 4.5 L 0 19.5 A 2.4 2.5 0 0 0 2.4003906 22 L 21.599609 22 A 2.4 2.5 0 0 0 24 19.5 L 24 7 C 24 5.6125 22.919609 4.5 21.599609 4.5 L 12 4.5 L 9.5996094 2 L 2.4003906 2 z M 9 5 L 13 8.5 L 9 12 L 9 10 L 6 10 L 6 7 L 9 7 L 9 5 z M 5 9 L 5 11 L 8 11 L 8 14 L 5 14 L 5 16 L 1 12.5 L 5 9 z M 13.193359 10.962891 C 14.113498 10.962891 14.814236 11.348741 15.296875 12.123047 C 15.779514 12.89388 16.021484 13.935113 16.021484 15.244141 C 16.021484 16.556641 15.779514 17.598741 15.296875 18.373047 C 14.814236 19.14388 14.113498 19.529297 13.193359 19.529297 C 12.276693 19.529297 11.575955 19.14388 11.089844 18.373047 C 10.607205 17.598741 10.365234 16.556641 10.365234 15.244141 C 10.365234 13.935113 10.607205 12.89388 11.089844 12.123047 C 11.575955 11.348741 12.276693 10.962891 13.193359 10.962891 z M 19.589844 10.962891 C 20.509983 10.962891 21.21072 11.348741 21.693359 12.123047 C 22.175998 12.89388 22.417969 13.935113 22.417969 15.244141 C 22.417969 16.556641 22.175998 17.598741 21.693359 18.373047 C 21.21072 19.14388 20.509983 19.529297 19.589844 19.529297 C 18.673177 19.529297 17.970486 19.14388 17.484375 18.373047 C 17.001736 17.598741 16.761719 16.556641 16.761719 15.244141 C 16.761719 13.935113 17.001736 12.89388 17.484375 12.123047 C 17.970486 11.348741 18.673177 10.962891 19.589844 10.962891 z M 13.193359 11.769531 C 12.613498 11.769531 12.173177 12.092448 11.871094 12.738281 C 11.56901 13.380642 11.417969 14.195964 11.417969 15.185547 C 11.417969 15.411241 11.423611 15.655599 11.4375 15.916016 C 11.451389 16.176432 11.511068 16.528212 11.615234 16.972656 L 14.412109 12.591797 C 14.235026 12.26888 14.042318 12.052517 13.833984 11.941406 C 13.629123 11.826823 13.415582 11.769531 13.193359 11.769531 z M 19.589844 11.769531 C 19.009983 11.769531 18.567708 12.092448 18.265625 12.738281 C 17.963542 13.380642 17.8125 14.195964 17.8125 15.185547 C 17.8125 15.411241 17.820095 15.655599 17.833984 15.916016 C 17.847873 16.176432 17.907552 16.528212 18.011719 16.972656 L 20.808594 12.591797 C 20.63151 12.26888 20.438802 12.052517 20.230469 11.941406 C 20.025608 11.826823 19.812066 11.769531 19.589844 11.769531 z M 14.761719 13.556641 L 11.984375 17.962891 C 12.133681 18.216363 12.305556 18.406684 12.5 18.535156 C 12.694444 18.660156 12.91276 18.722656 13.152344 18.722656 C 13.812066 18.722656 14.280816 18.355252 14.558594 17.619141 C 14.836372 16.879557 14.974609 16.059462 14.974609 15.160156 C 14.974609 14.604601 14.90408 14.07053 14.761719 13.556641 z M 21.15625 13.556641 L 18.380859 17.962891 C 18.530165 18.216363 18.70204 18.406684 18.896484 18.535156 C 19.090929 18.660156 19.307292 18.722656 19.546875 18.722656 C 20.206597 18.722656 20.675347 18.355252 20.953125 17.619141 C 21.230903 16.879557 21.371094 16.059462 21.371094 15.160156 C 21.371094 14.604601 21.298611 14.07053 21.15625 13.556641 z" />
</graphic>
</Tab>
</tabs>
</TabPane>
<ProgressBar fx:id="progressBar" prefWidth="Infinity" progress="0.0">

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.RadioButton?>
<?import javafx.scene.control.ToggleGroup?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.SVGPath?>
<VBox prefHeight="201.0" prefWidth="200.0" spacing="5.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="nsusbloader.Controllers.SplitMergeController">
<RadioButton contentDisplay="TOP" mnemonicParsing="false" selected="true" text="Split">
<toggleGroup>
<ToggleGroup fx:id="splitMergeTogGrp" />
</toggleGroup>
</RadioButton>
<RadioButton contentDisplay="TOP" mnemonicParsing="false" text="Merge" toggleGroup="$splitMergeTogGrp" />
<HBox>
<children>
<Label text="File: " />
<Label text="?" />
<Button contentDisplay="TOP" mnemonicParsing="false" text="Select file/folder" />
</children>
</HBox>
<HBox>
<children>
<Label text="Save to: " />
<Label text="?" />
<Button contentDisplay="TOP" mnemonicParsing="false" text="Change" />
</children>
</HBox>
<Button contentDisplay="TOP" mnemonicParsing="false" text="Convert">
<graphic>
<SVGPath content="m 10,28 c -1.104569,0 -2,0.895431 -2,2 v 16 c 0,1.1 0.89,2 2,2 h 12 c 1.104569,0 2,-0.895431 2,-2 V 30 c 0,-1.095153 -0.910156,-2 -2,-2 z m 2.099609,1.199219 h 7.800782 c 0.1,0.0021 0.09961,0.0018 0.09961,0.101562 v 0.09961 c -1e-6,0.09583 3.9e-4,0.09753 -0.09961,0.09961 h -7.800782 c -0.1,0.0057 -0.09961,0.004 -0.09961,-0.09961 v -0.09961 c 0,-0.09974 -3.9e-4,-0.103386 0.09961,-0.101562 z M 10,30 h 12 c 0.303385,0 0.5,0.204427 0.5,0.5 v 13 C 22.5,43.789959 22.29836,44 22,44 H 10 C 9.704427,44 9.5,43.803385 9.5,43.5 v -13 C 9.5,30.208333 9.71224,30 10,30 Z m 3,15 h 6 l -3,2 z M -4,34 v -4 l 8,8 -8,8 v -4 h -8 v -8 z m -32.583984,-5.962891 c -1.332,0 -2.400391,1.1125 -2.400391,2.5 v 15 a 2.4,2.5 0 0 0 2.400391,2.5 h 19.199218 a 2.4,2.5 0 0 0 2.400391,-2.5 v -12.5 c 0,-1.3875 -1.080391,-2.5 -2.400391,-2.5 h -9.599609 l -2.40039,-2.5 z M -25.791016,37 c 0.920139,0 1.620877,0.38585 2.103516,1.160156 0.482639,0.770833 0.724609,1.812066 0.724609,3.121094 0,1.3125 -0.24197,2.3546 -0.724609,3.128906 -0.482639,0.770833 -1.183377,1.15625 -2.103516,1.15625 -0.916666,0 -1.617404,-0.385417 -2.103515,-1.15625 -0.482639,-0.774306 -0.72461,-1.816406 -0.72461,-3.128906 0,-1.309028 0.241971,-2.350261 0.72461,-3.121094 C -27.40842,37.38585 -26.707682,37 -25.791016,37 Z m 6.396485,0 c 0.920139,0 1.620876,0.38585 2.103515,1.160156 0.482639,0.770833 0.72461,1.812066 0.72461,3.121094 0,1.3125 -0.241971,2.3546 -0.72461,3.128906 -0.482639,0.770833 -1.183376,1.15625 -2.103515,1.15625 -0.916667,0 -1.619358,-0.385417 -2.105469,-1.15625 -0.482639,-0.774306 -0.722656,-1.816406 -0.722656,-3.128906 0,-1.309028 0.240017,-2.350261 0.722656,-3.121094 C -21.013889,37.38585 -20.311198,37 -19.394531,37 Z m -10.02539,0.52539 h 0.01953 l -0.01953,0.01758 z m 3.628905,0.28125 c -0.579861,0 -1.020182,0.322917 -1.322265,0.96875 -0.302084,0.642361 -0.453125,1.457683 -0.453125,2.447266 0,0.225694 0.0056,0.470052 0.01953,0.730469 0.01389,0.260416 0.07357,0.612196 0.177734,1.05664 l 2.796875,-4.380859 c -0.177083,-0.322917 -0.369791,-0.53928 -0.578125,-0.650391 -0.204861,-0.114583 -0.418402,-0.171875 -0.640624,-0.171875 z m 6.396485,0 c -0.579861,0 -1.022136,0.322917 -1.324219,0.96875 -0.302083,0.642361 -0.453125,1.457683 -0.453125,2.447266 0,0.225694 0.0076,0.470052 0.02148,0.730469 0.01389,0.260416 0.07357,0.612196 0.177735,1.05664 l 2.796875,-4.380859 c -0.17708,-0.322917 -0.369788,-0.53928 -0.578121,-0.650391 -0.204861,-0.114583 -0.418403,-0.171875 -0.640625,-0.171875 z M -24.222656,39.59375 -27,44 c 0.149306,0.253472 0.321181,0.443793 0.515625,0.572265 0.194444,0.125 0.41276,0.1875 0.652344,0.1875 0.659722,0 1.128472,-0.367404 1.40625,-1.103515 0.277778,-0.739584 0.416015,-1.559679 0.416015,-2.458985 0,-0.555555 -0.07053,-1.089626 -0.21289,-1.603515 z m 6.394531,0 L -20.603516,44 c 0.149306,0.253472 0.321181,0.443793 0.515625,0.572265 0.194445,0.125 0.410808,0.1875 0.650391,0.1875 0.659722,0 1.128472,-0.367404 1.40625,-1.103515 0.277778,-0.739584 0.417969,-1.559679 0.417969,-2.458985 0,-0.555555 -0.07248,-1.089626 -0.214844,-1.603515 z" fill="#71e016" />
</graphic></Button>
<SVGPath content="M -37 2 C -38.104569 2 -39 2.895431 -39 4 L -39 20 C -39 21.1 -38.11 22 -37 22 L -25 22 C -23.895431 22 -23 21.104569 -23 20 L -23 4 C -23 2.904847 -23.910156 2 -25 2 L -37 2 z M 2.4003906 2 C 1.0683906 2 8.8817842e-16 3.1125 0 4.5 L 0 19.5 A 2.4 2.5 0 0 0 2.4003906 22 L 21.599609 22 A 2.4 2.5 0 0 0 24 19.5 L 24 7 C 24 5.6125 22.919609 4.5 21.599609 4.5 L 12 4.5 L 9.5996094 2 L 2.4003906 2 z M -34.900391 3.1992188 L -27.099609 3.1992188 C -26.999609 3.2013187 -27 3.2010193 -27 3.3007812 L -27 3.4003906 C -27.000001 3.4962206 -26.999609 3.49792 -27.099609 3.5 L -34.900391 3.5 C -35.000391 3.5057 -35 3.5040006 -35 3.4003906 L -35 3.3007812 C -35 3.2010412 -35.000391 3.1973948 -34.900391 3.1992188 z M -11 3.75 L -11 7.75 L -19 7.75 L -19 15.75 L -11 15.75 L -11 19.75 L -3 11.75 L -11 3.75 z M -37 4 L -25 4 C -24.696615 4 -24.5 4.204427 -24.5 4.5 L -24.5 17.5 C -24.5 17.789959 -24.70164 18 -25 18 L -37 18 C -37.295573 18 -37.5 17.803385 -37.5 17.5 L -37.5 4.5 C -37.5 4.208333 -37.28776 4 -37 4 z M 13.193359 10.962891 C 14.113498 10.962891 14.814236 11.348741 15.296875 12.123047 C 15.779514 12.89388 16.021484 13.935113 16.021484 15.244141 C 16.021484 16.556641 15.779514 17.598741 15.296875 18.373047 C 14.814236 19.14388 14.113498 19.529297 13.193359 19.529297 C 12.276693 19.529297 11.575955 19.14388 11.089844 18.373047 C 10.607205 17.598741 10.365234 16.556641 10.365234 15.244141 C 10.365234 13.935113 10.607205 12.89388 11.089844 12.123047 C 11.575955 11.348741 12.276693 10.962891 13.193359 10.962891 z M 19.589844 10.962891 C 20.509983 10.962891 21.21072 11.348741 21.693359 12.123047 C 22.175998 12.89388 22.417969 13.935113 22.417969 15.244141 C 22.417969 16.556641 22.175998 17.598741 21.693359 18.373047 C 21.21072 19.14388 20.509983 19.529297 19.589844 19.529297 C 18.673177 19.529297 17.970486 19.14388 17.484375 18.373047 C 17.001736 17.598741 16.761719 16.556641 16.761719 15.244141 C 16.761719 13.935113 17.001736 12.89388 17.484375 12.123047 C 17.970486 11.348741 18.673177 10.962891 19.589844 10.962891 z M 9.5644531 11.488281 L 9.5839844 11.488281 L 9.5644531 11.505859 L 9.5644531 11.488281 z M 13.193359 11.769531 C 12.613498 11.769531 12.173177 12.092448 11.871094 12.738281 C 11.56901 13.380642 11.417969 14.195964 11.417969 15.185547 C 11.417969 15.411241 11.423611 15.655599 11.4375 15.916016 C 11.451389 16.176432 11.511068 16.528212 11.615234 16.972656 L 14.412109 12.591797 C 14.235026 12.26888 14.042318 12.052517 13.833984 11.941406 C 13.629123 11.826823 13.415582 11.769531 13.193359 11.769531 z M 19.589844 11.769531 C 19.009983 11.769531 18.567708 12.092448 18.265625 12.738281 C 17.963542 13.380642 17.8125 14.195964 17.8125 15.185547 C 17.8125 15.411241 17.820095 15.655599 17.833984 15.916016 C 17.847873 16.176432 17.907552 16.528212 18.011719 16.972656 L 20.808594 12.591797 C 20.63151 12.26888 20.438802 12.052517 20.230469 11.941406 C 20.025608 11.826823 19.812066 11.769531 19.589844 11.769531 z M 14.761719 13.556641 L 11.984375 17.962891 C 12.133681 18.216363 12.305556 18.406684 12.5 18.535156 C 12.694444 18.660156 12.91276 18.722656 13.152344 18.722656 C 13.812066 18.722656 14.280816 18.355252 14.558594 17.619141 C 14.836372 16.879557 14.974609 16.059462 14.974609 15.160156 C 14.974609 14.604601 14.90408 14.07053 14.761719 13.556641 z M 21.15625 13.556641 L 18.380859 17.962891 C 18.530165 18.216363 18.70204 18.406684 18.896484 18.535156 C 19.090929 18.660156 19.307292 18.722656 19.546875 18.722656 C 20.206597 18.722656 20.675347 18.355252 20.953125 17.619141 C 21.230903 16.879557 21.371094 16.059462 21.371094 15.160156 C 21.371094 14.604601 21.298611 14.07053 21.15625 13.556641 z M -34 19 L -28 19 L -31 21 L -34 19 z" />
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</VBox>

View File

@ -307,7 +307,6 @@
-fx-background-radius: 5;
-fx-border-color: #2d2d2d;
-fx-border-radius: 3;
}
.check-box:hover .box {
@ -324,6 +323,32 @@
.check-box:selected .mark, .check-box:selected:hover .mark{
-fx-background-color: #4f4f4f;
}
/*-======================= Radio Button =====================-*/
.radio-button .radio, .radio-button:selected .radio {
-fx-background-color: #4f4f4f;
-fx-background-insets: 0 0 0 0, 0, 1, 1;
-fx-background-radius: 45;
-fx-border-color: transparent;
-fx-border-radius: 45;
}
.radio-button:hover .radio {
-fx-background-color: #4f4f4f;
-fx-background-insets: 0 0 0 0, 0, 1, 1;
-fx-background-radius: 45;
-fx-border-color: #a4ffff;
-fx-border-radius: 45;
}
.radio-button:selected .radio, .radio-button:selected:hover .radio {
-fx-background-color: #71e016;
}
.radio-button:selected .dot, .radio-button:selected:hover .dot{
-fx-background-color: #2d2d2d;
-fx-shape: "M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z";
-fx-scale-x: 1.2;
-fx-scale-y: 1.2;
}
/***********************************************************/
.regionUpload{
-fx-shape: "M 4.0078125,0 C 1.5078125,0 0,1.4882812 0,3.984375 V 15.988281 C 0,18.417969 1.4927148,20 4.0078125,20 H 6.5 V 0 Z M 15,2.9 7,13 h 5 c 0,1.661689 -0.0097,6.246588 -0.0098,7.011719 H 18 V 13 h 5 z M 23.5,0 v 20 c 1.004057,-7.06e-4 1.659943,0 2.492187,0 C 28.414063,20 30,18.496094 30,15.996094 V 3.9765625 C 30,1.5195311 28.508727,0 26.003907,0 Z M 3.1015625,2.9570312 C 4.1485235,2.9562481 4.9977514,3.8046013 4.9980469,4.8515625 4.998831,5.8992865 4.1492865,6.748831 3.1015625,6.7480469 2.0546013,6.7477514 1.2062481,5.8985235 1.2070312,4.8515625 1.2073268,3.8053642 2.0553642,2.9573267 3.1015625,2.9570312 Z M 26.865234,11.148438 c 1.047724,-7.85e-4 1.897269,0.84876 1.896485,1.896484 -2.96e-4,1.046961 -0.849524,1.895314 -1.896485,1.894531 -1.046198,-2.95e-4 -1.894235,-0.848333 -1.894531,-1.894531 -7.83e-4,-1.046961 0.84757,-1.896189 1.894531,-1.896484 z";