mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 07:07:43 +01:00
Remove UI test runner classes and .fxml files
These classes were used during individual screen creation but are now effectively dead test code.
This commit is contained in:
parent
9def11118f
commit
c71d9a0fb8
38 changed files with 0 additions and 4236 deletions
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.account;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class AccountSettingsUITestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(AccountSettingsUITestRunner.class);
|
||||
private Scene scene;
|
||||
private Pane view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 630);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/account/AccountSettingsView.fxml"), false);
|
||||
try {
|
||||
view = loader.load();
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/main/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.account;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class AccountUITestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(AccountUITestRunner.class);
|
||||
private Scene scene;
|
||||
private Node view;
|
||||
private StackPane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 630);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/account/AccountView.fxml"), false);
|
||||
try {
|
||||
view = loader.load();
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/main/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.account;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class RegistrationUITestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(RegistrationUITestRunner.class);
|
||||
private Scene scene;
|
||||
private Node view;
|
||||
private StackPane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 630);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/account/content/RegistrationView.fxml"), false);
|
||||
try {
|
||||
view = loader.load();
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/main/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.account;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class SetupUITestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(SetupUITestRunner.class);
|
||||
private Scene scene;
|
||||
private Pane view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 630);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/account/setup/SetupView.fxml"), false);
|
||||
try {
|
||||
view = loader.load();
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/main/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.account.registration.uimock;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javafx.fxml.Initializable;
|
||||
|
||||
public class FundRegistrationWalletControllerUIMock implements Initializable {
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Lifecycle
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.account.registration.uimock;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class FundRegistrationWalletUIMockRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(FundRegistrationWalletUIMockRunner.class);
|
||||
private Scene scene;
|
||||
private Parent view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 650);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/account/registration/uimock/FundRegistrationWalletViewUIMock.fxml"), false);
|
||||
|
||||
try {
|
||||
view = loader.load();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/test/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,116 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of Bitsquare.
|
||||
~
|
||||
~ Bitsquare is free software: you can redistribute it and/or modify it
|
||||
~ under the terms of the GNU Affero General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or (at
|
||||
~ your option) any later version.
|
||||
~
|
||||
~ Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
~ License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Affero General Public License
|
||||
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<GridPane fx:id="root" hgap="5.0" stylesheets="@../../../../../../../java/io/bitsquare/gui/bitsquare.css"
|
||||
vgap="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
|
||||
AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="io.bitsquare.gui.main.account.registration.uimock.FundRegistrationWalletControllerUIMock">
|
||||
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="26.0"/>
|
||||
</padding>
|
||||
|
||||
<children>
|
||||
|
||||
<Pane id="form-group-background-active" fx:id="payFundsPane" visible="true" GridPane.columnSpan="3"
|
||||
GridPane.rowSpan="4">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/>
|
||||
</GridPane.margin>
|
||||
<children>
|
||||
<Label id="form-group-title-active" fx:id="payFundsTitleLabel" layoutX="8" layoutY="-8"
|
||||
text="Pay in the registration fee">
|
||||
<padding>
|
||||
<Insets left="5" right="7"/>
|
||||
</padding>
|
||||
</Label>
|
||||
</children>
|
||||
</Pane>
|
||||
|
||||
<Label fx:id="totalToPayLabel" text="Registration fee:" visible="true">
|
||||
<GridPane.margin>
|
||||
<Insets top="10.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<TextField fx:id="totalToPayTextField" editable="false" focusTraversable="false" text="0.0002 BTC"
|
||||
visible="true" GridPane.columnIndex="1" GridPane.columnSpan="2">
|
||||
<GridPane.margin>
|
||||
<Insets top="10.0"/>
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
|
||||
<Label fx:id="addressLabel" text="Registration BTC address:" visible="true" GridPane.rowIndex="1"/>
|
||||
<TextField fx:id="addressTextField" editable="false" focusTraversable="false"
|
||||
text="mkpymjfTk7WmG9YC4N9c9h1UzwPvMX3aNG" visible="true" GridPane.columnIndex="1"
|
||||
GridPane.columnSpan="2" GridPane.rowIndex="1"/>
|
||||
|
||||
<Label fx:id="balanceLabel" text="Registration wallet balance:" visible="true" GridPane.rowIndex="2"/>
|
||||
<TextField fx:id="balanceTextField" editable="false" focusTraversable="false" text="0.00 BTC" visible="true"
|
||||
GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
|
||||
<ImageView fx:id="payFundsInfoIcon" GridPane.rowSpan="2" fitHeight="24.0" fitWidth="24.0" pickOnBounds="true"
|
||||
preserveRatio="true"
|
||||
visible="true" GridPane.rowIndex="3" GridPane.valignment="TOP">
|
||||
<image>
|
||||
<Image fx:id="infoIcon" url="@../../../../../../../main/resources/images/info.png"/>
|
||||
</image>
|
||||
<GridPane.margin>
|
||||
<Insets right="2.0" top="4.0"/>
|
||||
</GridPane.margin>
|
||||
</ImageView>
|
||||
|
||||
<Label fx:id="payFundsInfoLabel" prefWidth="740.0"
|
||||
text="You need to pay in a minimal registration fee for storing the bank account data as identification in the Bitcoin block chain. This is needed as security measurement and will not leak and privacy. You need to wait for 1 confirmation before you can start active trading. Open the help menu for more information."
|
||||
visible="true" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="3">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
|
||||
<Button GridPane.columnIndex="1" GridPane.rowIndex="4" defaultButton="true"
|
||||
text="Complete registration" visible="true">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="30" top="20.0"/>
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
|
||||
|
||||
</children>
|
||||
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" minWidth="200"/>
|
||||
<ColumnConstraints hgrow="ALWAYS"/>
|
||||
<ColumnConstraints hgrow="NEVER" prefWidth="25.0"/>
|
||||
</columnConstraints>
|
||||
|
||||
<rowConstraints>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
</rowConstraints>
|
||||
</GridPane>
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.account.registration.uimock;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class RegistrationControllerUIMock implements Initializable {
|
||||
private static final Logger log = LoggerFactory.getLogger(RegistrationControllerUIMock.class);
|
||||
public HBox prefBox;
|
||||
public Pane content;
|
||||
|
||||
|
||||
@Inject
|
||||
private RegistrationControllerUIMock() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
prefBox.setOnMouseClicked(new EventHandler<MouseEvent>() {
|
||||
@Override
|
||||
public void handle(MouseEvent mouseEvent) {
|
||||
content.getChildren().remove(0);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.account.registration.uimock;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class RegistrationUIMockRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(RegistrationUIMockRunner.class);
|
||||
private Scene scene;
|
||||
private Parent view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 660);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/account/registration/uimock/RegistrationViewUIMock.fxml"), false);
|
||||
|
||||
try {
|
||||
view = loader.load();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/test/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,197 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of Bitsquare.
|
||||
~
|
||||
~ Bitsquare is free software: you can redistribute it and/or modify it
|
||||
~ under the terms of the GNU Affero General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or (at
|
||||
~ your option) any later version.
|
||||
~
|
||||
~ Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
~ License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Affero General Public License
|
||||
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<BorderPane fx:id="root" prefHeight="660.0" prefWidth="1000.0" style="-fx-background-color: f4f4f4;"
|
||||
stylesheets="@../../../../../../../../main/java/io/bitsquare/gui/bitsquare.css"
|
||||
xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="io.bitsquare.gui.main.account.registration.uimock.RegistrationControllerUIMock">
|
||||
<left>
|
||||
|
||||
<VBox spacing="5" prefWidth="300.0" BorderPane.alignment="CENTER">
|
||||
<BorderPane.margin>
|
||||
<Insets left="10.0" top="15.0"/>
|
||||
</BorderPane.margin>
|
||||
<children>
|
||||
|
||||
<HBox id="wizard-item-background-completed" spacing="5" prefWidth="200.0">
|
||||
<children>
|
||||
<ImageView fitHeight="20.0" fitWidth="20.0"
|
||||
pickOnBounds="true" preserveRatio="true">
|
||||
<HBox.margin>
|
||||
<Insets left="8.0" top="8.0"/>
|
||||
</HBox.margin>
|
||||
<image>
|
||||
<Image url="@../../../../../../../../main/resources/images/tick.png"/>
|
||||
</image>
|
||||
|
||||
</ImageView>
|
||||
<VBox spacing="1">
|
||||
<HBox.margin>
|
||||
<Insets top="5.0" bottom="8"/>
|
||||
</HBox.margin>
|
||||
<children>
|
||||
|
||||
<Label AnchorPane.topAnchor="0" layoutX="40.0" layoutY="7.0" text="Backup wallet seed"
|
||||
id="wizard-title-completed">
|
||||
</Label>
|
||||
<Label id="wizard-sub-title-completed" layoutX="40.0" layoutY="33.0" maxWidth="250.0"
|
||||
text="Write down the seed word for your wallet."
|
||||
wrapText="true" AnchorPane.bottomAnchor="0"/>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
|
||||
<HBox id="wizard-item-background-completed" spacing="5" prefWidth="200.0">
|
||||
<children>
|
||||
<ImageView fitHeight="20.0" fitWidth="20.0"
|
||||
pickOnBounds="true" preserveRatio="true">
|
||||
<HBox.margin>
|
||||
<Insets left="8.0" top="8.0"/>
|
||||
</HBox.margin>
|
||||
<image>
|
||||
<Image url="@../../../../../../../../main/resources/images/tick.png"/>
|
||||
</image>
|
||||
|
||||
</ImageView>
|
||||
<VBox spacing="1">
|
||||
<HBox.margin>
|
||||
<Insets top="5.0" bottom="8"/>
|
||||
</HBox.margin>
|
||||
<children>
|
||||
|
||||
<Label AnchorPane.topAnchor="0" layoutX="40.0" layoutY="7.0" text="Setup password"
|
||||
id="wizard-title-completed">
|
||||
</Label>
|
||||
<Label id="wizard-sub-title-completed" layoutX="40.0" layoutY="33.0" maxWidth="250.0"
|
||||
text="Protect your wallet with a password."
|
||||
wrapText="true" AnchorPane.bottomAnchor="0"/>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
|
||||
<HBox id="wizard-item-background-completed" spacing="5" prefWidth="200.0">
|
||||
<children>
|
||||
<ImageView fitHeight="20.0" fitWidth="20.0"
|
||||
pickOnBounds="true" preserveRatio="true">
|
||||
<HBox.margin>
|
||||
<Insets left="8.0" top="8.0"/>
|
||||
</HBox.margin>
|
||||
<image>
|
||||
<Image url="@../../../../../../../../main/resources/images/tick.png"/>
|
||||
</image>
|
||||
|
||||
</ImageView>
|
||||
<VBox spacing="1">
|
||||
<HBox.margin>
|
||||
<Insets top="5.0" bottom="8"/>
|
||||
</HBox.margin>
|
||||
<children>
|
||||
|
||||
<Label AnchorPane.topAnchor="0" layoutX="40.0" layoutY="7.0" text="Setup Bank account"
|
||||
id="wizard-title-completed">
|
||||
</Label>
|
||||
<Label id="wizard-sub-title-completed" layoutX="40.0" layoutY="33.0" maxWidth="250.0"
|
||||
text="You need to add the bank account details to your trading account."
|
||||
wrapText="true" AnchorPane.bottomAnchor="0"/>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
|
||||
<HBox fx:id="prefBox" id="wizard-item-background-active" spacing="5" prefWidth="200.0">
|
||||
<children>
|
||||
<ImageView fitHeight="20.0" fitWidth="20.0"
|
||||
pickOnBounds="true" preserveRatio="true">
|
||||
<HBox.margin>
|
||||
<Insets left="8.0" top="8.0"/>
|
||||
</HBox.margin>
|
||||
<image>
|
||||
<Image url="@../../../../../../../../main/resources/images/arrow_blue.png"/>
|
||||
</image>
|
||||
|
||||
</ImageView>
|
||||
<VBox spacing="1">
|
||||
<HBox.margin>
|
||||
<Insets top="5.0" bottom="8"/>
|
||||
</HBox.margin>
|
||||
<children>
|
||||
|
||||
<Label AnchorPane.topAnchor="0" layoutX="40.0" layoutY="7.0"
|
||||
text="Setup your preferences"
|
||||
id="wizard-title-active">
|
||||
</Label>
|
||||
<Label id="wizard-sub-title-active" layoutX="40.0" layoutY="33.0" maxWidth="250.0"
|
||||
text="You need to setup your preferences used for trade restrictions."
|
||||
wrapText="true" AnchorPane.bottomAnchor="0"/>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
|
||||
<HBox id="wizard-item-background-deactivated" spacing="5" prefWidth="200.0">
|
||||
<children>
|
||||
<ImageView fitHeight="20.0" fitWidth="20.0"
|
||||
pickOnBounds="true" preserveRatio="true">
|
||||
<HBox.margin>
|
||||
<Insets left="8.0" top="8.0"/>
|
||||
</HBox.margin>
|
||||
<image>
|
||||
<Image url="@../../../../../../../../main/resources/images/arrow_grey.png"/>
|
||||
</image>
|
||||
|
||||
</ImageView>
|
||||
<VBox spacing="1">
|
||||
<HBox.margin>
|
||||
<Insets top="5.0" bottom="8"/>
|
||||
</HBox.margin>
|
||||
<children>
|
||||
|
||||
<Label AnchorPane.topAnchor="0" layoutX="40.0" layoutY="7.0"
|
||||
text="Register your account"
|
||||
id="wizard-title-deactivated">
|
||||
</Label>
|
||||
<Label id="wizard-sub-title-deactivated" layoutX="40.0" layoutY="33.0" maxWidth="250.0"
|
||||
text="Pay in the registration fee of 0.0002 BTC and store your account in the BTC block chain."
|
||||
wrapText="true" AnchorPane.bottomAnchor="0"/>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
|
||||
</children>
|
||||
</VBox>
|
||||
</left>
|
||||
<center>
|
||||
<Pane fx:id="content">
|
||||
<fx:include source="../../../settings/uimock/SeedWordsViewUIMock.fxml" visible="true" prefWidth="690"/>
|
||||
<fx:include source="../../../settings/uimock/SetPasswordViewUIMock.fxml" visible="false" prefWidth="690"/>
|
||||
<fx:include source="../../../settings/uimock/BankAccountSettingsViewUIMock.fxml" visible="false"
|
||||
prefWidth="690"/>
|
||||
<fx:include source="../../../settings/uimock/RestrictionSettingsViewUIMock.fxml" visible="false"
|
||||
prefWidth="690"/>
|
||||
<fx:include source="FundRegistrationWalletViewUIMock.fxml" visible="false" prefWidth="690"/>
|
||||
</Pane>
|
||||
</center>
|
||||
</BorderPane>
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.portfolio.pending;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class PendingTradesUIRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(PendingTradesUIRunner.class);
|
||||
private Scene scene;
|
||||
private Parent view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 630);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/main/portfolio/pending/PendingTradesView.fxml"), false);
|
||||
|
||||
try {
|
||||
view = loader.load();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/main/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.portfolio.pending.uimock;
|
||||
|
||||
import io.bitsquare.gui.CachedViewCB;
|
||||
import io.bitsquare.gui.components.processbar.ProcessStepBar;
|
||||
import io.bitsquare.gui.components.processbar.ProcessStepItem;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class PendingTradesControllerUIMock extends CachedViewCB {
|
||||
private static final Logger log = LoggerFactory.getLogger(PendingTradesControllerUIMock.class);
|
||||
public ProcessStepBar processBar;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Constructor
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Inject
|
||||
public PendingTradesControllerUIMock() {
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Lifecycle
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
super.initialize(url, rb);
|
||||
|
||||
List<ProcessStepItem> items = new ArrayList<>();
|
||||
items.add(new ProcessStepItem("Deposit TX published"));
|
||||
items.add(new ProcessStepItem("Waiting for other trader"));
|
||||
items.add(new ProcessStepItem("Waiting for payment"));
|
||||
items.add(new ProcessStepItem("Payment received"));
|
||||
processBar.setProcessStepItems(items);
|
||||
// processBar.next();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deactivate() {
|
||||
super.deactivate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
super.activate();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// GUI handlers
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Private methods
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.portfolio.pending.uimock;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class PendingTradesUIMockRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(PendingTradesUIMockRunner.class);
|
||||
private Scene scene;
|
||||
private Parent view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 630);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/main/portfolio/pending/uimock/PendingTradesViewUIMock.fxml"), false);
|
||||
|
||||
try {
|
||||
view = loader.load();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/test/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of Bitsquare.
|
||||
~
|
||||
~ Bitsquare is free software: you can redistribute it and/or modify it
|
||||
~ under the terms of the GNU Affero General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or (at
|
||||
~ your option) any later version.
|
||||
~
|
||||
~ Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
~ License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Affero General Public License
|
||||
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
|
||||
<?import io.bitsquare.gui.components.processbar.ProcessStepBar?>
|
||||
<?import io.bitsquare.gui.components.TitledGroupBg?>
|
||||
<?import io.bitsquare.gui.components.TitledSeparator?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<GridPane fx:id="root" fx:controller="io.bitsquare.gui.main.portfolio.pending.uimock.PendingTradesControllerUIMock"
|
||||
hgap="5.0" vgap="5" stylesheets="@../../../../../../../../../main/java/io/bitsquare/gui/bitsquare.css"
|
||||
xmlns:fx="http://javafx.com/fxml">
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="25.0" top="30.0" right="25"/>
|
||||
</padding>
|
||||
|
||||
<TitledSeparator text="Open trades" GridPane.rowIndex="0" GridPane.columnIndex="0"
|
||||
GridPane.columnSpan="2"/>
|
||||
|
||||
<TableView fx:id="offerBookTable" GridPane.rowIndex="0" GridPane.columnIndex="0" GridPane.columnSpan="2"
|
||||
prefHeight="150">
|
||||
<GridPane.margin>
|
||||
<Insets top="10.0" left="-10" right="-10"/>
|
||||
</GridPane.margin>
|
||||
<columns>
|
||||
<TableColumn text="Amount in BTC (Min.)" fx:id="amountColumn" minWidth="130"/>
|
||||
<TableColumn text="Price" fx:id="priceColumn" minWidth="130"/>
|
||||
<TableColumn text="Amount in EUR (Min.)" fx:id="volumeColumn" minWidth="130"/>
|
||||
<TableColumn text="Country" fx:id="countryColumn" minWidth="60"/>
|
||||
<TableColumn text="Bank transfer type" fx:id="bankAccountTypeColumn" minWidth="130"/>
|
||||
<TableColumn text="" fx:id="directionColumn" minWidth="80" sortable="false"/>
|
||||
|
||||
</columns>
|
||||
</TableView>
|
||||
|
||||
|
||||
<ProcessStepBar fx:id="processBar" GridPane.columnSpan="2" GridPane.rowIndex="1" snapToPixel="true">
|
||||
<GridPane.margin>
|
||||
<Insets top="30.0" bottom="-10" left="-10" right="-10"/>
|
||||
</GridPane.margin>
|
||||
</ProcessStepBar>
|
||||
|
||||
<TitledGroupBg fx:id="priceAmountPane" text="Open trade"
|
||||
GridPane.rowSpan="2" GridPane.columnSpan="2" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets top="40.0" bottom="-10" left="-10" right="-10"/>
|
||||
</GridPane.margin>
|
||||
</TitledGroupBg>
|
||||
|
||||
|
||||
<Label text="Status:" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets top="50.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<TextField disable="true" GridPane.rowIndex="2" GridPane.columnIndex="1" text="Blabal">
|
||||
<GridPane.margin>
|
||||
<Insets top="50.0"/>
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
|
||||
<Label text="Deposit transaction ID:" GridPane.rowIndex="3"/>
|
||||
<TextField disable="true" GridPane.rowIndex="3" GridPane.columnIndex="1" text="324dsfsdffdafsdfasdf324"/>
|
||||
|
||||
<!--
|
||||
<InfoDisplay gridPane="root" rowIndex="3"
|
||||
text="%createOffer.amountPriceBox.info"/>
|
||||
-->
|
||||
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" minWidth="200"/>
|
||||
<ColumnConstraints hgrow="ALWAYS"/>
|
||||
</columnConstraints>
|
||||
|
||||
<rowConstraints>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
</rowConstraints>
|
||||
|
||||
</GridPane>
|
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.settings;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class FiatAccountUITestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(FiatAccountUITestRunner.class);
|
||||
private Scene scene;
|
||||
private Pane view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 630);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/account/content/FiatAccountView.fxml"), false);
|
||||
try {
|
||||
view = loader.load();
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/main/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.settings;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class PasswordUITestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(PasswordUITestRunner.class);
|
||||
private Scene scene;
|
||||
private Pane view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 630);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/account/content/PasswordView.fxml"), false);
|
||||
try {
|
||||
view = loader.load();
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/main/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.settings;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class RegistrationUITestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(RegistrationUITestRunner.class);
|
||||
private Scene scene;
|
||||
private Pane view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 530);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/account/content/RegistrationView.fxml"), false);
|
||||
try {
|
||||
view = loader.load();
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/main/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.settings;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class RestrictionsUITestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(RestrictionsUITestRunner.class);
|
||||
private Scene scene;
|
||||
private Pane view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 530);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/account/content/RestrictionsView.fxml"), false);
|
||||
try {
|
||||
view = loader.load();
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/main/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.settings;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class SeedWordsUITestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(SeedWordsUITestRunner.class);
|
||||
private Scene scene;
|
||||
private Pane view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 630);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/account/content/SeedWordsView.fxml"), false);
|
||||
try {
|
||||
view = loader.load();
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/main/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,128 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.settings.uimock;
|
||||
|
||||
import io.bitsquare.bank.BankAccount;
|
||||
import io.bitsquare.bank.BankAccountType;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.locale.CountryUtil;
|
||||
import io.bitsquare.locale.CurrencyUtil;
|
||||
import io.bitsquare.locale.Region;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.Currency;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.util.StringConverter;
|
||||
|
||||
public class BankAccountSettingsControllerUIMock implements Initializable {
|
||||
|
||||
@FXML private TextField bankAccountTitleTextField, bankAccountHolderNameTextField, bankAccountPrimaryIDTextField,
|
||||
bankAccountSecondaryIDTextField;
|
||||
@FXML private Button saveBankAccountButton, addBankAccountButton;
|
||||
@FXML private ComboBox<Country> bankAccountCountryComboBox;
|
||||
@FXML private ComboBox<Region> bankAccountRegionComboBox;
|
||||
@FXML private ComboBox<BankAccount> bankAccountComboBox;
|
||||
@FXML private ComboBox<BankAccountType> bankAccountTypesComboBox;
|
||||
@FXML private ComboBox<Currency> bankAccountCurrencyComboBox;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Lifecycle
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
initBankAccountComboBox();
|
||||
initBankAccountTypesComboBox();
|
||||
initBankAccountCurrencyComboBox();
|
||||
initBankAccountCountryComboBox();
|
||||
}
|
||||
|
||||
private void initBankAccountComboBox() {
|
||||
bankAccountComboBox.setPromptText("No bank account available");
|
||||
bankAccountComboBox.setDisable(true);
|
||||
}
|
||||
|
||||
private void initBankAccountTypesComboBox() {
|
||||
bankAccountTypesComboBox.setItems(FXCollections.observableArrayList(BankAccountType.getAllBankAccountTypes()));
|
||||
bankAccountTypesComboBox.setConverter(new StringConverter<BankAccountType>() {
|
||||
@Override
|
||||
public String toString(BankAccountType bankAccountTypeInfo) {
|
||||
return BSResources.get(bankAccountTypeInfo.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public BankAccountType fromString(String s) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initBankAccountCurrencyComboBox() {
|
||||
bankAccountCurrencyComboBox.setItems(FXCollections.observableArrayList(CurrencyUtil.getAllCurrencies()));
|
||||
bankAccountCurrencyComboBox.setConverter(new StringConverter<Currency>() {
|
||||
@Override
|
||||
public String toString(Currency currency) {
|
||||
return currency.getCurrencyCode() + " (" + currency.getDisplayName() + ")";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Currency fromString(String s) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initBankAccountCountryComboBox() {
|
||||
bankAccountRegionComboBox.setItems(FXCollections.observableArrayList(CountryUtil.getAllRegions()));
|
||||
bankAccountRegionComboBox.setConverter(new StringConverter<Region>() {
|
||||
@Override
|
||||
public String toString(Region region) {
|
||||
return region.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Region fromString(String s) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
bankAccountCountryComboBox.setConverter(new StringConverter<Country>() {
|
||||
@Override
|
||||
public String toString(Country country) {
|
||||
return country.getName();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Country fromString(String s) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.settings.uimock;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class BankAccountSettingsUIMockRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(BankAccountSettingsUIMockRunner.class);
|
||||
private Scene scene;
|
||||
private Parent view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 1200);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/settings/uimock/BankAccountSettingsViewUIMock.fxml"), false);
|
||||
|
||||
try {
|
||||
view = loader.load();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/test/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,135 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of Bitsquare.
|
||||
~
|
||||
~ Bitsquare is free software: you can redistribute it and/or modify it
|
||||
~ under the terms of the GNU Affero General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or (at
|
||||
~ your option) any later version.
|
||||
~
|
||||
~ Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
~ License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Affero General Public License
|
||||
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<GridPane hgap="5.0" vgap="5.0" fx:id="root"
|
||||
fx:controller="io.bitsquare.gui.main.settings.uimock.BankAccountSettingsControllerUIMock"
|
||||
stylesheets="@../../../../../../../../main/java/io/bitsquare/gui/bitsquare.css"
|
||||
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
|
||||
AnchorPane.topAnchor="0.0"
|
||||
xmlns:fx="http://javafx.com/fxml">
|
||||
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="26.0"/>
|
||||
</padding>
|
||||
|
||||
<children>
|
||||
<Pane id="form-group-background-active" GridPane.columnSpan="2" GridPane.rowSpan="13">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="-10" left="-10" right="-10" top="-10"/>
|
||||
</GridPane.margin>
|
||||
<children>
|
||||
<Label id="form-group-title-active" layoutX="8" layoutY="-8" text="Setup your bank account">
|
||||
<padding>
|
||||
<Insets left="5" right="7"/>
|
||||
</padding>
|
||||
</Label>
|
||||
</children>
|
||||
</Pane>
|
||||
<Label text="Bank account:"/>
|
||||
<ComboBox fx:id="bankAccountComboBox" GridPane.columnIndex="1"/>
|
||||
|
||||
<Label text="Bank account type:" GridPane.rowIndex="1"/>
|
||||
<ComboBox fx:id="bankAccountTypesComboBox" promptText="Select bank account type"
|
||||
GridPane.rowIndex="1" GridPane.columnIndex="1"/>
|
||||
|
||||
<Label text="Bank account title:" GridPane.rowIndex="2"/>
|
||||
<TextField fx:id="bankAccountTitleTextField" GridPane.columnIndex="1" GridPane.rowIndex="2"/>
|
||||
|
||||
<Label text="Bank account holder name:" GridPane.rowIndex="3"/>
|
||||
<TextField fx:id="bankAccountHolderNameTextField" GridPane.columnIndex="1" GridPane.rowIndex="3"/>
|
||||
|
||||
<Label text="Bank account primary ID:" GridPane.rowIndex="4"/>
|
||||
<TextField fx:id="bankAccountPrimaryIDTextField" GridPane.columnIndex="1" GridPane.rowIndex="4"/>
|
||||
|
||||
<Label text="Bank account secondary ID:" GridPane.rowIndex="5"/>
|
||||
<TextField fx:id="bankAccountSecondaryIDTextField" GridPane.columnIndex="1" GridPane.rowIndex="5"/>
|
||||
|
||||
<Label text="Bank account currency:" GridPane.rowIndex="6"/>
|
||||
<ComboBox fx:id="bankAccountCurrencyComboBox" promptText="Select currency" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="6"/>
|
||||
|
||||
<Label text="Country of bank account:" GridPane.rowIndex="7"/>
|
||||
<HBox spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="7">
|
||||
<children>
|
||||
<ComboBox fx:id="bankAccountRegionComboBox" prefWidth="150.0"
|
||||
promptText="Select region"/>
|
||||
<ComboBox fx:id="bankAccountCountryComboBox" visible="false" prefWidth="150.0"
|
||||
promptText="Select country"/>
|
||||
</children>
|
||||
</HBox>
|
||||
|
||||
<Button fx:id="saveBankAccountButton" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="8" defaultButton="true"
|
||||
text="Save bank account"/>
|
||||
|
||||
<Separator orientation="HORIZONTAL" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.rowIndex="9"/>
|
||||
|
||||
<Label text="Manage bank accounts:" GridPane.rowIndex="10"/>
|
||||
<HBox spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="10">
|
||||
<children>
|
||||
<Button fx:id="addBankAccountButton" text="Add new bank account" disable="false"/>
|
||||
<Button text="Remove selected bank account"/>
|
||||
</children>
|
||||
</HBox>
|
||||
|
||||
<Separator orientation="HORIZONTAL" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.rowIndex="11"/>
|
||||
<ImageView GridPane.rowSpan="2" fitHeight="24.0" fitWidth="24.0" pickOnBounds="true" preserveRatio="true"
|
||||
GridPane.rowIndex="12"
|
||||
GridPane.valignment="TOP">
|
||||
<image>
|
||||
<Image fx:id="infoIcon" url="@../../../../../../../main/resources/images/info.png"/>
|
||||
</image>
|
||||
<GridPane.margin>
|
||||
<Insets right="2.0" top="4.0"/>
|
||||
</GridPane.margin>
|
||||
</ImageView>
|
||||
<Label GridPane.columnIndex="1" GridPane.rowIndex="12" prefWidth="700.0"
|
||||
text="You need to setup at least one bank account which you would like to use for trading. You can also use multiple bank accounts with different currencies. If you want to add later a new bank account you need to pay the registration fee again. The bank account data will be saved in the registration process for identification. You can edit this later in the settings. Open the help menu for further information."
|
||||
wrapText="true">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
|
||||
|
||||
</children>
|
||||
|
||||
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="RIGHT" hgrow="ALWAYS" minWidth="180"/>
|
||||
<ColumnConstraints hgrow="SOMETIMES"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
</rowConstraints>
|
||||
</GridPane>
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.settings.uimock;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javafx.fxml.Initializable;
|
||||
|
||||
public class RestrictionSettingsControllerUIMock implements Initializable {
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Lifecycle
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.settings.uimock;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class RestrictionSettingsUIMockRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(RestrictionSettingsUIMockRunner.class);
|
||||
private Scene scene;
|
||||
private Parent view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 1200);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/settings/uimock/RestrictionSettingsViewUIMock.fxml"), false);
|
||||
|
||||
try {
|
||||
view = loader.load();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/test/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,180 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of Bitsquare.
|
||||
~
|
||||
~ Bitsquare is free software: you can redistribute it and/or modify it
|
||||
~ under the terms of the GNU Affero General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or (at
|
||||
~ your option) any later version.
|
||||
~
|
||||
~ Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
~ License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Affero General Public License
|
||||
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<GridPane fx:id="root" hgap="5.0" stylesheets="@../../../../../../../main/java/io/bitsquare/gui/bitsquare.css"
|
||||
vgap="5.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="io.bitsquare.gui.main.settings.uimock.RestrictionSettingsControllerUIMock">
|
||||
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="26.0"/>
|
||||
</padding>
|
||||
|
||||
<children>
|
||||
|
||||
<!--
|
||||
languages
|
||||
-->
|
||||
<Pane id="form-group-background-active" GridPane.columnSpan="2" GridPane.rowSpan="3">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="-10" left="-10" right="-10" top="-10"/>
|
||||
</GridPane.margin>
|
||||
<children>
|
||||
<Label id="form-group-title-active" layoutX="8" layoutY="-8" text="Add languages">
|
||||
<padding>
|
||||
<Insets left="5" right="7"/>
|
||||
</padding>
|
||||
</Label>
|
||||
</children>
|
||||
</Pane>
|
||||
<Label text="Accepted languages:" GridPane.rowIndex="0" GridPane.valignment="TOP"/>
|
||||
<ListView fx:id="languagesListView" prefHeight="70.0" GridPane.columnIndex="1" GridPane.rowIndex="0"/>
|
||||
<ComboBox fx:id="languageComboBox" prefWidth="150.0" promptText="Add language" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10"/>
|
||||
</GridPane.margin>
|
||||
</ComboBox>
|
||||
|
||||
<ImageView GridPane.rowSpan="2" fitHeight="24.0" fitWidth="24.0" pickOnBounds="true" preserveRatio="true"
|
||||
GridPane.rowIndex="2"
|
||||
GridPane.valignment="TOP">
|
||||
<image>
|
||||
<Image fx:id="infoIcon" url="@../../../../../../../main/resources/images/info.png"/>
|
||||
</image>
|
||||
<GridPane.margin>
|
||||
<Insets right="2.0" top="4.0"/>
|
||||
</GridPane.margin>
|
||||
</ImageView>
|
||||
<Label text="Add here all languages you would like to use in case of arbitration .You can edit this later in the settings. Open the help menu for further information."
|
||||
wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
|
||||
<!--
|
||||
countries
|
||||
-->
|
||||
<Pane id="form-group-background-active" GridPane.columnSpan="2" GridPane.rowIndex="4" GridPane.rowSpan="3">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="-10" left="-10" right="-10" top="-10"/>
|
||||
</GridPane.margin>
|
||||
<children>
|
||||
<Label id="form-group-title-active" layoutX="8" layoutY="-8" text="Add countries">
|
||||
<padding>
|
||||
<Insets left="5" right="7"/>
|
||||
</padding>
|
||||
</Label>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets top="50.0"/>
|
||||
</padding>
|
||||
</Pane>
|
||||
<Label text="Accepted countries:" GridPane.rowIndex="4" GridPane.valignment="TOP"/>
|
||||
<ListView fx:id="countriesListView" prefHeight="100.0" GridPane.columnIndex="1" GridPane.rowIndex="4"/>
|
||||
<HBox spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="5">
|
||||
<children>
|
||||
<ComboBox fx:id="regionComboBox" prefWidth="150.0" promptText="Select region"/>
|
||||
<ComboBox fx:id="countryComboBox" prefWidth="150.0" promptText="Add country" visible="false"/>
|
||||
</children>
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10"/>
|
||||
</GridPane.margin>
|
||||
</HBox>
|
||||
<ImageView GridPane.rowSpan="2" fitHeight="24.0" fitWidth="24.0" pickOnBounds="true" preserveRatio="true"
|
||||
GridPane.rowIndex="6"
|
||||
GridPane.valignment="TOP">
|
||||
<image>
|
||||
<fx:reference source="infoIcon"/>
|
||||
</image>
|
||||
<GridPane.margin>
|
||||
<Insets right="2.0" top="4.0"/>
|
||||
</GridPane.margin>
|
||||
</ImageView>
|
||||
<Label text="Add here all bank account countries you are willing to accept in a trade .You can edit this later in the settings. Open the help menu for further information."
|
||||
wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="6">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
|
||||
|
||||
<!--
|
||||
arbitrators
|
||||
-->
|
||||
<Pane id="form-group-background-active" GridPane.columnSpan="2" GridPane.rowIndex="8" GridPane.rowSpan="3">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="-10" left="-10" right="-10" top="-10"/>
|
||||
</GridPane.margin>
|
||||
<children>
|
||||
<Label id="form-group-title-active" layoutX="8" layoutY="-8" text="Add arbitrators">
|
||||
<padding>
|
||||
<Insets left="5" right="7"/>
|
||||
</padding>
|
||||
</Label>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets top="50.0"/>
|
||||
</padding>
|
||||
</Pane>
|
||||
<Label text="Accepted arbitrators:" GridPane.rowIndex="8" GridPane.valignment="TOP"/>
|
||||
<ListView fx:id="arbitratorsListView" prefHeight="100.0" GridPane.columnIndex="1" GridPane.rowIndex="8"/>
|
||||
<Button text="Add arbitrator" GridPane.columnIndex="1" GridPane.rowIndex="9"/>
|
||||
<ImageView GridPane.rowSpan="2" fitHeight="24.0" fitWidth="24.0" pickOnBounds="true" preserveRatio="true"
|
||||
GridPane.rowIndex="10"
|
||||
GridPane.valignment="TOP">
|
||||
<image>
|
||||
<fx:reference source="infoIcon"/>
|
||||
</image>
|
||||
<GridPane.margin>
|
||||
<Insets right="2.0" top="4.0"/>
|
||||
</GridPane.margin>
|
||||
</ImageView>
|
||||
<Label text="Select your arbitrators. You need to choose at least 3 arbitrators. The more you choose the more trading possibilities you gain .You can edit this later in the settings. Open the help menu for further information."
|
||||
wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="10">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
|
||||
</children>
|
||||
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="RIGHT" hgrow="ALWAYS" minWidth="150"/>
|
||||
<ColumnConstraints hgrow="SOMETIMES"/>
|
||||
</columnConstraints>
|
||||
|
||||
<rowConstraints>
|
||||
<RowConstraints vgrow="SOMETIMES"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="SOMETIMES"/>
|
||||
<RowConstraints minHeight="30.0" vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="SOMETIMES"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="SOMETIMES"/>
|
||||
<RowConstraints minHeight="30.0" vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="SOMETIMES"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="SOMETIMES"/>
|
||||
</rowConstraints>
|
||||
</GridPane>
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.settings.uimock;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javafx.fxml.Initializable;
|
||||
|
||||
public class SeedWordsControllerUIMock implements Initializable {
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Lifecycle
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.settings.uimock;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class SeedWordsUIMockRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(SeedWordsUIMockRunner.class);
|
||||
private Scene scene;
|
||||
private Parent view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 1200);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/settings/uimock/SeedWordsViewUIMock.fxml"), false);
|
||||
|
||||
try {
|
||||
view = loader.load();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/test/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,105 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of Bitsquare.
|
||||
~
|
||||
~ Bitsquare is free software: you can redistribute it and/or modify it
|
||||
~ under the terms of the GNU Affero General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or (at
|
||||
~ your option) any later version.
|
||||
~
|
||||
~ Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
~ License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Affero General Public License
|
||||
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.scene.text.*?>
|
||||
<GridPane fx:id="root" hgap="5.0" prefHeight="630.0" prefWidth="1000.0"
|
||||
stylesheets="@../../../../../../../main/java/io/bitsquare/gui/bitsquare.css" vgap="5.0"
|
||||
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
|
||||
AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="io.bitsquare.gui.main.settings.uimock.SeedWordsControllerUIMock">
|
||||
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="26.0"/>
|
||||
</padding>
|
||||
|
||||
<children>
|
||||
|
||||
<Pane id="form-group-background-active" fx:id="payFundsPane" GridPane.columnSpan="3" GridPane.rowSpan="4">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/>
|
||||
</GridPane.margin>
|
||||
<children>
|
||||
<Label id="form-group-title-active" fx:id="payFundsTitleLabel" layoutX="8" layoutY="-8"
|
||||
text="Backup your wallet seed words">
|
||||
<padding>
|
||||
<Insets left="5" right="7"/>
|
||||
</padding>
|
||||
</Label>
|
||||
</children>
|
||||
</Pane>
|
||||
<Label text="Wallet seed words:" GridPane.columnIndex="0" GridPane.rowIndex="1" GridPane.valignment="TOP">
|
||||
<GridPane.margin>
|
||||
<Insets top="7.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<TextArea prefHeight="100.0" text="essay case modify essay case modify essay case modify essay case modify"
|
||||
GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets/>
|
||||
</GridPane.margin>
|
||||
<font>
|
||||
<Font size="16.0"/>
|
||||
</font>
|
||||
</TextArea>
|
||||
|
||||
<Button defaultButton="true" text="I have made my backup" GridPane.columnIndex="1" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10"/>
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
|
||||
<ImageView fx:id="payFundsInfoIcon" GridPane.rowSpan="2" fitHeight="24.0" fitWidth="24.0" pickOnBounds="true"
|
||||
preserveRatio="true"
|
||||
GridPane.rowIndex="3" GridPane.valignment="TOP">
|
||||
<image>
|
||||
<Image fx:id="infoIcon" url="@../../../../../../../main/resources/images/info.png"/>
|
||||
</image>
|
||||
<GridPane.margin>
|
||||
<Insets right="2.0" top="4.0"/>
|
||||
</GridPane.margin>
|
||||
</ImageView>
|
||||
|
||||
<Label fx:id="payFundsInfoLabel" prefWidth="740.0"
|
||||
text="You can recreate your wallet our of these words when you lose your wallet. Backup it on paper to have better protection against cycer criminals. Open the help menu for more information."
|
||||
wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="3">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
|
||||
|
||||
</children>
|
||||
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="RIGHT" minWidth="200.0"/>
|
||||
<ColumnConstraints hgrow="ALWAYS"/>
|
||||
<ColumnConstraints/>
|
||||
</columnConstraints>
|
||||
|
||||
<rowConstraints>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
</rowConstraints>
|
||||
</GridPane>
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.settings.uimock;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javafx.fxml.Initializable;
|
||||
|
||||
public class SetPasswordControllerUIMock implements Initializable {
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Lifecycle
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.settings.uimock;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class SetPasswordUIMockRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(SetPasswordUIMockRunner.class);
|
||||
private Scene scene;
|
||||
private Parent view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 1200);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/settings/uimock/SetPasswordViewUIMock.fxml"), false);
|
||||
|
||||
try {
|
||||
view = loader.load();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/test/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,107 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of Bitsquare.
|
||||
~
|
||||
~ Bitsquare is free software: you can redistribute it and/or modify it
|
||||
~ under the terms of the GNU Affero General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or (at
|
||||
~ your option) any later version.
|
||||
~
|
||||
~ Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
~ License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Affero General Public License
|
||||
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<GridPane fx:id="root" hgap="5.0" stylesheets="@../../../../../../../main/java/io/bitsquare/gui/bitsquare.css"
|
||||
vgap="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
|
||||
AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="io.bitsquare.gui.main.settings.uimock.SetPasswordControllerUIMock">
|
||||
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="26.0"/>
|
||||
</padding>
|
||||
|
||||
<children>
|
||||
|
||||
<Pane id="form-group-background-active" fx:id="payFundsPane" visible="true" GridPane.columnSpan="3"
|
||||
GridPane.rowSpan="4">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/>
|
||||
</GridPane.margin>
|
||||
<children>
|
||||
<Label id="form-group-title-active" fx:id="payFundsTitleLabel" layoutX="8" layoutY="-8"
|
||||
text="Setup password">
|
||||
<padding>
|
||||
<Insets left="5" right="7"/>
|
||||
</padding>
|
||||
</Label>
|
||||
</children>
|
||||
</Pane>
|
||||
|
||||
<Label fx:id="totalToPayLabel" text="Enter password:" visible="true">
|
||||
<GridPane.margin>
|
||||
<Insets top="10.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
|
||||
<PasswordField promptText="Enter password:" GridPane.columnIndex="1" GridPane.columnSpan="2">
|
||||
<GridPane.margin>
|
||||
<Insets top="10.0"/>
|
||||
</GridPane.margin>
|
||||
</PasswordField>
|
||||
|
||||
<Label fx:id="addressLabel" text="Repeat password:" visible="true" GridPane.rowIndex="1"/>
|
||||
<PasswordField promptText="Repeat password" GridPane.columnIndex="1"
|
||||
GridPane.columnSpan="2" GridPane.rowIndex="1"/>
|
||||
|
||||
<Button GridPane.columnIndex="1" GridPane.rowIndex="2" defaultButton="true"
|
||||
text="Save password" visible="true">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10"/>
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
|
||||
<ImageView fx:id="payFundsInfoIcon" GridPane.rowSpan="2" fitHeight="24.0" fitWidth="24.0" pickOnBounds="true"
|
||||
preserveRatio="true"
|
||||
visible="true" GridPane.rowIndex="3" GridPane.valignment="TOP">
|
||||
<image>
|
||||
<Image fx:id="infoIcon" url="@../../../../../../../main/resources/images/info.png"/>
|
||||
</image>
|
||||
<GridPane.margin>
|
||||
<Insets right="2.0" top="4.0"/>
|
||||
</GridPane.margin>
|
||||
</ImageView>
|
||||
|
||||
<Label fx:id="payFundsInfoLabel" prefWidth="740.0"
|
||||
text="Protect your wallet with a strong password. You need to enter the password any time you withdraw Bitcoins from your trading wallets. You can change the password later in the settings. Open the help menu for more information."
|
||||
visible="true" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="3">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
|
||||
|
||||
</children>
|
||||
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" minWidth="200"/>
|
||||
<ColumnConstraints hgrow="ALWAYS"/>
|
||||
<ColumnConstraints hgrow="NEVER" prefWidth="25.0"/>
|
||||
</columnConstraints>
|
||||
|
||||
<rowConstraints>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
</rowConstraints>
|
||||
</GridPane>
|
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.trade.createoffer;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class CreateOfferUITestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(CreateOfferUITestRunner.class);
|
||||
private Scene scene;
|
||||
private Pane view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 630);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/trade/createoffer/CreateOfferView.fxml"), false);
|
||||
try {
|
||||
view = loader.load();
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/main/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,171 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.trade.createoffer.uimock;
|
||||
|
||||
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.image.*;
|
||||
import javafx.scene.layout.*;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class CreateOfferControllerUIMock implements Initializable {
|
||||
private static final Logger log = LoggerFactory.getLogger(CreateOfferControllerUIMock.class);
|
||||
|
||||
|
||||
@FXML private GridPane gridPane;
|
||||
@FXML private VBox priceAmountMinAmountBox, priceAmountBuyIconBox;
|
||||
@FXML private HBox priceAmountHBox;
|
||||
@FXML private ImageView priceAmountInfoIcon, payFundsInfoIcon, paymentInfoIcon, showDetailsInfoIcon;
|
||||
@FXML private Separator totalsSeparator;
|
||||
|
||||
@FXML private Pane priceAmountPane, paymentInfoPane, payFundsPane, showDetailsPane;
|
||||
@FXML private Label priceAmountInfoLabel, priceAmountTitleLabel, paymentInfoTitleLabel, addressLabel,
|
||||
balanceLabel, paymentInfoLabel,
|
||||
payFundsInfoLabel, payFundsTitleLabel, offerFeeLabel, networkFeeLabel, summaryBtcLabel, totalToPayLabel,
|
||||
showDetailsTitleLabel, bankAccountTypeLabel, bankAccountCurrencyLabel, bankAccountCountyLabel,
|
||||
acceptedCountriesLabel, acceptedLanguagesLabel, acceptedArbitratorsLabel, showDetailsInfoLabel;
|
||||
@FXML private Button showPaymentInfoScreenButton, showPayFundsScreenButton, showDetailsButton;
|
||||
|
||||
@FXML private TextField offerFeeTextField, networkFeeTextField, acceptedArbitratorsTextField;
|
||||
@FXML private TextField addressTextField;
|
||||
@FXML private TextField balanceTextField;
|
||||
|
||||
@FXML private Label buyLabel, confirmationLabel, txTitleLabel, securityDepositLabel;
|
||||
@FXML private TextField amountTextField, minAmountTextField, priceTextField, volumeTextField;
|
||||
@FXML private Button placeOfferButton, closeButton;
|
||||
@FXML private TextField totalToPayTextField, securityDepositTextField, bankAccountTypeTextField,
|
||||
bankAccountCurrencyTextField, bankAccountCountyTextField, acceptedCountriesTextField,
|
||||
acceptedLanguagesTextField,
|
||||
summaryBtcTextField, transactionIdTextField;
|
||||
@FXML private ConfidenceProgressIndicator progressIndicator;
|
||||
|
||||
|
||||
@Inject
|
||||
private CreateOfferControllerUIMock() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
}
|
||||
|
||||
/* @FXML
|
||||
private void collapsePriceAmountPane() {
|
||||
for (int i = 1; i < 4; i++) {
|
||||
gridPane.getRowConstraints().get(i).setMaxHeight(0);
|
||||
}
|
||||
|
||||
GridPane.setRowSpan(priceAmountPane, 1);
|
||||
priceAmountBuyIconBox.setMaxHeight(0);
|
||||
|
||||
// priceAmountPane.setVisible(false);
|
||||
// priceAmountTitleLabel.setVisible(false);
|
||||
priceAmountBuyIconBox.setVisible(false);
|
||||
priceAmountHBox.setVisible(false);
|
||||
priceAmountMinAmountBox.setVisible(false);
|
||||
priceAmountInfoIcon.setVisible(false);
|
||||
priceAmountInfoLabel.setVisible(false);
|
||||
}*/
|
||||
|
||||
@FXML
|
||||
private void showPaymentInfoScreen() {
|
||||
|
||||
priceAmountPane.setId("form-group-background");
|
||||
priceAmountTitleLabel.setId("form-group-title");
|
||||
showPaymentInfoScreenButton.setVisible(false);
|
||||
|
||||
paymentInfoPane.setVisible(true);
|
||||
securityDepositLabel.setVisible(true);
|
||||
securityDepositTextField.setVisible(true);
|
||||
offerFeeLabel.setVisible(true);
|
||||
offerFeeTextField.setVisible(true);
|
||||
networkFeeLabel.setVisible(true);
|
||||
networkFeeTextField.setVisible(true);
|
||||
totalsSeparator.setVisible(true);
|
||||
summaryBtcLabel.setVisible(true);
|
||||
summaryBtcTextField.setVisible(true);
|
||||
paymentInfoLabel.setVisible(true);
|
||||
paymentInfoIcon.setVisible(true);
|
||||
showPayFundsScreenButton.setVisible(true);
|
||||
|
||||
showPayFundsScreen();
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void showPayFundsScreen() {
|
||||
paymentInfoPane.setId("form-group-background");
|
||||
paymentInfoTitleLabel.setId("form-group-title");
|
||||
|
||||
showPayFundsScreenButton.setVisible(false);
|
||||
|
||||
payFundsPane.setVisible(true);
|
||||
totalToPayLabel.setVisible(true);
|
||||
totalToPayTextField.setVisible(true);
|
||||
addressLabel.setVisible(true);
|
||||
addressTextField.setVisible(true);
|
||||
balanceLabel.setVisible(true);
|
||||
balanceTextField.setVisible(true);
|
||||
payFundsInfoIcon.setVisible(true);
|
||||
payFundsInfoLabel.setVisible(true);
|
||||
placeOfferButton.setVisible(true);
|
||||
showDetailsButton.setVisible(true);
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void showDetailsScreen() {
|
||||
payFundsPane.setId("form-group-background");
|
||||
payFundsTitleLabel.setId("form-group-title");
|
||||
|
||||
showDetailsButton.setManaged(false);
|
||||
showDetailsButton.setVisible(false);
|
||||
|
||||
showDetailsPane.setVisible(true);
|
||||
showDetailsTitleLabel.setVisible(true);
|
||||
|
||||
acceptedCountriesLabel.setVisible(true);
|
||||
acceptedCountriesTextField.setVisible(true);
|
||||
acceptedLanguagesLabel.setVisible(true);
|
||||
acceptedLanguagesTextField.setVisible(true);
|
||||
acceptedArbitratorsLabel.setVisible(true);
|
||||
acceptedArbitratorsTextField.setVisible(true);
|
||||
|
||||
bankAccountTypeLabel.setVisible(true);
|
||||
bankAccountTypeTextField.setVisible(true);
|
||||
bankAccountCurrencyLabel.setVisible(true);
|
||||
bankAccountCurrencyTextField.setVisible(true);
|
||||
bankAccountCountyLabel.setVisible(true);
|
||||
bankAccountCountyTextField.setVisible(true);
|
||||
|
||||
showDetailsInfoIcon.setVisible(true);
|
||||
showDetailsInfoLabel.setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.trade.createoffer.uimock;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class CreateOfferUIMockRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(CreateOfferUIMockRunner.class);
|
||||
private Scene scene;
|
||||
private Parent view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 630);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/gui/main/trade/createoffer/uimock/CreateOfferViewUIMock.fxml"), false);
|
||||
|
||||
try {
|
||||
view = loader.load();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/test/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,389 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of Bitsquare.
|
||||
~
|
||||
~ Bitsquare is free software: you can redistribute it and/or modify it
|
||||
~ under the terms of the GNU Affero General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or (at
|
||||
~ your option) any later version.
|
||||
~
|
||||
~ Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
~ License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Affero General Public License
|
||||
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.scene.text.*?>
|
||||
<AnchorPane fx:id="root" prefHeight="630.0" prefWidth="1000.0" style="-fx-background-color: f4f4f4;"
|
||||
stylesheets="@../../../../../../../../../main/java/io/bitsquare/gui/bitsquare.css"
|
||||
AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0"
|
||||
AnchorPane.topAnchor="10.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="io.bitsquare.gui.main.trade.createoffer.uimock.CreateOfferControllerUIMock">
|
||||
<children>
|
||||
<ScrollPane fitToHeight="true" fitToWidth="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
|
||||
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<content>
|
||||
<GridPane fx:id="gridPane" hgap="5.0" vgap="5.0">
|
||||
<children>
|
||||
<Pane id="form-group-background-active" fx:id="priceAmountPane" GridPane.columnSpan="3"
|
||||
GridPane.rowSpan="3">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="-10" left="-10" right="-10" top="-10"/>
|
||||
</GridPane.margin>
|
||||
<children>
|
||||
<Label id="form-group-title-active" fx:id="priceAmountTitleLabel" layoutX="8"
|
||||
layoutY="-8" text="Create your offer">
|
||||
<padding>
|
||||
<Insets left="5" right="7"/>
|
||||
</padding>
|
||||
</Label>
|
||||
</children>
|
||||
</Pane>
|
||||
|
||||
<VBox fx:id="priceAmountBuyIconBox" alignment="CENTER" spacing="6" GridPane.rowSpan="2">
|
||||
<children>
|
||||
<ImageView fitHeight="54.0" fitWidth="62.0" pickOnBounds="true" preserveRatio="true">
|
||||
<image>
|
||||
<Image
|
||||
url="@../../../../../../../../../main/resources/images/buy_large.png"/>
|
||||
</image>
|
||||
</ImageView>
|
||||
<Label fx:id="buyLabel" alignment="CENTER"
|
||||
style="-fx-font-weight:bold; -fx-font-size:16;" text="Buy Bitcoins"
|
||||
textAlignment="CENTER">
|
||||
<padding>
|
||||
<Insets top="-5.0"/>
|
||||
</padding>
|
||||
</Label>
|
||||
</children>
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="20.0"/>
|
||||
</GridPane.margin>
|
||||
</VBox>
|
||||
|
||||
<HBox fx:id="priceAmountHBox" alignment="CENTER_LEFT" spacing="5" GridPane.columnIndex="1"
|
||||
GridPane.columnSpan="2">
|
||||
<children>
|
||||
<VBox spacing="4">
|
||||
<children>
|
||||
<Label id="input-description-label" prefWidth="200.0"
|
||||
text="Amount of Bitcoin to buy:"/>
|
||||
<HBox>
|
||||
<children>
|
||||
<TextField id="text-input-with-currency-text-field"
|
||||
fx:id="amountTextField" alignment="CENTER_RIGHT"
|
||||
prefWidth="200.0" text="1.00"/>
|
||||
<Label id="currency-info-label" text="BTC"/>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</VBox>
|
||||
<Label text="x">
|
||||
<font>
|
||||
<Font name="Helvetica-Bold" size="20.0"/>
|
||||
</font>
|
||||
<padding>
|
||||
<Insets top="14.0"/>
|
||||
</padding>
|
||||
</Label>
|
||||
|
||||
<VBox spacing="4">
|
||||
<children>
|
||||
<Label id="input-description-label" prefWidth="200.0"
|
||||
text="Price per Bitcoin in EUR:"/>
|
||||
<HBox>
|
||||
<children>
|
||||
<TextField id="text-input-with-currency-text-field"
|
||||
fx:id="priceTextField" alignment="CENTER_RIGHT"
|
||||
prefWidth="200.0" text="500.00"/>
|
||||
<Label id="currency-info-label" text="EUR"/>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</VBox>
|
||||
|
||||
<Label text="=">
|
||||
<font>
|
||||
<Font name="Helvetica-Bold" size="20.0"/>
|
||||
</font>
|
||||
<padding>
|
||||
<Insets top="14.0"/>
|
||||
</padding>
|
||||
</Label>
|
||||
|
||||
<VBox spacing="4">
|
||||
<children>
|
||||
<Label id="input-description-label" prefWidth="200.0"
|
||||
text="Amount in EUR to spend:"/>
|
||||
<HBox>
|
||||
<children>
|
||||
<TextField id="text-input-with-currency-text-field"
|
||||
fx:id="volumeTextField" alignment="CENTER_RIGHT"
|
||||
prefWidth="200.0" text="500.00"/>
|
||||
<Label id="currency-info-label" text="EUR"/>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
<GridPane.margin>
|
||||
<Insets right="10.0" top="20.0"/>
|
||||
</GridPane.margin>
|
||||
</HBox>
|
||||
|
||||
<VBox fx:id="priceAmountMinAmountBox" spacing="4" GridPane.columnIndex="1"
|
||||
GridPane.columnSpan="2" GridPane.rowIndex="1">
|
||||
<children>
|
||||
<Label id="input-description-label" prefWidth="200.0"
|
||||
text="Minimum amount of Bitcoin:"/>
|
||||
<HBox>
|
||||
<children>
|
||||
<TextField id="text-input-with-currency-text-field" fx:id="minAmountTextField"
|
||||
alignment="CENTER_RIGHT" prefWidth="200.0" text="0.10"/>
|
||||
<Label id="currency-info-label" text="BTC"/>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
<GridPane.margin>
|
||||
<Insets right="10.0" top="5.0"/>
|
||||
</GridPane.margin>
|
||||
</VBox>
|
||||
|
||||
<ImageView fx:id="priceAmountInfoIcon" GridPane.rowSpan="2" fitHeight="24.0" fitWidth="24.0"
|
||||
pickOnBounds="true"
|
||||
preserveRatio="true" GridPane.rowIndex="2" GridPane.valignment="TOP">
|
||||
<image>
|
||||
<Image fx:id="infoIcon"
|
||||
url="@../../../../../../../../../main/resources/images/info.png"/>
|
||||
</image>
|
||||
<GridPane.margin>
|
||||
<Insets right="2.0" top="4.0"/>
|
||||
</GridPane.margin>
|
||||
</ImageView>
|
||||
<Label fx:id="priceAmountInfoLabel" prefWidth="740.0"
|
||||
text="With the minimum amount you can attract more potential traders with giving more flexibility. Your offer will be removed when it got executed. There is no automatic offer creation for the remaining amount. Open the help menu for more information."
|
||||
wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
|
||||
<Button fx:id="showPaymentInfoScreenButton" defaultButton="true"
|
||||
onAction="#showPaymentInfoScreen" text="Next step" visible="true"
|
||||
GridPane.columnIndex="1" GridPane.rowIndex="3">
|
||||
<GridPane.margin>
|
||||
<Insets top="15.0"/>
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
pay funds
|
||||
|
||||
-->
|
||||
<Pane id="form-group-background-active" fx:id="payFundsPane" visible="true"
|
||||
GridPane.columnSpan="3" GridPane.rowIndex="11" GridPane.rowSpan="4">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/>
|
||||
</GridPane.margin>
|
||||
<children>
|
||||
<Label id="form-group-title-active" fx:id="payFundsTitleLabel" layoutX="8" layoutY="-8"
|
||||
text="Fund your trade wallet">
|
||||
<padding>
|
||||
<Insets left="5" right="7"/>
|
||||
</padding>
|
||||
</Label>
|
||||
</children>
|
||||
</Pane>
|
||||
|
||||
<Label fx:id="totalToPayLabel" text="Funds needed for that trade:" visible="true"
|
||||
GridPane.rowIndex="11">
|
||||
<GridPane.margin>
|
||||
<Insets top="10.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<TextField fx:id="totalToPayTextField" editable="false" focusTraversable="false"
|
||||
text="0.111 BTC" visible="true" GridPane.columnIndex="1" GridPane.columnSpan="2"
|
||||
GridPane.rowIndex="11">
|
||||
<GridPane.margin>
|
||||
<Insets top="10.0"/>
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
|
||||
<Label fx:id="addressLabel" text="Trading wallet BTC address:" visible="true"
|
||||
GridPane.rowIndex="12"/>
|
||||
<TextField fx:id="addressTextField" editable="false" focusTraversable="false"
|
||||
text="mkpymjfTk7WmG9YC4N9c9h1UzwPvMX3aNG" visible="true" GridPane.columnIndex="1"
|
||||
GridPane.columnSpan="2" GridPane.rowIndex="12"/>
|
||||
|
||||
<Label fx:id="balanceLabel" text="Trading wallet balance:" visible="true"
|
||||
GridPane.rowIndex="13"/>
|
||||
<TextField fx:id="balanceTextField" editable="false" focusTraversable="false" text="0.00 BTC"
|
||||
visible="true" GridPane.columnIndex="1" GridPane.columnSpan="2"
|
||||
GridPane.rowIndex="13">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
|
||||
<ImageView fx:id="payFundsInfoIcon" GridPane.rowSpan="2" fitHeight="24.0" fitWidth="24.0"
|
||||
pickOnBounds="true"
|
||||
preserveRatio="true" visible="true" GridPane.rowIndex="14" GridPane.valignment="TOP">
|
||||
<image>
|
||||
<fx:reference source="infoIcon"/>
|
||||
</image>
|
||||
<GridPane.margin>
|
||||
<Insets right="2.0" top="4.0"/>
|
||||
</GridPane.margin>
|
||||
</ImageView>
|
||||
|
||||
<Label fx:id="payFundsInfoLabel" prefWidth="740.0"
|
||||
text="You need to pay in the funds needed to your trade wallet. The fund will be reserved for the case that your offer get executed when accepted by a trader. If you cancel your offer you can withdraw your funds from that trading wallet. The only payment which will be done when placing the offer is the offer fee payment. Open the help menu for more information."
|
||||
visible="true" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="14">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
|
||||
<HBox spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="15">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="30" top="20.0"/>
|
||||
</GridPane.margin>
|
||||
<children>
|
||||
<Button fx:id="showDetailsButton" defaultButton="true" onAction="#showDetailsScreen"
|
||||
text="Show offer restrictions" visible="true"/>
|
||||
<Button fx:id="placeOfferButton" defaultButton="true" text="Place offer"
|
||||
visible="true"/>
|
||||
</children>
|
||||
</HBox>
|
||||
|
||||
<!--
|
||||
|
||||
payment bank details screen
|
||||
|
||||
-->
|
||||
<Pane id="form-group-background-active" fx:id="showDetailsPane" visible="true"
|
||||
GridPane.columnSpan="3" GridPane.rowIndex="16" GridPane.rowSpan="7">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="-10" left="-10" right="-10" top="-10"/>
|
||||
</GridPane.margin>
|
||||
<children>
|
||||
<Label id="form-group-title-active" fx:id="showDetailsTitleLabel" layoutX="8"
|
||||
layoutY="-8" text="Offer restrictions">
|
||||
<padding>
|
||||
<Insets left="5" right="7"/>
|
||||
</padding>
|
||||
</Label>
|
||||
</children>
|
||||
</Pane>
|
||||
|
||||
|
||||
<Label fx:id="acceptedCountriesLabel" text="Accepted countries:" visible="true"
|
||||
GridPane.rowIndex="16"/>
|
||||
<TextField fx:id="acceptedCountriesTextField" editable="false" focusTraversable="false"
|
||||
text="Spain, Austria, Germany" visible="true" GridPane.columnIndex="1"
|
||||
GridPane.columnSpan="2" GridPane.rowIndex="16"/>
|
||||
|
||||
<Label fx:id="acceptedLanguagesLabel" text="Accepted languages:" visible="true"
|
||||
GridPane.rowIndex="17"/>
|
||||
<TextField fx:id="acceptedLanguagesTextField" editable="false" focusTraversable="false"
|
||||
text="English, German, Spanish" visible="true" GridPane.columnIndex="1"
|
||||
GridPane.columnSpan="2" GridPane.rowIndex="17"/>
|
||||
|
||||
<Label fx:id="acceptedArbitratorsLabel" text="Accepted arbitrators:" visible="true"
|
||||
GridPane.rowIndex="18"/>
|
||||
<TextField fx:id="acceptedArbitratorsTextField" editable="false" focusTraversable="false"
|
||||
text="Manfred Karrer, okapacific, Adam Gibson" visible="true"
|
||||
GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="18"/>
|
||||
|
||||
<Label fx:id="bankAccountTypeLabel" text="Bank account type:" visible="true"
|
||||
GridPane.rowIndex="19"/>
|
||||
<TextField fx:id="bankAccountTypeTextField" editable="false" focusTraversable="false"
|
||||
text="Sepa" visible="true" GridPane.columnIndex="1" GridPane.columnSpan="2"
|
||||
GridPane.rowIndex="19"/>
|
||||
|
||||
<Label fx:id="bankAccountCurrencyLabel" text="Bank account currency:" visible="true"
|
||||
GridPane.rowIndex="20"/>
|
||||
<TextField fx:id="bankAccountCurrencyTextField" editable="false" focusTraversable="false"
|
||||
text="EUR" visible="true" GridPane.columnIndex="1" GridPane.columnSpan="2"
|
||||
GridPane.rowIndex="20"/>
|
||||
|
||||
<Label fx:id="bankAccountCountyLabel" text="Bank account county:" visible="true"
|
||||
GridPane.rowIndex="21"/>
|
||||
<TextField fx:id="bankAccountCountyTextField" editable="false" focusTraversable="false"
|
||||
text="Spain" visible="true" GridPane.columnIndex="1" GridPane.columnSpan="2"
|
||||
GridPane.rowIndex="21"/>
|
||||
|
||||
<ImageView fx:id="showDetailsInfoIcon" GridPane.rowSpan="2" fitHeight="24.0" fitWidth="24.0"
|
||||
pickOnBounds="true"
|
||||
preserveRatio="true" visible="true" GridPane.rowIndex="22" GridPane.valignment="TOP">
|
||||
<image>
|
||||
<fx:reference source="infoIcon"/>
|
||||
</image>
|
||||
<GridPane.margin>
|
||||
<Insets right="2.0" top="4.0"/>
|
||||
</GridPane.margin>
|
||||
</ImageView>
|
||||
|
||||
<Label fx:id="showDetailsInfoLabel" prefWidth="740.0"
|
||||
text="Your trading partners must fulfill your offer restrictions. You can edit the accepted countries, languages and arbitrators in the settings. The bank account details are used from your current selected bank account (if you have multiple bank accounts). Open the help menu for more information."
|
||||
visible="true" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="22">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
|
||||
</children>
|
||||
|
||||
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES"/>
|
||||
<ColumnConstraints hgrow="ALWAYS"/>
|
||||
<ColumnConstraints hgrow="NEVER" prefWidth="25.0"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
<RowConstraints/>
|
||||
</rowConstraints>
|
||||
<opaqueInsets>
|
||||
<Insets/>
|
||||
</opaqueInsets>
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="40.0"/>
|
||||
</padding>
|
||||
|
||||
</GridPane>
|
||||
</content>
|
||||
</ScrollPane>
|
||||
</children>
|
||||
</AnchorPane>
|
|
@ -1,183 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.msg.dhttest;
|
||||
|
||||
import io.bitsquare.Bitsquare;
|
||||
import io.bitsquare.bank.BankAccountType;
|
||||
import io.bitsquare.gui.main.trade.offerbook.OfferBookListItem;
|
||||
import io.bitsquare.locale.CountryUtil;
|
||||
import io.bitsquare.msg.BootstrappedPeerFactory;
|
||||
import io.bitsquare.msg.MessageFacade;
|
||||
import io.bitsquare.msg.listeners.AddOfferListener;
|
||||
import io.bitsquare.msg.listeners.BootstrapListener;
|
||||
import io.bitsquare.msg.listeners.OfferBookListener;
|
||||
import io.bitsquare.trade.Direction;
|
||||
import io.bitsquare.trade.Offer;
|
||||
import io.bitsquare.user.User;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Currency;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.beans.property.ReadOnlyObjectWrapper;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.util.Callback;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class DHTTestController implements Initializable {
|
||||
private static final Logger log = LoggerFactory.getLogger(DHTTestController.class);
|
||||
|
||||
private final MessageFacade messageFacade;
|
||||
private BootstrappedPeerFactory bootstrappedPeerFactory;
|
||||
private User user;
|
||||
private final ObservableList<OfferBookListItem> offerBookListItems = FXCollections.observableArrayList();
|
||||
|
||||
@FXML TableView table;
|
||||
@FXML TextArea stateLabel;
|
||||
@FXML TextField toSaveTextField;
|
||||
@FXML TableColumn<OfferBookListItem, OfferBookListItem> idColumn;
|
||||
|
||||
@Inject
|
||||
private DHTTestController(MessageFacade messageFacade, User user,
|
||||
BootstrappedPeerFactory bootstrappedPeerFactory) {
|
||||
this.user = user;
|
||||
this.messageFacade = messageFacade;
|
||||
this.bootstrappedPeerFactory = bootstrappedPeerFactory;
|
||||
|
||||
user.applyPersistedUser(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
messageFacade.init(Bitsquare.getClientPort(), new BootstrapListener() {
|
||||
@Override
|
||||
public void onCompleted() {
|
||||
onMessageFacadeInitialised();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable throwable) {
|
||||
log.error(throwable.toString());
|
||||
}
|
||||
});
|
||||
|
||||
messageFacade.addOfferBookListener(new OfferBookListener() {
|
||||
@Override
|
||||
public void onOfferAdded(Offer offer) {
|
||||
log.debug("offer added " + offer.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOffersReceived(List<Offer> offers) {
|
||||
//TODO use deltas instead replacing the whole list
|
||||
offerBookListItems.clear();
|
||||
offers.stream().forEach(offer -> {
|
||||
if (offer != null) {
|
||||
offerBookListItems.add(new OfferBookListItem(offer, CountryUtil.getDefaultCountry()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOfferRemoved(Offer offer) {
|
||||
offerBookListItems.removeIf(item -> item.getOffer().getId().equals(offer.getId()));
|
||||
}
|
||||
});
|
||||
|
||||
setIDColumnCellFactory();
|
||||
table.setItems(offerBookListItems);
|
||||
|
||||
bootstrappedPeerFactory.connectionState.addListener((ov, oldValue, newValue) -> {
|
||||
stateLabel.setText(newValue);
|
||||
});
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onAddOffer() {
|
||||
Offer offer = new Offer(toSaveTextField.getText(),
|
||||
user.getMessagePublicKey(),
|
||||
Direction.BUY,
|
||||
500,
|
||||
Coin.COIN,
|
||||
Coin.COIN,
|
||||
BankAccountType.SEPA,
|
||||
Currency.getInstance("EUR"),
|
||||
CountryUtil.getDefaultCountry(),
|
||||
"bankAccountUID",
|
||||
new ArrayList<>(),
|
||||
Coin.parseCoin("0.1"),
|
||||
new ArrayList<>(),
|
||||
new ArrayList<>());
|
||||
|
||||
messageFacade.addOffer(offer, new AddOfferListener() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
log.debug("onAddOffer onComplete");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(String reason, Throwable throwable) {
|
||||
log.debug("onAddOffer onFailed");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void onGetOffers() {
|
||||
log.debug("onLoad");
|
||||
messageFacade.getOffers("EUR");
|
||||
}
|
||||
|
||||
private void onMessageFacadeInitialised() {
|
||||
log.debug("onMessageFacadeInitialised");
|
||||
}
|
||||
|
||||
private void setIDColumnCellFactory() {
|
||||
idColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
|
||||
idColumn.setCellFactory(
|
||||
new Callback<TableColumn<OfferBookListItem, OfferBookListItem>, TableCell<OfferBookListItem,
|
||||
OfferBookListItem>>() {
|
||||
@Override
|
||||
public TableCell<OfferBookListItem, OfferBookListItem> call(
|
||||
TableColumn<OfferBookListItem, OfferBookListItem> column) {
|
||||
return new TableCell<OfferBookListItem, OfferBookListItem>() {
|
||||
@Override
|
||||
public void updateItem(final OfferBookListItem item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
if (item != null && item.getOffer() != null && item.getOffer().getAmount() != null)
|
||||
setText(item.getOffer().getId());
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.msg.dhttest;
|
||||
|
||||
import io.bitsquare.di.BitsquareModule;
|
||||
import io.bitsquare.util.ViewLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class DHTTestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(DHTTestRunner.class);
|
||||
private Scene scene;
|
||||
private Parent view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitsquareModule());
|
||||
ViewLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 630);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
ViewLoader loader = new ViewLoader(
|
||||
getUrl("/io/bitsquare/msg/dhttest/DHTTestView.fxml")
|
||||
, false);
|
||||
|
||||
try {
|
||||
view = loader.load();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/test/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of Bitsquare.
|
||||
~
|
||||
~ Bitsquare is free software: you can redistribute it and/or modify it
|
||||
~ under the terms of the GNU Affero General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or (at
|
||||
~ your option) any later version.
|
||||
~
|
||||
~ Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
~ License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Affero General Public License
|
||||
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<AnchorPane fx:id="root" prefHeight="630.0" prefWidth="1000.0" style="-fx-background-color: f4f4f4;"
|
||||
AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0"
|
||||
AnchorPane.topAnchor="10.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="io.bitsquare.msg.dhttest.DHTTestController">
|
||||
<children>
|
||||
<GridPane fx:id="gridPane" hgap="5.0" vgap="5.0" AnchorPane.leftAnchor="10" AnchorPane.topAnchor="10">
|
||||
<children>
|
||||
<Label text="State:" GridPane.rowIndex="0">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="20.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<TextArea fx:id="stateLabel" text="connecting..." editable="false" focusTraversable="false"
|
||||
GridPane.rowIndex="0" prefWidth="750"
|
||||
GridPane.columnIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="20.0"/>
|
||||
</GridPane.margin>
|
||||
</TextArea>
|
||||
|
||||
<Label text="Store offer to DHT with ID:" GridPane.rowIndex="1"/>
|
||||
<TextField fx:id="toSaveTextField" text="test value" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="1" prefWidth="300"/>
|
||||
|
||||
<Button text="Save offer" onAction="#onAddOffer" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="20.0"/>
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
|
||||
|
||||
<Label text="Offerbook:" GridPane.rowIndex="3"/>
|
||||
<Button text="Load offers" onAction="#onGetOffers" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="3"/>
|
||||
|
||||
<TableView fx:id="table" GridPane.rowIndex="4" GridPane.columnIndex="0" GridPane.columnSpan="2"
|
||||
prefHeight="300">
|
||||
<columns>
|
||||
<TableColumn text="ID" fx:id="idColumn" minWidth="130"/>
|
||||
</columns>
|
||||
</TableView>
|
||||
|
||||
</children>
|
||||
|
||||
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" minWidth="200"/>
|
||||
<ColumnConstraints hgrow="ALWAYS"/>
|
||||
</columnConstraints>
|
||||
|
||||
</GridPane>
|
||||
</children>
|
||||
</AnchorPane>
|
Loading…
Add table
Reference in a new issue