Add seed words ui mock

This commit is contained in:
Manfred Karrer 2014-09-04 12:58:34 +02:00
parent bcd3f55b5e
commit 2d13fa3d29
7 changed files with 269 additions and 7 deletions

View File

@ -33,6 +33,35 @@
</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"
@ -156,12 +185,13 @@
</left>
<center>
<Pane fx:id="content">
<fx:include source="SetPasswordViewUIMock.fxml" visible="false" prefWidth="690"/>
<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="true" prefWidth="690"/>
<fx:include source="FundRegistrationWalletViewUIMock.fxml" visible="false" prefWidth="690"/>
</Pane>
</center>
</BorderPane>

View File

@ -0,0 +1,39 @@
/*
* 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.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) {
}
}

View File

@ -0,0 +1,87 @@
package io.bitsquare.gui.settings.uimock;
import io.bitsquare.di.BitSquareModule;
import io.bitsquare.di.GuiceFXMLLoader;
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());
GuiceFXMLLoader.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();
GuiceFXMLLoader loader = new GuiceFXMLLoader(
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);
}
}
}

View File

@ -0,0 +1,106 @@
<?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.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" 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" 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_44.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>

View File

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.registration.uimock;
package io.bitsquare.gui.settings.uimock;
import java.net.URL;

View File

@ -1,4 +1,4 @@
package io.bitsquare.gui.registration.uimock;
package io.bitsquare.gui.settings.uimock;
import io.bitsquare.di.BitSquareModule;
import io.bitsquare.di.GuiceFXMLLoader;
@ -51,7 +51,7 @@ public class SetPasswordUIMockRunner extends Application {
log.debug("re load");
pane.getChildren().removeAll();
GuiceFXMLLoader loader = new GuiceFXMLLoader(
getUrl("/io/bitsquare/gui/registration/uimock/SetPasswordViewUIMock.fxml"), false);
getUrl("/io/bitsquare/gui/settings/uimock/SetPasswordViewUIMock.fxml"), false);
try {
view = loader.load();

View File

@ -24,9 +24,9 @@
<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.registration.uimock.SetPasswordControllerUIMock">
fx:controller="io.bitsquare.gui.settings.uimock.SetPasswordControllerUIMock">
<padding>
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="26.0"/>
</padding>