Update to new trade process UI

This commit is contained in:
Manfred Karrer 2014-09-23 22:20:30 +02:00
parent a650aef811
commit f80758ca34
81 changed files with 2785 additions and 1418 deletions

View file

@ -75,7 +75,7 @@ public class AccountSettingsUITestRunner extends Application {
refreshStylesheets();
} catch (IOException e) {
e.printStackTrace();
log.error(e.getStackTrace().toString());
e.printStackTrace();
}
}

View file

@ -75,7 +75,7 @@ public class AccountUITestRunner extends Application {
refreshStylesheets();
} catch (IOException e) {
e.printStackTrace();
log.error(e.getStackTrace().toString());
e.printStackTrace();
}
}

View file

@ -75,7 +75,7 @@ public class RegistrationUITestRunner extends Application {
refreshStylesheets();
} catch (IOException e) {
e.printStackTrace();
log.error(e.getStackTrace().toString());
e.printStackTrace();
}
}

View file

@ -75,7 +75,7 @@ public class SetupUITestRunner extends Application {
refreshStylesheets();
} catch (IOException e) {
e.printStackTrace();
log.error(e.getStackTrace().toString());
e.printStackTrace();
}
}

View file

@ -0,0 +1,104 @@
/*
* 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.orders.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/orders/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);
}
}
}

View file

@ -0,0 +1,87 @@
/*
* 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.orders.pending.uimock;
import io.bitsquare.gui.CachedViewController;
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 CachedViewController {
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
///////////////////////////////////////////////////////////////////////////////////////////
}

View file

@ -0,0 +1,104 @@
/*
* 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.orders.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/orders/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);
}
}
}

View file

@ -0,0 +1,99 @@
<?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.orders.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="Pending trades" GridPane.rowIndex="0" GridPane.columnIndex="0"
GridPane.columnSpan="2"/>
<TableView fx:id="orderBookTable" 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="Pending 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>

View file

@ -75,7 +75,7 @@ public class FiatAccountUITestRunner extends Application {
refreshStylesheets();
} catch (IOException e) {
e.printStackTrace();
log.error(e.getStackTrace().toString());
e.printStackTrace();
}
}

View file

@ -75,7 +75,7 @@ public class PasswordUITestRunner extends Application {
refreshStylesheets();
} catch (IOException e) {
e.printStackTrace();
log.error(e.getStackTrace().toString());
e.printStackTrace();
}
}

View file

@ -75,7 +75,7 @@ public class RegistrationUITestRunner extends Application {
refreshStylesheets();
} catch (IOException e) {
e.printStackTrace();
log.error(e.getStackTrace().toString());
e.printStackTrace();
}
}

View file

@ -75,7 +75,7 @@ public class RestrictionsUITestRunner extends Application {
refreshStylesheets();
} catch (IOException e) {
e.printStackTrace();
log.error(e.getStackTrace().toString());
e.printStackTrace();
}
}

View file

@ -75,7 +75,7 @@ public class SeedWordsUITestRunner extends Application {
refreshStylesheets();
} catch (IOException e) {
e.printStackTrace();
log.error(e.getStackTrace().toString());
e.printStackTrace();
}
}

View file

@ -23,7 +23,7 @@
<?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"
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">

View file

@ -75,7 +75,7 @@ public class CreateOfferUITestRunner extends Application {
refreshStylesheets();
} catch (IOException e) {
e.printStackTrace();
log.error(e.getStackTrace().toString());
e.printStackTrace();
}
}

View file

@ -72,7 +72,7 @@ public class CreateOfferControllerUIMock implements Initializable {
@Override
public void initialize(URL url, ResourceBundle rb) {
/*
paymentInfoPane.setVisible(false);
collateralLabel.setVisible(false);
collateralTextField.setVisible(false);
@ -114,7 +114,7 @@ public class CreateOfferControllerUIMock implements Initializable {
bankAccountCountyLabel.setVisible(false);
bankAccountCountyTextField.setVisible(false);
showDetailsInfoIcon.setVisible(false);
showDetailsInfoLabel.setVisible(false);
showDetailsInfoLabel.setVisible(false);*/
}
/* @FXML

View file

@ -68,7 +68,7 @@ public class CreateOfferUIMockRunner extends Application {
log.debug("re load");
pane.getChildren().removeAll();
ViewLoader loader = new ViewLoader(
getUrl("/io/bitsquare/gui/trade/createoffer/uimock/CreateOfferViewUIMock.fxml"), false);
getUrl("/io/bitsquare/gui/main/trade/createoffer/uimock/CreateOfferViewUIMock.fxml"), false);
try {
view = loader.load();

View file

@ -23,7 +23,7 @@
<?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"
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">
@ -52,7 +52,8 @@
<children>
<ImageView fitHeight="54.0" fitWidth="62.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../../../../../../../../main/resources/images/buy_black_62_54.png"/>
<Image
url="@../../../../../../../../../main/resources/images/buy_large.png"/>
</image>
</ImageView>
<Label fx:id="buyLabel" alignment="CENTER"
@ -87,7 +88,7 @@
</VBox>
<Label text="x">
<font>
<Font name="Helvetica" size="20.0"/>
<Font name="Helvetica-Bold" size="20.0"/>
</font>
<padding>
<Insets top="14.0"/>
@ -111,7 +112,7 @@
<Label text="=">
<font>
<Font name="Helvetica" size="20.0"/>
<Font name="Helvetica-Bold" size="20.0"/>
</font>
<padding>
<Insets top="14.0"/>
@ -161,7 +162,7 @@
preserveRatio="true" GridPane.rowIndex="2" GridPane.valignment="TOP">
<image>
<Image fx:id="infoIcon"
url="@../../../../../../../../main/resources/images/info.png"/>
url="@../../../../../../../../../main/resources/images/info.png"/>
</image>
<GridPane.margin>
<Insets right="2.0" top="4.0"/>