reformatting

This commit is contained in:
Manfred Karrer 2014-08-27 21:26:40 +02:00
parent 7fee8b665e
commit ab6ae89c38
30 changed files with 48 additions and 49 deletions

View File

@ -24,8 +24,8 @@ import io.bitsquare.gui.NavigationItem;
import io.bitsquare.gui.components.Popups;
import io.bitsquare.gui.util.Profiler;
import io.bitsquare.msg.MessageFacade;
import io.bitsquare.settings.Settings;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.settings.Settings;
import io.bitsquare.user.User;
import io.bitsquare.util.AWTSystemTray;
import io.bitsquare.util.AppDirectoryUtil;

View File

@ -43,7 +43,7 @@ import org.slf4j.LoggerFactory;
/**
* Well known node which is reachable for all peers for bootstrapping.
* There will be several SeedNodes running on several servers.
* <p/>
* <p>
* TODO: Alternative bootstrap methods will follow later (save locally list of known nodes reported form other peers...)
*/
public class SeedNode extends Thread {

View File

@ -66,7 +66,7 @@ public class BitSquareModule extends AbstractModule {
bind(TradeManager.class).asEagerSingleton();
bind(BSFormatter.class).asEagerSingleton();
//bind(String.class).annotatedWith(Names.named("networkType")).toInstance(WalletFacade.MAIN_NET);
// how to use reg test see description in the readme file
bind(String.class).annotatedWith(Names.named("networkType")).toInstance(WalletFacade.REG_TEST_NET);
@ -76,7 +76,7 @@ public class BitSquareModule extends AbstractModule {
// we will probably later disc storage instead of memory storage for TomP2P
// bind(Boolean.class).annotatedWith(Names.named("useDiskStorage")).toInstance(new Boolean(true));
bind(Boolean.class).annotatedWith(Names.named("useDiskStorage")).toInstance(new Boolean(false));
// might be better in a config file?
bind(SeedNodeAddress.StaticSeedNodeAddresses.class).annotatedWith(
Names.named("defaultSeedNode")).toInstance(SeedNodeAddress.StaticSeedNodeAddresses.LOCALHOST);

View File

@ -103,7 +103,7 @@ public class GuiceFXMLLoader {
* A JavaFX controller factory for constructing controllers via Guice DI. To
* install this in the {@link javafx.fxml.FXMLLoader}, pass it as a parameter to
* {@link javafx.fxml.FXMLLoader#setControllerFactory(javafx.util.Callback)}.
* <p/>
* <p>
* Once set, make sure you do <b>not</b> use the static methods on
* {@link javafx.fxml.FXMLLoader} when creating your JavaFX node.
*/

View File

@ -27,8 +27,8 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.gui.util.Profiler;
import io.bitsquare.gui.util.Transitions;
import io.bitsquare.msg.listeners.BootstrapListener;
import io.bitsquare.msg.MessageFacade;
import io.bitsquare.msg.listeners.BootstrapListener;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.trade.TradeManager;
import io.bitsquare.user.User;

View File

@ -17,6 +17,7 @@
package io.bitsquare.gui.arbitrators.browser;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.di.GuiceFXMLLoader;
import io.bitsquare.gui.CachedViewController;
import io.bitsquare.gui.NavigationItem;
@ -25,9 +26,8 @@ import io.bitsquare.gui.arbitrators.profile.ArbitratorProfileController;
import io.bitsquare.locale.LanguageUtil;
import io.bitsquare.msg.MessageFacade;
import io.bitsquare.msg.listeners.ArbitratorListener;
import io.bitsquare.settings.Settings;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.settings.Settings;
import java.io.IOException;
@ -53,7 +53,7 @@ import net.tomp2p.storage.Data;
* TODO remove tomp2p dependencies
* import net.tomp2p.peers.Number160;
* import net.tomp2p.storage.Data;
*
* <p>
* Arbitration is not much developed yet
*/
public class ArbitratorBrowserController extends CachedViewController implements ArbitratorListener {

View File

@ -17,13 +17,13 @@
package io.bitsquare.gui.arbitrators.profile;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.gui.CachedViewController;
import io.bitsquare.gui.NavigationItem;
import io.bitsquare.gui.ViewController;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.settings.Settings;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.settings.Settings;
import java.net.URL;

View File

@ -17,21 +17,21 @@
package io.bitsquare.gui.arbitrators.registration;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.arbitrator.Reputation;
import io.bitsquare.btc.WalletFacade;
import io.bitsquare.gui.CachedViewController;
import io.bitsquare.gui.NavigationItem;
import io.bitsquare.gui.ViewController;
import io.bitsquare.gui.arbitrators.profile.ArbitratorProfileController;
import io.bitsquare.gui.components.ConfidenceDisplay;
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.BitSquareValidator;
import io.bitsquare.gui.components.ConfidenceDisplay;
import io.bitsquare.locale.LanguageUtil;
import io.bitsquare.locale.Localisation;
import io.bitsquare.msg.MessageFacade;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.arbitrator.Reputation;
import io.bitsquare.user.User;
import io.bitsquare.util.DSAKeyUtil;

View File

@ -45,22 +45,22 @@ import javafx.scene.control.*;
* <p>
* ProgressIndicator sets focusTraversable to false.
* </p>
* <p/>
* <p/>
* <p>
* <p>
* This first example creates a ProgressIndicator with an indeterminate value :
* <pre><code>
* import javafx.scene.control.ProgressIndicator;
* ProgressIndicator p1 = new ProgressIndicator();
* </code></pre>
* <p/>
* <p/>
* <p>
* <p>
* This next example creates a ProgressIndicator which is 25% complete :
* <pre><code>
* import javafx.scene.control.ProgressIndicator;
* ProgressIndicator p2 = new ProgressIndicator();
* p2.setProgress(0.25F);
* </code></pre>
* <p/>
* <p>
* Implementation of ProgressIndicator According to JavaFX UI Control API Specification
*
* @since JavaFX 2.0
@ -83,7 +83,7 @@ public class ConfidenceProgressIndicator extends Control {
**************************************************************************/
/**
* Initialize the style class to 'progress-indicator'.
* <p/>
* <p>
* This is the selector class from which CSS can be used to style
* this control.
*/

View File

@ -33,6 +33,7 @@ import com.sun.javafx.scene.control.behavior.BehaviorBase;
// TODO Copied form OpenJFX, check license issues and way how we integrated it
// We changed behaviour which was not exposed via APIs
/**
* @param <C>
*/

View File

@ -27,6 +27,7 @@ import javax.inject.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
//TODO impl. missing yet
public class ClosedTradeController extends CachedViewController {
private static final Logger log = LoggerFactory.getLogger(ClosedTradeController.class);

View File

@ -22,9 +22,9 @@ import io.bitsquare.bank.BankAccountType;
import io.bitsquare.btc.FeePolicy;
import io.bitsquare.btc.WalletFacade;
import io.bitsquare.gui.CachedViewController;
import io.bitsquare.gui.components.ConfidenceDisplay;
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.components.ConfidenceDisplay;
import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.locale.Country;
import io.bitsquare.locale.Localisation;

View File

@ -18,6 +18,8 @@
package io.bitsquare.gui.settings;
import io.bitsquare.BitSquare;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.arbitrator.Reputation;
import io.bitsquare.bank.BankAccount;
import io.bitsquare.bank.BankAccountType;
import io.bitsquare.di.GuiceFXMLLoader;
@ -34,10 +36,8 @@ import io.bitsquare.locale.LanguageUtil;
import io.bitsquare.locale.Localisation;
import io.bitsquare.locale.Region;
import io.bitsquare.msg.MessageFacade;
import io.bitsquare.settings.Settings;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.arbitrator.Reputation;
import io.bitsquare.settings.Settings;
import io.bitsquare.user.User;
import io.bitsquare.util.DSAKeyUtil;

View File

@ -264,7 +264,7 @@ public class CreateOfferCodeBehind extends CachedViewController {
private void setupTextFieldValidators() {
Region referenceNode = (Region) amountTextField.getParent();
BtcValidator amountValidator = new BtcValidator();
amountTextField.setValidator(amountValidator);
amountTextField.setErrorPopupLayoutReference(referenceNode);

View File

@ -85,10 +85,10 @@ class CreateOfferModel {
final StringProperty bankAccountType = new SimpleStringProperty();
final LongProperty collateralAsLong = new SimpleLongProperty();
final BooleanProperty requestPlaceOfferSuccess = new SimpleBooleanProperty();
final BooleanProperty requestPlaceOfferFailed = new SimpleBooleanProperty();
final ObjectProperty<Coin> totalToPayAsCoin = new SimpleObjectProperty<>();
ObservableList<Country> acceptedCountries = FXCollections.observableArrayList();

View File

@ -242,7 +242,7 @@ class CreateOfferPresenter {
}
}
void onFocusOutVolumeTextField(Boolean oldValue, Boolean newValue, String volumeTextFieldText) {
void onFocusOutVolumeTextField(Boolean oldValue, Boolean newValue, String volumeTextFieldText) {
if (oldValue && !newValue) {
showWarningInvalidFiatDecimalPlaces.set(!hasFiatValidDecimals(volume.get()));
model.volumeAsFiat = parseToFiatWith2Decimals(volume.get());

View File

@ -163,7 +163,7 @@
<Label fx:id="confirmationLabel" text="Checking confirmations..." visible="false" GridPane.columnIndex="3"
GridPane.rowIndex="14"/>
<columnConstraints>
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="400"/>

View File

@ -33,8 +33,8 @@ import io.bitsquare.locale.Country;
import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.locale.Localisation;
import io.bitsquare.msg.MessageFacade;
import io.bitsquare.settings.Settings;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.settings.Settings;
import io.bitsquare.trade.Direction;
import io.bitsquare.trade.Offer;
import io.bitsquare.trade.orderbook.OrderBook;

View File

@ -22,7 +22,7 @@ import org.slf4j.LoggerFactory;
/**
* FiatNumberValidator for validating fiat values.
* <p/>
* <p>
* That class implements just what we need for the moment. It is not intended as a general purpose library class.
*/
public class FiatValidator extends NumberValidator {

View File

@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
* Localisation not supported at the moment
* The decimal mark can be either "." or ",". Thousand separators are not supported yet,
* but might be added alter with Local support.
* <p/>
* <p>
* That class implements just what we need for the moment. It is not intended as a general purpose library class.
*/
public abstract class InputValidator {

View File

@ -25,10 +25,10 @@ import org.slf4j.LoggerFactory;
* Localisation not supported at the moment
* The decimal mark can be either "." or ",". Thousand separators are not supported yet,
* but might be added alter with Local support.
* <p/>
* <p>
* That class implements just what we need for the moment. It is not intended as a general purpose library class.
*/
public abstract class NumberValidator extends InputValidator {
public abstract class NumberValidator extends InputValidator {
private static final Logger log = LoggerFactory.getLogger(NumberValidator.class);

View File

@ -35,7 +35,7 @@ public class CountryUtil {
"MY", "NI", "NL", "NO", "NZ", "OM", "PA", "PE", "PH", "PL", "PR", "PT", "PY", "QA", "RO", "RS", "RU",
"SA", "SD", "SE", "SG", "SI", "SK", "SV", "SY", "TH", "TN", "TR", "TW", "UA", "US", "UY", "VE", "VN",
"YE", "ZA"};
private static final List<String> countryCodeList = Arrays.asList(countryCodes);
private static final String[] regionCodes = new String[]{"AS", "EU", "SA", "EU", "OC", "EU", "EU", "EU", "AS",
"SA", "SA", "EU", "NA", "EU", "SA", "AS", "SA", "NA", "EU", "NA", "AS", "EU", "EU", "EU", "NA", "AF",

View File

@ -17,6 +17,7 @@
package io.bitsquare.msg;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.msg.listeners.ArbitratorListener;
import io.bitsquare.msg.listeners.BootstrapListener;
import io.bitsquare.msg.listeners.GetPeerAddressListener;
@ -25,7 +26,6 @@ import io.bitsquare.msg.listeners.OrderBookListener;
import io.bitsquare.msg.listeners.OutgoingTradeMessageListener;
import io.bitsquare.trade.Offer;
import io.bitsquare.trade.protocol.trade.TradeMessage;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.user.User;
import com.google.common.util.concurrent.FutureCallback;
@ -68,7 +68,7 @@ import org.slf4j.LoggerFactory;
* It is the translating domain specific functionality to the messaging layer.
* The TomP2P library codebase shall not be used outside that facade.
* That way we limit the dependency of the TomP2P library only to that class (and it's sub components).
* <p/>
* <p>
* TODO: improve callbacks that Platform.runLater is not necessary. We call usually that methods form teh UI thread.
*/
public class MessageFacade implements MessageBroker {

View File

@ -17,8 +17,8 @@
package io.bitsquare.settings;
import io.bitsquare.locale.Country;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.locale.Country;
import com.google.bitcoin.core.Coin;

View File

@ -17,9 +17,9 @@
package io.bitsquare.trade;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.bank.BankAccountType;
import io.bitsquare.locale.Country;
import io.bitsquare.arbitrator.Arbitrator;
import com.google.bitcoin.core.Coin;

View File

@ -17,6 +17,7 @@
package io.bitsquare.trade.orderbook;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.bank.BankAccount;
import io.bitsquare.gui.trade.orderbook.OrderBookListItem;
import io.bitsquare.locale.Country;
@ -27,7 +28,6 @@ import io.bitsquare.settings.Settings;
import io.bitsquare.trade.Direction;
import io.bitsquare.trade.Offer;
import io.bitsquare.trade.TradeManager;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.user.User;
import java.io.IOException;

View File

@ -59,8 +59,8 @@ public class ValidateOffer {
checkArgument(offer.getPrice() > 0);
// TODO check balance
// Coin collateralAsCoin = offer.getAmount().divide((long) (1d / offer.getCollateral()));
// Coin totalsToFund = collateralAsCoin.add(FeePolicy.CREATE_OFFER_FEE.add(FeePolicy.TX_FEE));
// Coin collateralAsCoin = offer.getAmount().divide((long) (1d / offer.getCollateral()));
// Coin totalsToFund = collateralAsCoin.add(FeePolicy.CREATE_OFFER_FEE.add(FeePolicy.TX_FEE));
// getAddressInfoByTradeID(offerId)
// TODO when offer is flattened continue here...

View File

@ -60,9 +60,9 @@ import static io.bitsquare.util.Validator.*;
/**
* Responsible for the correct execution of the sequence of tasks, message passing to the peer and message processing
* from the peer.
* <p/>
* <p>
* This class handles the role of the offerer as the Bitcoin buyer.
* <p/>
* <p>
* It uses sub tasks to not pollute the main class too much with all the async result/fault handling.
* Any data from incoming messages need to be validated before further processing.
*/

View File

@ -32,7 +32,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* There is no JavaFX support yet, so we need to use AWT.
* There is no JavaFX support yet, so we need to use AWT.
* TODO research more
*/
public class AWTSystemTray {

View File

@ -45,7 +45,7 @@ public class CreateOfferPresenterTest {
CreateOfferPresenter presenter = new CreateOfferPresenter(model);
presenter.onViewInitialized();
model.collateralAsLong.set(100);
presenter.price.set("500");
presenter.amount.set("1");
@ -117,9 +117,6 @@ public class CreateOfferPresenterTest {
model.acceptedCountries.add(new Country(null, "Spain", null));
assertEquals("Italy, Spain", presenter.acceptedCountries.get());
}