remove filter, add country flags, add account selector, update models

This commit is contained in:
Manfred Karrer 2014-04-29 02:28:53 +02:00
parent 8856e31d78
commit a3bee7652b
261 changed files with 628 additions and 367 deletions

View File

@ -1,6 +1,7 @@
package io.bitsquare.bank;
import java.io.Serializable;
import java.util.Currency;
import java.util.Locale;
public class BankAccount implements Serializable
@ -13,25 +14,27 @@ public class BankAccount implements Serializable
private String accountPrimaryID;
private String accountSecondaryID;
private String accountHolderName;
private Locale locale;
private Locale countryLocale;
private Currency currency;
private String uid;
// TODO just for mock yet
public BankAccount(BankAccountType bankAccountType)
{
this.bankAccountType = bankAccountType;
}
public BankAccount(BankAccountType bankAccountType, String accountPrimaryID, String accountSecondaryID, String accountHolderName, Locale locale)
public BankAccount(BankAccountType bankAccountType, String accountPrimaryID, String accountSecondaryID, String accountHolderName, Locale countryLocale, Currency currency)
{
this.bankAccountType = bankAccountType;
this.accountPrimaryID = accountPrimaryID;
this.accountSecondaryID = accountSecondaryID;
this.accountHolderName = accountHolderName;
this.locale = locale;
this.countryLocale = countryLocale;
this.currency = currency;
uid = bankAccountType + "_" + accountPrimaryID + "_" + accountSecondaryID + "_" + accountHolderName + "_" + locale.getISO3Country();
uid = bankAccountType + "_" + accountPrimaryID + "_" + accountSecondaryID + "_" + accountHolderName + "_" + countryLocale.getISO3Country();
}
public String getAccountPrimaryID()
@ -54,6 +57,16 @@ public class BankAccount implements Serializable
return bankAccountType;
}
public Currency getCurrency()
{
return currency;
}
public Locale getCountryLocale()
{
return countryLocale;
}
public String getUid()
{
return uid;
@ -67,8 +80,16 @@ public class BankAccount implements Serializable
", primaryID='" + accountPrimaryID + '\'' +
", secondaryID='" + accountSecondaryID + '\'' +
", holderName='" + accountHolderName + '\'' +
", country='" + locale.getISO3Country() + '\'' +
", currency='" + currency.getCurrencyCode() + '\'' +
", country='" + countryLocale.getISO3Country() + '\'' +
", v='" + VERSION + '\'' +
'}';
}
public String getShortName()
{
return bankAccountType + " " + accountPrimaryID + " / " + accountSecondaryID + " / " + currency.getCurrencyCode();
}
}

View File

@ -16,8 +16,10 @@ public class WalletUtil
Transaction transaction = WalletUtil.getTransaction(wallet);
if (transaction != null && transaction.getConfidence() != null)
{
int appearedAtChainHeight = (transaction.getConfidence().getConfidenceType() == TransactionConfidence.ConfidenceType.BUILDING) ? transaction.getConfidence().getAppearedAtChainHeight() : 0;
return wallet.getLastBlockSeenHeight() - appearedAtChainHeight + 1;
if (transaction.getConfidence().getConfidenceType() == TransactionConfidence.ConfidenceType.BUILDING)
return wallet.getLastBlockSeenHeight() - transaction.getConfidence().getAppearedAtChainHeight() + 1;
else
return 0;
}
else
{

View File

@ -1,6 +1,7 @@
package io.bitsquare.gui;
import com.google.inject.Inject;
import io.bitsquare.bank.BankAccount;
import io.bitsquare.btc.WalletFacade;
import io.bitsquare.di.GuiceFXMLLoader;
import io.bitsquare.gui.components.NetworkSyncPane;
@ -25,12 +26,12 @@ import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.*;
import javafx.util.StringConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.URL;
import java.util.Currency;
import java.util.Date;
import java.util.ResourceBundle;
@ -171,7 +172,7 @@ public class MainController implements Initializable, NavigationController, Wall
addNavButton(leftNavPane, "Funds", Icons.FUNDS, Icons.FUNDS, NavigationController.FUNDS);
addNavButton(leftNavPane, "Message", Icons.MSG, Icons.MSG, NavigationController.MSG);
addBalanceInfo(rightNavPane);
addCurrencyComboBox();
addAccountComboBox();
addNavButton(rightNavPane, "Settings", Icons.SETTINGS, Icons.SETTINGS, NavigationController.SETTINGS);
@ -255,25 +256,45 @@ public class MainController implements Initializable, NavigationController, Wall
return balanceLabel;
}
private void addCurrencyComboBox()
private void addAccountComboBox()
{
Pane holder = new Pane();
ComboBox currencyComboBox = new ComboBox(FXCollections.observableArrayList(settings.getAllCurrencies()));
currencyComboBox.setLayoutY(12);
currencyComboBox.setValue(Settings.getCurrency());
currencyComboBox.valueProperty().addListener(new ChangeListener<Currency>()
if (user.getBankAccounts().size() > 1)
{
ComboBox accountComboBox = new ComboBox(FXCollections.observableArrayList(user.getBankAccounts()));
accountComboBox.setLayoutY(12);
accountComboBox.setValue(user.getCurrentBankAccount());
accountComboBox.setConverter(new StringConverter<BankAccount>()
{
@Override
public void changed(ObservableValue ov, Currency oldValue, Currency newValue)
public String toString(BankAccount bankAccount)
{
orderBookFilter.setCurrency(newValue);
settings.setCurrency(newValue);
return bankAccount.getShortName();
}
@Override
public BankAccount fromString(String s)
{
return null;
}
});
holder.getChildren().add(currencyComboBox);
accountComboBox.valueProperty().addListener(new ChangeListener<BankAccount>()
{
@Override
public void changed(ObservableValue ov, BankAccount oldValue, BankAccount newValue)
{
user.setCurrentBankAccount(newValue);
orderBookFilter.setCurrency(newValue.getCurrency());
orderBookFilter.setCountryLocale(newValue.getCountryLocale());
}
});
Pane holder = new Pane();
holder.getChildren().add(accountComboBox);
rightNavPane.getChildren().add(holder);
}
}
}

View File

@ -50,7 +50,8 @@ public class SetupController implements Initializable, ChildController, WalletFa
private NavigationController navigationController;
private ImageView confirmIconImageView;
private TextField balanceLabel, confirmationsLabel, accountHolderName, accountPrimaryID, accountSecondaryID;
private ComboBox countryComboBox, bankTransferTypeComboBox;
private ComboBox countryComboBox, bankTransferTypeComboBox, currencyComboBox;
private Button addBankAccountButton;
@FXML
private AnchorPane rootContainer;
@ -123,15 +124,19 @@ public class SetupController implements Initializable, ChildController, WalletFa
}
// TODO need checks per bankTransferType
private boolean verifyBankAccountData(Object bankTransferTypeSelectedItem, String accountPrimaryID, String accountSecondaryID, String accountHolderName)
private boolean verifyBankAccountData()
{
boolean result = bankTransferTypeSelectedItem != null;
result &= bankTransferTypeSelectedItem.toString().length() > 0;
result &= accountPrimaryID.length() > 0;
result &= accountSecondaryID.length() > 0;
result &= accountHolderName.length() > 0;
result &= Verification.verifyAccountIDsByBankTransferType(bankTransferTypeSelectedItem, accountPrimaryID, accountSecondaryID);
return result;
boolean accountIDsByBankTransferTypeValid = Verification.verifyAccountIDsByBankTransferType(bankTransferTypeComboBox.getSelectionModel().getSelectedItem(),
accountPrimaryID.getText(),
accountSecondaryID.getText());
return bankTransferTypeComboBox.getSelectionModel().getSelectedItem() != null
&& countryComboBox.getSelectionModel().getSelectedItem() != null
&& currencyComboBox.getSelectionModel().getSelectedItem() != null
&& accountPrimaryID.getText().length() > 0
&& accountSecondaryID.getText().length() > 0
&& accountHolderName.getText().length() > 0
&& accountIDsByBankTransferTypeValid;
}
private Image getConfirmIconImage(int numBroadcastPeers, int depthInBlocks)
@ -222,35 +227,52 @@ public class SetupController implements Initializable, ChildController, WalletFa
accountPrimaryID = FormBuilder.addInputField(formGridPane, "Bank account primary ID", "", ++gridRow);
accountSecondaryID = FormBuilder.addInputField(formGridPane, "Bank account secondary ID:", "", ++gridRow);
countryComboBox = FormBuilder.addComboBox(formGridPane, "Country:", settings.getAllLocales("displayCountry"), ++gridRow);
countryComboBox.setPromptText("Select country");
countryComboBox.setConverter(new StringConverter()
currencyComboBox = FormBuilder.addComboBox(formGridPane, "Currency used for bank account:", settings.getAllCurrencies(), ++gridRow);
currencyComboBox.setPromptText("Select currency");
currencyComboBox.setConverter(new StringConverter<Currency>()
{
@Override
public String toString(Object o)
public String toString(Currency currency)
{
return ((Locale) o).getDisplayCountry();
return currency.getCurrencyCode() + " (" + currency.getDisplayName() + ")";
}
@Override
public Object fromString(String s)
public Currency fromString(String s)
{
return s;
return null;
}
});
countryComboBox = FormBuilder.addComboBox(formGridPane, "Country of bank account:", settings.getAllLocales(), ++gridRow);
countryComboBox.setPromptText("Select country");
countryComboBox.setConverter(new StringConverter<Locale>()
{
@Override
public String toString(Locale locale)
{
return locale.getDisplayCountry();
}
@Override
public Locale fromString(String s)
{
return null;
}
});
Button addButton = new Button("Add other Bank account");
formGridPane.add(addButton, 1, ++gridRow);
addBankAccountButton = new Button("Add other Bank account");
formGridPane.add(addBankAccountButton, 1, ++gridRow);
nextButton.setText("Create account");
checkCreateAccountButtonState();
skipButton.setText("Register later");
// handlers
accountHolderName.focusedProperty().addListener((ov, oldValue, newValue) -> checkCreateAccountButtonState());
accountPrimaryID.focusedProperty().addListener((ov, oldValue, newValue) -> checkCreateAccountButtonState());
accountSecondaryID.focusedProperty().addListener((ov, oldValue, newValue) -> checkCreateAccountButtonState());
accountHolderName.textProperty().addListener((ov, oldValue, newValue) -> checkCreateAccountButtonState());
accountPrimaryID.textProperty().addListener((ov, oldValue, newValue) -> checkCreateAccountButtonState());
accountSecondaryID.textProperty().addListener((ov, oldValue, newValue) -> checkCreateAccountButtonState());
bankTransferTypeComboBox.valueProperty().addListener((ov, oldValue, newValue) -> {
if (newValue != null && newValue instanceof BankAccountType)
@ -265,31 +287,13 @@ public class SetupController implements Initializable, ChildController, WalletFa
}
});
countryComboBox.valueProperty().addListener((ov, oldValue, newValue) -> {
if (newValue != null && newValue instanceof BankAccountType)
{
if (newValue != null)
{
checkCreateAccountButtonState();
}
}
});
currencyComboBox.valueProperty().addListener((ov, oldValue, newValue) -> checkCreateAccountButtonState());
countryComboBox.valueProperty().addListener((ov, oldValue, newValue) -> checkCreateAccountButtonState());
addButton.setOnAction(e -> {
if (bankTransferTypeComboBox.getSelectionModel() != null
&& verifyBankAccountData(bankTransferTypeComboBox.getSelectionModel().getSelectedItem(),
accountPrimaryID.getText(),
accountSecondaryID.getText(),
accountHolderName.getText()))
addBankAccountButton.setOnAction(e -> {
addBankAccount();
if (verifyBankAccountData())
{
user.addBankAccount(new BankAccount(
(BankAccountType) bankTransferTypeComboBox.getSelectionModel().getSelectedItem(),
accountPrimaryID.getText(),
accountSecondaryID.getText(),
accountHolderName.getText(),
(Locale) countryComboBox.getSelectionModel().getSelectedItem())
);
bankTransferTypeComboBox.getSelectionModel().clearSelection();
accountPrimaryID.setText("");
accountPrimaryID.setPromptText("");
@ -299,21 +303,7 @@ public class SetupController implements Initializable, ChildController, WalletFa
});
nextButton.setOnAction(e -> {
boolean inputValid = verifyBankAccountData(bankTransferTypeComboBox.getSelectionModel().getSelectedItem(),
accountPrimaryID.getText(),
accountSecondaryID.getText(),
accountHolderName.getText());
if (bankTransferTypeComboBox.getSelectionModel() != null && countryComboBox.getSelectionModel() != null && inputValid)
{
BankAccount bankAccount = new BankAccount((BankAccountType) bankTransferTypeComboBox.getSelectionModel().getSelectedItem(),
accountPrimaryID.getText(),
accountSecondaryID.getText(),
accountHolderName.getText(),
(Locale) countryComboBox.getSelectionModel().getSelectedItem());
user.addBankAccount(bankAccount);
}
addBankAccount();
if (user.getBankAccounts().size() > 0)
{
@ -342,16 +332,24 @@ public class SetupController implements Initializable, ChildController, WalletFa
skipButton.setOnAction(e -> close());
}
private void addBankAccount()
{
if (verifyBankAccountData())
{
BankAccount bankAccount = new BankAccount((BankAccountType) bankTransferTypeComboBox.getSelectionModel().getSelectedItem(),
accountPrimaryID.getText(),
accountSecondaryID.getText(),
accountHolderName.getText(),
(Locale) countryComboBox.getSelectionModel().getSelectedItem(),
(Currency) currencyComboBox.getSelectionModel().getSelectedItem());
user.addBankAccount(bankAccount);
}
}
private void checkCreateAccountButtonState()
{
boolean enabled = accountHolderName.getText().length() > 0
&& accountPrimaryID.getText().length() > 0
&& accountSecondaryID.getText().length() > 0
&& bankTransferTypeComboBox.getSelectionModel() != null
&& bankTransferTypeComboBox.getSelectionModel().getSelectedItem() != null
&& countryComboBox.getSelectionModel() != null
&& countryComboBox.getSelectionModel().getSelectedItem() != null;
nextButton.setDisable(!enabled);
nextButton.setDisable(!verifyBankAccountData());
addBankAccountButton.setDisable(!verifyBankAccountData());
}
private void buildStep2()
@ -361,8 +359,8 @@ public class SetupController implements Initializable, ChildController, WalletFa
formGridPane.getChildren().clear();
int gridRow = -1;
Map<String, BankAccount> bankAccounts = user.getBankAccounts();
Iterator iterator = bankAccounts.entrySet().iterator();
List<BankAccount> bankAccounts = user.getBankAccounts();
Iterator iterator = bankAccounts.iterator();
int index = 0;
while (iterator.hasNext())
{

View File

@ -1,6 +1,7 @@
package io.bitsquare.gui.trade.orderbook;
import com.google.inject.Inject;
import io.bitsquare.bank.BankAccountType;
import io.bitsquare.gui.ChildController;
import io.bitsquare.gui.NavigationController;
import io.bitsquare.gui.trade.offer.CreateOfferController;
@ -8,36 +9,39 @@ import io.bitsquare.gui.trade.tradeprocess.TradeProcessController;
import io.bitsquare.gui.util.Converter;
import io.bitsquare.gui.util.Formatter;
import io.bitsquare.gui.util.Icons;
import io.bitsquare.gui.util.Localisation;
import io.bitsquare.settings.Settings;
import io.bitsquare.trade.Direction;
import io.bitsquare.trade.orderbook.OrderBook;
import io.bitsquare.trade.orderbook.OrderBookFilter;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.geometry.Pos;
import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.util.Callback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.URL;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
public class OrderBookController implements Initializable, ChildController
{
private static final Logger log = LoggerFactory.getLogger(OrderBookController.class);
private NavigationController navigationController;
private OrderBook orderBook;
private Settings settings;
private OrderBookListItem selectedOrderBookListItem;
private final OrderBookFilter orderBookFilter;
@ -51,41 +55,27 @@ public class OrderBookController implements Initializable, ChildController
@FXML
public HBox topHBox;
@FXML
private Button tradeButton;
@FXML
public TextField volume, amount, price;
@FXML
public Pane filterPane;
@FXML
public TableView<OrderBookListItem> orderBookTable;
@FXML
public TableColumn priceColumn, amountColumn, volumeColumn;
@FXML
private ImageView tradeButtonImageView;
private TableColumn<OrderBookListItem, OrderBookListItem> directionColumn, countryColumn, bankAccountTypeColumn;
@Inject
public OrderBookController(OrderBook orderBook, OrderBookFilter orderBookFilter, Settings settings)
public OrderBookController(OrderBook orderBook, OrderBookFilter orderBookFilter)
{
this.orderBook = orderBook;
this.orderBookFilter = orderBookFilter;
this.settings = settings;
}
@Override
public void initialize(URL url, ResourceBundle rb)
{
orderBookFilter.getCurrencyProperty().addListener(new ChangeListener<String>()
{
@Override
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue)
{
updateOfferList();
}
});
createFilterPane();
updateOfferList();
setCountryColumnCellFactory();
setBankAccountTypeColumnCellFactory();
setDirectionColumnCellFactory();
amount.textProperty().addListener(new ChangeListener<String>()
{
@ -93,7 +83,6 @@ public class OrderBookController implements Initializable, ChildController
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue)
{
orderBookFilter.setAmount(textInputToNumber(oldValue, newValue));
updateOfferList();
updateVolume();
}
});
@ -104,19 +93,24 @@ public class OrderBookController implements Initializable, ChildController
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue)
{
orderBookFilter.setPrice(textInputToNumber(oldValue, newValue));
updateOfferList();
updateVolume();
}
});
orderBookTable.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> {
selectedOrderBookListItem = orderBookTable.getSelectionModel().getSelectedItem();
tradeButton.setDisable(selectedOrderBookListItem == null);
});
tradeButton.setOnAction(e -> openTradeTab(selectedOrderBookListItem));
tradeButton.setDisable(true);
tradeButton.setDefaultButton(true);
orderBookFilter.getChangedProperty().addListener(new ChangeListener<Boolean>()
{
@Override
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue)
{
updateOfferList();
}
});
updateOfferList();
}
@Override
@ -128,26 +122,8 @@ public class OrderBookController implements Initializable, ChildController
public void setDirection(Direction direction)
{
orderBookTable.getSelectionModel().clearSelection();
tradeButton.setDisable(true);
price.setText("");
String title;
Image icon;
if (direction == Direction.SELL)
{
title = "SELL";
icon = sellIcon;
}
else
{
title = "BUY";
icon = buyIcon;
}
tradeButton.setText(title);
tradeButtonImageView.setImage(icon);
orderBookFilter.setDirection(direction);
updateOfferList();
}
private void openTradeTab(OrderBookListItem orderBookListItem)
@ -167,8 +143,8 @@ public class OrderBookController implements Initializable, ChildController
if (createOfferButton == null)
{
createOfferButton = new Button("Create new offer");
holderPane.setBottomAnchor(createOfferButton, 375.0);
holderPane.setLeftAnchor(createOfferButton, 200.0);
holderPane.setBottomAnchor(createOfferButton, 360.0);
holderPane.setLeftAnchor(createOfferButton, 10.0);
holderPane.getChildren().add(createOfferButton);
createOfferButton.setOnAction(e -> {
@ -178,7 +154,7 @@ public class OrderBookController implements Initializable, ChildController
}
createOfferButton.setVisible(true);
holderPane.setBottomAnchor(orderBookTable, 410.0);
holderPane.setBottomAnchor(orderBookTable, 390.0);
}
private void updateOfferList()
@ -199,18 +175,167 @@ public class OrderBookController implements Initializable, ChildController
}
}
private void createFilterPane()
private void setDirectionColumnCellFactory()
{
OrderBook mockOrderBook = new OrderBook(settings);
orderBookFilter.setOfferConstraints(mockOrderBook.getRandomOfferConstraints());
directionColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper(offer.getValue()));
directionColumn.setCellFactory(new Callback<TableColumn<OrderBookListItem, OrderBookListItem>, TableCell<OrderBookListItem, OrderBookListItem>>()
{
@Override
public TableCell<OrderBookListItem, OrderBookListItem> call(TableColumn<OrderBookListItem, OrderBookListItem> directionColumn)
{
return new TableCell<OrderBookListItem, OrderBookListItem>()
{
final ImageView iconView = new ImageView();
final Button button = new Button();
//OrderBookFilterTextItemBuilder.build(filterPane, "Bank transfer types: ", orderBookFilter.getOfferConstraints().getBankAccountTypes(), settings.getAllBankAccountTypes());
OrderBookFilterTextItemBuilder.build(filterPane, "Countries: ", orderBookFilter.getOfferConstraints().getCountries(), settings.getAllCountries());
OrderBookFilterTextItemBuilder.build(filterPane, "Languages: ", orderBookFilter.getOfferConstraints().getLanguages(), settings.getAllLanguages());
OrderBookFilterTextItemBuilder.build(filterPane, "Collateral: ", Arrays.asList(String.valueOf(orderBookFilter.getOfferConstraints().getCollateral())), settings.getAllCollaterals());
OrderBookFilterTextItemBuilder.build(filterPane, "Arbitrator: ", Arrays.asList(orderBookFilter.getOfferConstraints().getArbitrator()), settings.getAllArbitrators());
{
button.setGraphic(iconView);
button.setMinWidth(70);
}
@Override
public void updateItem(final OrderBookListItem orderBookListItem, boolean empty)
{
super.updateItem(orderBookListItem, empty);
if (orderBookListItem != null)
{
String title;
Image icon;
if (orderBookListItem.getOffer().getDirection() == Direction.SELL)
{
icon = buyIcon;
title = Formatter.formatDirection(Direction.BUY, true);
}
else
{
icon = sellIcon;
title = Formatter.formatDirection(Direction.SELL, true);
}
iconView.setImage(icon);
button.setText(title);
setGraphic(button);
button.setOnAction(event -> openTradeTab(orderBookListItem));
}
else
{
setGraphic(null);
}
}
};
}
});
}
private void setCountryColumnCellFactory()
{
countryColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper(offer.getValue()));
countryColumn.setCellFactory(new Callback<TableColumn<OrderBookListItem, OrderBookListItem>, TableCell<OrderBookListItem, OrderBookListItem>>()
{
@Override
public TableCell<OrderBookListItem, OrderBookListItem> call(TableColumn<OrderBookListItem, OrderBookListItem> directionColumn)
{
return new TableCell<OrderBookListItem, OrderBookListItem>()
{
final HBox hBox = new HBox();
{
hBox.setSpacing(3);
hBox.setAlignment(Pos.CENTER);
setGraphic(hBox);
}
@Override
public void updateItem(final OrderBookListItem orderBookListItem, boolean empty)
{
super.updateItem(orderBookListItem, empty);
if (orderBookListItem != null)
{
hBox.getChildren().clear();
setText("");
List<Locale> countryLocales = orderBookListItem.getOffer().getOfferConstraints().getCountryLocales();
int i = 0;
String countries = "";
for (Locale countryLocale : countryLocales)
{
countries += countryLocale.getDisplayCountry();
if (i < countryLocales.size() - 1)
countries += ", ";
if (i < 4)
{
try
{
ImageView imageView = Icons.getIconImageView("/images/countries/" + countryLocale.getCountry().toLowerCase() + ".png");
hBox.getChildren().add(imageView);
} catch (Exception e)
{
log.warn("Country icon not found: " + "/images/countries/" + countryLocale.getCountry().toLowerCase() + ".png country name: " + countryLocale.getDisplayCountry());
}
}
else
{
setText("...");
}
i++;
}
Tooltip.install(this, new Tooltip(countries));
}
else
{
setText("");
hBox.getChildren().clear();
}
}
};
}
});
}
private void setBankAccountTypeColumnCellFactory()
{
bankAccountTypeColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper(offer.getValue()));
bankAccountTypeColumn.setCellFactory(new Callback<TableColumn<OrderBookListItem, OrderBookListItem>, TableCell<OrderBookListItem, OrderBookListItem>>()
{
@Override
public TableCell<OrderBookListItem, OrderBookListItem> call(TableColumn<OrderBookListItem, OrderBookListItem> directionColumn)
{
return new TableCell<OrderBookListItem, OrderBookListItem>()
{
@Override
public void updateItem(final OrderBookListItem orderBookListItem, boolean empty)
{
super.updateItem(orderBookListItem, empty);
if (orderBookListItem != null)
{
List<BankAccountType.BankAccountTypeEnum> bankAccountTypeEnums = orderBookListItem.getOffer().getOfferConstraints().getBankAccountTypes();
String text = "";
int i = 0;
for (BankAccountType.BankAccountTypeEnum bankAccountTypeEnum : bankAccountTypeEnums)
{
text += Localisation.get(bankAccountTypeEnum.toString());
i++;
if (i < bankAccountTypeEnums.size())
text += ", ";
}
setText(text);
if (text.length() > 20)
Tooltip.install(this, new Tooltip(text));
}
else
{
setText("");
}
}
};
}
});
}
private double textInputToNumber(String oldValue, String newValue)
{

View File

@ -1,10 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import io.bitsquare.gui.components.HSpacer?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.control.cell.PropertyValueFactory?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane fx:id="holderPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns:fx="http://javafx.com/fxml/1"
@ -14,14 +12,6 @@
<HBox fx:id="topHBox" prefHeight="22.0" AnchorPane.topAnchor="10.0" AnchorPane.leftAnchor="10.0"
AnchorPane.rightAnchor="10.0">
<children>
<Label text="Filter:" prefWidth="190" id="form-header-text"/>
<Button fx:id="tradeButton">
<graphic>
<ImageView fx:id="tradeButtonImageView"/>
</graphic>
</Button>
<HSpacer prefWidth="10"/>
<TextField fx:id="amount" prefHeight="26.0" prefWidth="60.0" alignment="CENTER_RIGHT">
<HBox.margin>
<Insets left="0.0"/>
@ -50,29 +40,27 @@
</children>
</HBox>
<VBox fx:id="filterPane" AnchorPane.leftAnchor="10.0" AnchorPane.topAnchor="40.0"
AnchorPane.bottomAnchor="10.0" prefWidth="180.0">
<Separator prefWidth="190"/>
</VBox>
<TableView fx:id="orderBookTable" id="orderbook-table" AnchorPane.leftAnchor="200.0"
<TableView fx:id="orderBookTable" id="orderbook-table" AnchorPane.leftAnchor="10.0"
AnchorPane.topAnchor="40.0" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="10.0">
<columns>
<TableColumn text="Amount (Min.)" fx:id="amountColumn" prefWidth="210">
<TableColumn text="Amount (Min.)" fx:id="amountColumn" prefWidth="120">
<cellValueFactory>
<PropertyValueFactory property="amount"/>
</cellValueFactory>
</TableColumn>
<TableColumn text="Price" fx:id="priceColumn" prefWidth="160">
<TableColumn text="Price" fx:id="priceColumn" prefWidth="100">
<cellValueFactory>
<PropertyValueFactory property="price"/>
</cellValueFactory>
</TableColumn>
<TableColumn text="Volume (Min.)" fx:id="volumeColumn" prefWidth="200">
<TableColumn text="Volume (Min.)" fx:id="volumeColumn" prefWidth="160">
<cellValueFactory>
<PropertyValueFactory property="volume"/>
</cellValueFactory>
</TableColumn>
<TableColumn text="Country" fx:id="countryColumn" prefWidth="100" sortable="false"/>
<TableColumn text="Bank transfer type" fx:id="bankAccountTypeColumn" prefWidth="180"/>
<TableColumn text="" fx:id="directionColumn" prefWidth="100" sortable="false"/>
</columns>
</TableView>

View File

@ -288,7 +288,7 @@ public class TradeProcessController implements Initializable, ChildController
FormBuilder.addLabel(contractGridPane, "Price:", Formatter.formatPriceWithCurrencyPair(offer.getPrice(), offer.getCurrency()), ++row);
collateralLabel2 = FormBuilder.addLabel(contractGridPane, "Collateral:", "", ++row);
setCollateral();
FormBuilder.addLabel(contractGridPane, "Language:", Formatter.formatList(offerConstraints.getLanguages()), ++row);
// FormBuilder.addLabel(contractGridPane, "Language:", Formatter.formatList(offerConstraints.getLanguageLocales()), ++row);
FormBuilder.addLabel(contractGridPane, "Arbitrator:", offerConstraints.getArbitrator(), ++row);
// FormBuilder.addLabel(contractGridPane, "Identity verification:", Formatter.formatList(offerConstraints.getIdentityVerifications()), ++row);
FormBuilder.addLabel(contractGridPane, "Bank transfer reference ID:", "Purchase xyz 01.04.2014", ++row);
@ -297,7 +297,7 @@ public class TradeProcessController implements Initializable, ChildController
FormBuilder.addHeaderLabel(contractGridPane, "Offerer data:", ++row);
FormBuilder.addLabel(contractGridPane, "Account ID:", offerer.getAccountID(), ++row);
FormBuilder.addLabel(contractGridPane, "Messaging ID:", offerer.getMessageID(), ++row);
FormBuilder.addLabel(contractGridPane, "Country:", offerer.getCountry(), ++row);
//FormBuilder.addLabel(contractGridPane, "Country:", offerer.getCountry(), ++row);
offererPubKeyLabel = FormBuilder.addLabel(contractGridPane, "Payment public key:", contract.getOffererPubKey(), ++row);
FormBuilder.addLabel(contractGridPane, "Bank transfer type:", offerer.getCurrentBankAccount().getBankAccountType().toString(), ++row);
offererAccountPrimaryID = FormBuilder.addLabel(contractGridPane, "Bank account IBAN:", offerer.getCurrentBankAccount().getAccountPrimaryID(), ++row);
@ -308,7 +308,7 @@ public class TradeProcessController implements Initializable, ChildController
FormBuilder.addHeaderLabel(contractGridPane, "Offer taker data:", ++row);
FormBuilder.addLabel(contractGridPane, "Account ID:", taker.getAccountID(), ++row);
FormBuilder.addLabel(contractGridPane, "Messaging ID:", taker.getMessageID(), ++row);
FormBuilder.addLabel(contractGridPane, "Country:", taker.getCountry(), ++row);
// FormBuilder.addLabel(contractGridPane, "Country:", taker.getCountry(), ++row);
FormBuilder.addLabel(contractGridPane, "Payment public key:", contract.getTakerPubKey(), ++row);
FormBuilder.addLabel(contractGridPane, "Bank transfer type:", taker.getCurrentBankAccount().getBankAccountType().toString(), ++row);
FormBuilder.addLabel(contractGridPane, "Bank account IBAN:", taker.getCurrentBankAccount().getAccountPrimaryID(), ++row);

View File

@ -43,30 +43,81 @@ public class Settings
currency = Currency.getInstance("USD");
}
//TODO remove duplicated entries, insert separators
public ArrayList<Currency> getAllCurrencies()
public ArrayList<Locale> getAllLocales()
{
ArrayList<Currency> currencies = new ArrayList<>();
currencies.add(Currency.getInstance("USD"));
currencies.add(Currency.getInstance("EUR"));
currencies.add(Currency.getInstance("CNY"));
currencies.add(Currency.getInstance("RUB"));
ArrayList<Locale> list = new ArrayList<Locale>(Arrays.asList(Locale.getAvailableLocales()));
list.removeIf(new Predicate<Locale>()
{
@Override
public boolean test(Locale locale)
{
return locale == null || locale.getCountry().equals("") || locale.getLanguage().equals("");
}
});
currencies.add(Currency.getInstance("JPY"));
currencies.add(Currency.getInstance("GBP"));
currencies.add(Currency.getInstance("CAD"));
currencies.add(Currency.getInstance("AUD"));
currencies.add(Currency.getInstance("CHF"));
currencies.add(Currency.getInstance("CNY"));
list.sort(new Comparator<Locale>()
{
@Override
public int compare(Locale locale1, Locale locale2)
{
return locale1.getDisplayCountry().compareTo(locale2.getDisplayCountry());
}
});
/* Set<Currency> otherCurrenciesSet = Currency.getAvailableCurrencies();
ArrayList<Currency> otherCurrenciesList = new ArrayList<>();
otherCurrenciesList.addAll(otherCurrenciesSet);
Collections.sort(otherCurrenciesList, new CurrencyComparator());
Locale defaultLocale = Locale.getDefault();
list.remove(defaultLocale);
list.add(0, defaultLocale);
currencies.addAll(otherCurrenciesList); */
return currencies;
return list;
}
public List<Currency> getAllCurrencies()
{
ArrayList<Currency> mainCurrencies = new ArrayList<>();
mainCurrencies.add(Currency.getInstance("USD"));
mainCurrencies.add(Currency.getInstance("EUR"));
mainCurrencies.add(Currency.getInstance("CNY"));
mainCurrencies.add(Currency.getInstance("RUB"));
mainCurrencies.add(Currency.getInstance("JPY"));
mainCurrencies.add(Currency.getInstance("GBP"));
mainCurrencies.add(Currency.getInstance("CAD"));
mainCurrencies.add(Currency.getInstance("AUD"));
mainCurrencies.add(Currency.getInstance("CHF"));
mainCurrencies.add(Currency.getInstance("CNY"));
Set<Currency> allCurrenciesSet = Currency.getAvailableCurrencies();
allCurrenciesSet.removeAll(mainCurrencies);
List<Currency> allCurrenciesList = new ArrayList<>(allCurrenciesSet);
allCurrenciesList.sort(new Comparator<Currency>()
{
@Override
public int compare(Currency a, Currency b)
{
return a.getCurrencyCode().compareTo(b.getCurrencyCode());
}
});
List<Currency> resultList = new ArrayList<>(mainCurrencies);
resultList.addAll(allCurrenciesList);
Currency defaultCurrency = Currency.getInstance(Locale.getDefault());
resultList.remove(defaultCurrency);
resultList.add(0, defaultCurrency);
return resultList;
}
public ArrayList<BankAccountType.BankAccountTypeEnum> getAllBankAccountTypeEnums()
{
ArrayList<BankAccountType.BankAccountTypeEnum> bankAccountTypeEnums = new ArrayList<>();
bankAccountTypeEnums.add(BankAccountType.BankAccountTypeEnum.SEPA);
bankAccountTypeEnums.add(BankAccountType.BankAccountTypeEnum.WIRE);
bankAccountTypeEnums.add(BankAccountType.BankAccountTypeEnum.INTERNATIONAL);
bankAccountTypeEnums.add(BankAccountType.BankAccountTypeEnum.OK_PAY);
bankAccountTypeEnums.add(BankAccountType.BankAccountTypeEnum.NET_TELLER);
bankAccountTypeEnums.add(BankAccountType.BankAccountTypeEnum.PERFECT_MONEY);
bankAccountTypeEnums.add(BankAccountType.BankAccountTypeEnum.OTHER);
return bankAccountTypeEnums;
}
public ArrayList<BankAccountType> getAllBankAccountTypes()
@ -82,74 +133,6 @@ public class Settings
return bankTransferTypes;
}
public ArrayList<String> getAllCountries()
{
ArrayList<String> bankTransferTypes = new ArrayList<>();
bankTransferTypes.add("USA");
bankTransferTypes.add("GB");
bankTransferTypes.add("DE");
bankTransferTypes.add("FR");
bankTransferTypes.add("ES");
bankTransferTypes.add("CH");
bankTransferTypes.add("RUS");
bankTransferTypes.add("AUS");
bankTransferTypes.add("CAN");
bankTransferTypes.add("AT");
return bankTransferTypes;
}
public ArrayList<Locale> getAllLocales(String sortField)
{
ArrayList<Locale> list = new ArrayList<Locale>(Arrays.asList(Locale.getAvailableLocales()));
list.removeIf(new Predicate<Locale>()
{
@Override
public boolean test(Locale locale)
{
return locale == null || locale.getCountry().equals("") || locale.getLanguage().equals("");
}
});
list.sort(new Comparator()
{
@Override
public int compare(Object o1, Object o2)
{
if (sortField.equals("displayCountry"))
return (((Locale) o1).getDisplayCountry()).compareTo(((Locale) o2).getDisplayCountry());
else
return 1;
}
});
Locale defaultLocale = Locale.getDefault();
list.remove(defaultLocale);
list.add(0, defaultLocale);
return list;
}
/*public ArrayList<String> getAllLanguages()
{
ArrayList<String> result = new ArrayList<>();
for (Locale locale : Locale.getAvailableLocales())
{
result.add(locale.getDisplayLanguage());
}
return result;
} */
public ArrayList<String> getAllLanguages()
{
ArrayList<String> bankTransferTypes = new ArrayList<>();
bankTransferTypes.add("English");
bankTransferTypes.add("Chinese");
bankTransferTypes.add("Spanish");
bankTransferTypes.add("Russian");
bankTransferTypes.add("French");
bankTransferTypes.add("Italian");
return bankTransferTypes;
}
public ArrayList<String> getAllArbitrators()
{

View File

@ -3,51 +3,59 @@ package io.bitsquare.trade;
import io.bitsquare.bank.BankAccountType;
import java.util.List;
import java.util.Locale;
public class OfferConstraints
{
//TODO remove
private double collateral;
private List<String> countries;
private List<String> languages;
private List<BankAccountType> bankAccountTypes;
private String arbitrator;
private String identityVerification;
public OfferConstraints(List<String> countries,
List<String> languages,
private List<Locale> countryLocales;
private List<Locale> languageLocales;
private List<BankAccountType.BankAccountTypeEnum> bankAccountTypes;
public OfferConstraints(List<Locale> countryLocales,
List<Locale> languageLocales,
double collateral,
List<BankAccountType> bankAccountTypes,
List<BankAccountType.BankAccountTypeEnum> bankAccountTypes,
String arbitrator,
String identityVerification)
{
this.countries = countries;
this.languages = languages;
this.collateral = collateral;
this.countryLocales = countryLocales;
this.languageLocales = languageLocales;
this.bankAccountTypes = bankAccountTypes;
this.collateral = collateral;
this.arbitrator = arbitrator;
this.identityVerification = identityVerification;
}
public double getCollateral()
/**
* @return List of ISO3 country codes
*/
public List<Locale> getCountryLocales()
{
return collateral;
return countryLocales;
}
public List<String> getCountries()
/**
* @return List of ISO3 language codes
*/
public List<Locale> getLanguageLocales()
{
return countries;
return languageLocales;
}
public List<String> getLanguages()
{
return languages;
}
public List<BankAccountType> getBankAccountTypes()
public List<BankAccountType.BankAccountTypeEnum> getBankAccountTypes()
{
return bankAccountTypes;
}
public String getArbitrator()
{
return arbitrator;
@ -57,4 +65,9 @@ public class OfferConstraints
{
return identityVerification;
}
public double getCollateral()
{
return collateral;
}
}

View File

@ -1,7 +1,6 @@
package io.bitsquare.trade.orderbook;
import com.google.inject.Inject;
import io.bitsquare.bank.BankAccount;
import io.bitsquare.bank.BankAccountType;
import io.bitsquare.gui.trade.orderbook.OrderBookListItem;
import io.bitsquare.gui.util.Converter;
@ -30,7 +29,7 @@ public class OrderBook
orderBookListItems = FXCollections.observableArrayList();
for (int i = 0; i < 100; i++)
{
orderBookListItems.add(getOfferListVO());
orderBookListItems.add(getOrderBookListItem());
}
}
@ -61,10 +60,9 @@ public class OrderBook
return result;
}
private OrderBookListItem getOfferListVO()
private OrderBookListItem getOrderBookListItem()
{
Offer i = getOffer();
return new OrderBookListItem(i);
return new OrderBookListItem(getOffer());
}
public ArrayList<Currency> getCurrencies()
@ -94,20 +92,17 @@ public class OrderBook
private Offer getOffer()
{
User offerer = new User();
offerer.setAccountID(UUID.randomUUID().toString());
offerer.setMessageID(UUID.randomUUID().toString());
offerer.setOnline(Math.random() > 0.5 ? true : false);
offerer.setLanguageLocales(getLanguageLocales());
double amount = Math.random() * 10 + 0.1;
amount = Converter.convertToDouble(Formatter.formatAmount(amount));
double minAmount = Math.random() * amount;
minAmount = Converter.convertToDouble(Formatter.formatAmount(minAmount));
String country = getCountries().get(0);
BankAccountType bankAccountType = getBankTransferTypes().get(0);
BankAccount bankAccount = new BankAccount(bankAccountType);
User offerer = new User();
offerer.setAccountID(UUID.randomUUID().toString());
offerer.setMessageID(UUID.randomUUID().toString());
offerer.setCountry(country);
offerer.addBankAccount(bankAccount);
Direction direction = Direction.BUY;
double price = 500 + Math.random() * 50;
if (Math.random() > 0.5)
@ -129,10 +124,10 @@ public class OrderBook
public OfferConstraints getRandomOfferConstraints()
{
OfferConstraints offerConstraints = new OfferConstraints(getCountries(),
getLanguages(),
OfferConstraints offerConstraints = new OfferConstraints(getCountryLocales(),
getLanguageLocales(),
Double.valueOf(getCollaterals().get(0)),
getBankTransferTypes(),
getBankTransferTypeEnums(),
getArbitrators().get(0),
randomizeStrings(settings.getAllIdentityVerifications(), false).get(0));
@ -140,22 +135,28 @@ public class OrderBook
}
private List<String> getCountries()
private List<Locale> getCountryLocales()
{
return randomizeStrings(settings.getAllCountries(), false);
return randomizeList(settings.getAllLocales(), false);
}
private List<String> getLanguages()
private List<Locale> getLanguageLocales()
{
return randomizeStrings(settings.getAllLanguages(), false);
return randomizeList(settings.getAllLocales(), false);
}
private List<BankAccountType> getBankTransferTypes()
{
return randomizeBankAccountTypes(settings.getAllBankAccountTypes(), false);
}
private List<BankAccountType.BankAccountTypeEnum> getBankTransferTypeEnums()
{
return randomizeBankAccountTypeEnums(settings.getAllBankAccountTypeEnums(), false);
}
private List<String> getArbitrators()
{
return randomizeStrings(settings.getAllArbitrators(), false);
@ -166,6 +167,16 @@ public class OrderBook
return randomizeStrings(settings.getAllCollaterals(), false);
}
private List<BankAccountType.BankAccountTypeEnum> randomizeBankAccountTypeEnums(List<BankAccountType.BankAccountTypeEnum> list, boolean optional)
{
int e = new Random().nextInt(list.size());
if (!optional && list.size() > 0)
e = Math.max(e, 1);
int s = (e == 0) ? 0 : new Random().nextInt(e);
list = list.subList(s, e);
return list;
}
private List<BankAccountType> randomizeBankAccountTypes(List<BankAccountType> list, boolean optional)
{
int e = new Random().nextInt(list.size());
@ -186,6 +197,17 @@ public class OrderBook
return list;
}
private List randomizeList(List list, boolean optional)
{
int e = new Random().nextInt(list.size());
if (!optional && list.size() > 0)
e = Math.max(e, 1);
int s = (e == 0) ? 0 : new Random().nextInt(e);
list = list.subList(s, e);
return list;
}
private List<Double> randomizeDouble(List<Double> list, boolean optional)
{
int e = new Random().nextInt(list.size());

View File

@ -2,10 +2,10 @@ package io.bitsquare.trade.orderbook;
import io.bitsquare.trade.Direction;
import io.bitsquare.trade.OfferConstraints;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.beans.property.SimpleBooleanProperty;
import java.util.Currency;
import java.util.Locale;
public class OrderBookFilter
{
@ -13,22 +13,65 @@ public class OrderBookFilter
private double amount;
private Direction direction;
private Currency currency;
private final StringProperty currencyProperty = new SimpleStringProperty();
private Locale countryLocale;
private Locale languageLocale;
private OfferConstraints offerConstraints;
public SimpleBooleanProperty changedPropertyProperty()
{
return changedProperty;
}
private final SimpleBooleanProperty changedProperty = new SimpleBooleanProperty();
// setters
public void setCurrency(Currency currency)
{
this.currency = currency;
triggerChange();
}
public void setAmount(double amount)
{
this.amount = amount;
triggerChange();
}
public double getAmount()
public void setPrice(double price)
{
return amount;
this.price = price;
triggerChange();
}
public void setDirection(Direction direction)
{
this.direction = direction;
triggerChange();
}
public void setOfferConstraints(OfferConstraints offerConstraints)
{
this.offerConstraints = offerConstraints;
triggerChange();
}
public void setCountryLocale(Locale countryLocale)
{
this.countryLocale = countryLocale;
triggerChange();
}
public void setLanguageLocale(Locale languageLocale)
{
this.languageLocale = languageLocale;
triggerChange();
}
// getters
public double getAmount()
{
return amount;
}
public Direction getDirection()
@ -41,34 +84,33 @@ public class OrderBookFilter
return price;
}
public void setPrice(double price)
{
this.price = price;
}
public Currency getCurrency()
{
return currency;
}
public StringProperty getCurrencyProperty()
{
return currencyProperty;
}
public void setCurrency(Currency currency)
{
this.currency = currency;
currencyProperty.set(currency.getCurrencyCode());
}
public OfferConstraints getOfferConstraints()
{
return offerConstraints;
}
public void setOfferConstraints(OfferConstraints offerConstraints)
public Locale getCountryLocale()
{
this.offerConstraints = offerConstraints;
return countryLocale;
}
public Locale getLanguageLocale()
{
return languageLocale;
}
public SimpleBooleanProperty getChangedProperty()
{
return changedProperty;
}
private void triggerChange()
{
changedProperty.set(!changedProperty.get());
}
}

View File

@ -3,9 +3,10 @@ package io.bitsquare.user;
import io.bitsquare.bank.BankAccount;
import java.io.Serializable;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
import java.util.List;
import java.util.Locale;
public class User implements Serializable
{
@ -14,13 +15,14 @@ public class User implements Serializable
private String accountID;
private String messageID;
private boolean online;
private List<BankAccount> bankAccounts = new ArrayList<>();
private BankAccount currentBankAccount = null;
private Map<String, BankAccount> bankAccounts = new HashMap<>();
private String country;
private List<Locale> languageLocales = new ArrayList<>();
private Locale currentLanguageLocale = null;
public User()
{
addLanguageLocales(Locale.getDefault());
}
public void updateFromStorage(User savedUser)
@ -32,17 +34,18 @@ public class User implements Serializable
online = savedUser.isOnline();
currentBankAccount = savedUser.getCurrentBankAccount();
bankAccounts = savedUser.getBankAccounts();
country = savedUser.getCountry();
languageLocales = savedUser.getLanguageLocales();
currentLanguageLocale = savedUser.getCurrentLanguageLocale();
}
}
public String getStringifiedBankAccounts()
{
String bankAccountUIDs = "";
for (Iterator<Map.Entry<String, BankAccount>> iterator = getBankAccounts().entrySet().iterator(); iterator.hasNext(); )
for (Iterator<BankAccount> iterator = getBankAccounts().iterator(); iterator.hasNext(); )
{
Map.Entry<String, BankAccount> entry = iterator.next();
bankAccountUIDs += entry.getValue().getStringifiedBankAccount();
BankAccount bankAccount = iterator.next();
bankAccountUIDs += bankAccount.getStringifiedBankAccount();
if (iterator.hasNext())
bankAccountUIDs += ", ";
@ -50,52 +53,71 @@ public class User implements Serializable
return bankAccountUIDs;
}
public void addLanguageLocales(Locale locale)
{
languageLocales.add(locale);
currentLanguageLocale = locale;
}
public void addBankAccount(BankAccount bankAccount)
{
if (currentBankAccount == null)
bankAccounts.add(bankAccount);
currentBankAccount = bankAccount;
bankAccounts.put(bankAccount.getUid(), bankAccount);
}
public Map<String, BankAccount> getBankAccounts()
{
return bankAccounts;
}
public BankAccount getBankAccountByUID(String uid)
{
return bankAccounts.get(uid);
}
public String getMessageID()
{
return messageID;
}
// setter
public void setMessageID(String messageID)
{
this.messageID = messageID;
}
public String getAccountID()
{
return accountID;
}
public void setAccountID(String accountID)
{
this.accountID = accountID;
}
public void setCountry(String country)
public void setBankAccounts(List<BankAccount> bankAccounts)
{
this.country = country;
this.bankAccounts = bankAccounts;
}
public String getCountry()
public void setCurrentBankAccount(BankAccount currentBankAccount)
{
return country;
this.currentBankAccount = currentBankAccount;
}
public void setLanguageLocales(List<Locale> languageLocales)
{
this.languageLocales = languageLocales;
}
public void setCurrentLanguageLocale(Locale currentLanguageLocale)
{
this.currentLanguageLocale = currentLanguageLocale;
}
public void setOnline(boolean online)
{
this.online = online;
}
// getter
public String getMessageID()
{
return messageID;
}
public String getAccountID()
{
return accountID;
}
public List<BankAccount> getBankAccounts()
{
return bankAccounts;
}
public BankAccount getCurrentBankAccount()
@ -103,6 +125,16 @@ public class User implements Serializable
return currentBankAccount;
}
public List<Locale> getLanguageLocales()
{
return languageLocales;
}
public Locale getCurrentLanguageLocale()
{
return currentLanguageLocale;
}
public boolean isOnline()
{
return online;

View File

@ -1 +1,8 @@
currency=Währung
SEPA=Sepa
WIRE=Wire
INTERNATIONAL=International
OK_PAY=OK Pay
NET_TELLER=Netteller
PERFECT_MONEY=Perfect Money
OTHER=Other

View File

@ -1 +1,8 @@
currency=Currency
SEPA=Sepa
WIRE=Wire
INTERNATIONAL=International
OK_PAY=OK Pay
NET_TELLER=Netteller
PERFECT_MONEY=Perfect Money
OTHER=Other

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Some files were not shown because too many files have changed in this diff Show More