mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-31 10:49:19 -04:00
Run reformat and organize imports
This commit is contained in:
parent
f723bf5737
commit
cb685d3b5c
73 changed files with 802 additions and 829 deletions
|
@ -19,7 +19,10 @@ package io.bitsquare.locale;
|
||||||
|
|
||||||
import io.bitsquare.user.Preferences;
|
import io.bitsquare.user.Preferences;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class CountryUtil {
|
public class CountryUtil {
|
||||||
|
|
|
@ -387,8 +387,7 @@ public class Notification {
|
||||||
|
|
||||||
if (stage.isShowing()) {
|
if (stage.isShowing()) {
|
||||||
stage.toFront();
|
stage.toFront();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
stage.show();
|
stage.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,14 +529,11 @@ public class Notification {
|
||||||
final EventHandler<NotificationEvent> HANDLER;
|
final EventHandler<NotificationEvent> HANDLER;
|
||||||
if (NotificationEvent.NOTIFICATION_PRESSED == TYPE) {
|
if (NotificationEvent.NOTIFICATION_PRESSED == TYPE) {
|
||||||
HANDLER = getOnNotificationPressed();
|
HANDLER = getOnNotificationPressed();
|
||||||
}
|
} else if (NotificationEvent.SHOW_NOTIFICATION == TYPE) {
|
||||||
else if (NotificationEvent.SHOW_NOTIFICATION == TYPE) {
|
|
||||||
HANDLER = getOnShowNotification();
|
HANDLER = getOnShowNotification();
|
||||||
}
|
} else if (NotificationEvent.HIDE_NOTIFICATION == TYPE) {
|
||||||
else if (NotificationEvent.HIDE_NOTIFICATION == TYPE) {
|
|
||||||
HANDLER = getOnHideNotification();
|
HANDLER = getOnHideNotification();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
HANDLER = null;
|
HANDLER = null;
|
||||||
}
|
}
|
||||||
if (null == HANDLER) return;
|
if (null == HANDLER) return;
|
||||||
|
|
|
@ -58,8 +58,7 @@ public class FxmlViewLoader implements ViewLoader {
|
||||||
if (fxmlView == null) {
|
if (fxmlView == null) {
|
||||||
convention = defaultConvention;
|
convention = defaultConvention;
|
||||||
specifiedLocation = defaultLocation;
|
specifiedLocation = defaultLocation;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
convention = fxmlView.convention();
|
convention = fxmlView.convention();
|
||||||
specifiedLocation = fxmlView.location();
|
specifiedLocation = fxmlView.location();
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,7 @@
|
||||||
package io.bitsquare.gui.common.view;
|
package io.bitsquare.gui.common.view;
|
||||||
|
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.scene.*;
|
import javafx.scene.Node;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -27,7 +26,9 @@ public abstract class AbstractView<R extends Node, M> implements View {
|
||||||
|
|
||||||
protected final Logger log = LoggerFactory.getLogger(this.getClass());
|
protected final Logger log = LoggerFactory.getLogger(this.getClass());
|
||||||
|
|
||||||
protected @FXML R root;
|
protected
|
||||||
|
@FXML
|
||||||
|
R root;
|
||||||
protected final M model;
|
protected final M model;
|
||||||
|
|
||||||
public AbstractView(M model) {
|
public AbstractView(M model) {
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.common.view;
|
package io.bitsquare.gui.common.view;
|
||||||
|
|
||||||
import javafx.scene.*;
|
import javafx.scene.Node;
|
||||||
|
|
||||||
public abstract class ActivatableView<R extends Node, M> extends InitializableView<R, M> {
|
public abstract class ActivatableView<R extends Node, M> extends InitializableView<R, M> {
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,8 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.common.view;
|
package io.bitsquare.gui.common.view;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class CachingViewLoader implements ViewLoader {
|
public class CachingViewLoader implements ViewLoader {
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.common.view;
|
package io.bitsquare.gui.common.view;
|
||||||
|
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
@Target(ElementType.TYPE)
|
@Target(ElementType.TYPE)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.common.view;
|
package io.bitsquare.gui.common.view;
|
||||||
|
|
||||||
import java.net.URL;
|
|
||||||
|
|
||||||
import java.util.ResourceBundle;
|
|
||||||
|
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
import javafx.scene.*;
|
import javafx.scene.Node;
|
||||||
|
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
public abstract class InitializableView<R extends Node, M> extends AbstractView<R, M> implements Initializable {
|
public abstract class InitializableView<R extends Node, M> extends AbstractView<R, M> implements Initializable {
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.common.view;
|
package io.bitsquare.gui.common.view;
|
||||||
|
|
||||||
import javafx.scene.*;
|
import javafx.scene.Node;
|
||||||
|
|
||||||
public interface View {
|
public interface View {
|
||||||
Node getRoot();
|
Node getRoot();
|
||||||
|
|
|
@ -17,11 +17,9 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.common.view.guice;
|
package io.bitsquare.gui.common.view.guice;
|
||||||
|
|
||||||
import io.bitsquare.gui.common.view.ViewFactory;
|
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
|
||||||
import com.google.inject.Injector;
|
import com.google.inject.Injector;
|
||||||
|
import io.bitsquare.gui.common.view.ViewFactory;
|
||||||
|
|
||||||
public class InjectorViewFactory implements ViewFactory {
|
public class InjectorViewFactory implements ViewFactory {
|
||||||
|
|
||||||
|
|
|
@ -117,8 +117,7 @@ public class InfoDisplay extends Parent {
|
||||||
link.setStyle("-fx-focus-color: transparent;");
|
link.setStyle("-fx-focus-color: transparent;");
|
||||||
link.setOnAction(onAction.get());
|
link.setOnAction(onAction.get());
|
||||||
getParent().layout();
|
getParent().layout();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
onAction.get().handle(actionEvent);
|
onAction.get().handle(actionEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,17 +18,18 @@
|
||||||
package io.bitsquare.gui.components;
|
package io.bitsquare.gui.components;
|
||||||
|
|
||||||
import io.bitsquare.gui.util.validation.InputValidator;
|
import io.bitsquare.gui.util.validation.InputValidator;
|
||||||
|
|
||||||
import javafx.beans.property.ObjectProperty;
|
import javafx.beans.property.ObjectProperty;
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
import javafx.geometry.Point2D;
|
import javafx.geometry.Point2D;
|
||||||
import javafx.scene.control.*;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.effect.*;
|
import javafx.scene.control.TextField;
|
||||||
import javafx.scene.layout.*;
|
import javafx.scene.effect.BlurType;
|
||||||
import javafx.scene.paint.*;
|
import javafx.scene.effect.DropShadow;
|
||||||
|
import javafx.scene.effect.Effect;
|
||||||
|
import javafx.scene.layout.Region;
|
||||||
|
import javafx.scene.paint.Color;
|
||||||
import javafx.stage.Window;
|
import javafx.stage.Window;
|
||||||
|
|
||||||
import org.controlsfx.control.PopOver;
|
import org.controlsfx.control.PopOver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,8 +19,10 @@ package io.bitsquare.gui.components;
|
||||||
|
|
||||||
import javafx.animation.FadeTransition;
|
import javafx.animation.FadeTransition;
|
||||||
import javafx.animation.Interpolator;
|
import javafx.animation.Interpolator;
|
||||||
import javafx.scene.control.*;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.layout.*;
|
import javafx.scene.control.ProgressBar;
|
||||||
|
import javafx.scene.layout.HBox;
|
||||||
|
import javafx.scene.layout.Pane;
|
||||||
import javafx.util.Duration;
|
import javafx.util.Duration;
|
||||||
|
|
||||||
// TODO replace with new notification component from lighthouse/bitcoinJ
|
// TODO replace with new notification component from lighthouse/bitcoinJ
|
||||||
|
|
|
@ -25,12 +25,11 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.components.confidence.behavior;
|
package io.bitsquare.gui.components.confidence.behavior;
|
||||||
|
|
||||||
|
import com.sun.javafx.scene.control.behavior.BehaviorBase;
|
||||||
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
|
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
import com.sun.javafx.scene.control.behavior.BehaviorBase;
|
|
||||||
|
|
||||||
// TODO Copied form OpenJFX, check license issues and way how we integrated it
|
// TODO Copied form OpenJFX, check license issues and way how we integrated it
|
||||||
// We changed behaviour which was not exposed via APIs
|
// We changed behaviour which was not exposed via APIs
|
||||||
|
|
||||||
|
|
|
@ -17,24 +17,25 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.components.processbar;
|
package io.bitsquare.gui.components.processbar;
|
||||||
|
|
||||||
|
import com.sun.javafx.scene.control.behavior.BehaviorBase;
|
||||||
|
import com.sun.javafx.scene.control.behavior.KeyBinding;
|
||||||
|
import com.sun.javafx.scene.control.skin.BehaviorSkinBase;
|
||||||
import io.bitsquare.gui.util.Colors;
|
import io.bitsquare.gui.util.Colors;
|
||||||
|
import javafx.geometry.Insets;
|
||||||
|
import javafx.geometry.Pos;
|
||||||
|
import javafx.scene.Node;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
|
import javafx.scene.layout.Border;
|
||||||
|
import javafx.scene.layout.BorderStroke;
|
||||||
|
import javafx.scene.layout.BorderStrokeStyle;
|
||||||
|
import javafx.scene.layout.BorderWidths;
|
||||||
|
import javafx.scene.paint.Color;
|
||||||
|
import javafx.scene.shape.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javafx.geometry.Insets;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.*;
|
|
||||||
import javafx.scene.control.*;
|
|
||||||
import javafx.scene.layout.*;
|
|
||||||
import javafx.scene.paint.*;
|
|
||||||
import javafx.scene.shape.*;
|
|
||||||
|
|
||||||
import com.sun.javafx.scene.control.behavior.BehaviorBase;
|
|
||||||
import com.sun.javafx.scene.control.behavior.KeyBinding;
|
|
||||||
import com.sun.javafx.scene.control.skin.BehaviorSkinBase;
|
|
||||||
|
|
||||||
class ProcessStepBarSkin<T> extends BehaviorSkinBase<ProcessStepBar<T>, BehaviorBase<ProcessStepBar<T>>> {
|
class ProcessStepBarSkin<T> extends BehaviorSkinBase<ProcessStepBar<T>, BehaviorBase<ProcessStepBar<T>>> {
|
||||||
|
|
||||||
private final ProcessStepBar<T> controller;
|
private final ProcessStepBar<T> controller;
|
||||||
|
|
|
@ -113,8 +113,7 @@ public class AccountView extends ActivatableView<TabPane, AccountViewModel> {
|
||||||
tab = arbitratorRegistrationTab;
|
tab = arbitratorRegistrationTab;
|
||||||
arbitratorRegistrationView = (ArbitratorRegistrationView) view;
|
arbitratorRegistrationView = (ArbitratorRegistrationView) view;
|
||||||
arbitratorRegistrationView.onTabSelection(true);
|
arbitratorRegistrationView.onTabSelection(true);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
throw new IllegalArgumentException("View not supported: " + view);
|
throw new IllegalArgumentException("View not supported: " + view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,11 +17,10 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.main.account;
|
package io.bitsquare.gui.main.account;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import io.bitsquare.gui.common.model.ViewModel;
|
import io.bitsquare.gui.common.model.ViewModel;
|
||||||
import io.bitsquare.user.User;
|
import io.bitsquare.user.User;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
|
||||||
|
|
||||||
class AccountViewModel implements ViewModel {
|
class AccountViewModel implements ViewModel {
|
||||||
|
|
||||||
private final User user;
|
private final User user;
|
||||||
|
|
|
@ -22,19 +22,23 @@ import io.bitsquare.gui.common.view.InitializableView;
|
||||||
import io.bitsquare.gui.common.view.Wizard;
|
import io.bitsquare.gui.common.view.Wizard;
|
||||||
import io.bitsquare.gui.main.help.Help;
|
import io.bitsquare.gui.main.help.Help;
|
||||||
import io.bitsquare.gui.main.help.HelpId;
|
import io.bitsquare.gui.main.help.HelpId;
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.control.PasswordField;
|
||||||
|
import javafx.scene.layout.GridPane;
|
||||||
|
import javafx.scene.layout.HBox;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import javafx.fxml.FXML;
|
|
||||||
import javafx.scene.control.*;
|
|
||||||
import javafx.scene.layout.*;
|
|
||||||
|
|
||||||
@FxmlView
|
@FxmlView
|
||||||
public class ChangePasswordView extends InitializableView<GridPane, ChangePasswordViewModel> implements Wizard.Step {
|
public class ChangePasswordView extends InitializableView<GridPane, ChangePasswordViewModel> implements Wizard.Step {
|
||||||
|
|
||||||
@FXML HBox buttonsHBox;
|
@FXML
|
||||||
@FXML Button saveButton, skipButton;
|
HBox buttonsHBox;
|
||||||
@FXML PasswordField oldPasswordField, passwordField, repeatedPasswordField;
|
@FXML
|
||||||
|
Button saveButton, skipButton;
|
||||||
|
@FXML
|
||||||
|
PasswordField oldPasswordField, passwordField, repeatedPasswordField;
|
||||||
|
|
||||||
private Wizard wizard;
|
private Wizard wizard;
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,10 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.main.account.content.changepassword;
|
package io.bitsquare.gui.main.account.content.changepassword;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import io.bitsquare.gui.common.model.ViewModel;
|
import io.bitsquare.gui.common.model.ViewModel;
|
||||||
import io.bitsquare.gui.util.validation.InputValidator;
|
import io.bitsquare.gui.util.validation.InputValidator;
|
||||||
import io.bitsquare.gui.util.validation.PasswordValidator;
|
import io.bitsquare.gui.util.validation.PasswordValidator;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
|
||||||
|
|
||||||
import javafx.beans.property.BooleanProperty;
|
import javafx.beans.property.BooleanProperty;
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
|
@ -74,12 +72,10 @@ class ChangePasswordViewModel implements ViewModel {
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
errorMessage = "The 2 passwords does not match.";
|
errorMessage = "The 2 passwords does not match.";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
errorMessage = result.errorMessage;
|
errorMessage = result.errorMessage;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
errorMessage = result.errorMessage;
|
errorMessage = result.errorMessage;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -38,8 +38,10 @@ import javax.inject.Inject;
|
||||||
@FxmlView
|
@FxmlView
|
||||||
public class AccountSetupWizard extends ActivatableView implements Wizard {
|
public class AccountSetupWizard extends ActivatableView implements Wizard {
|
||||||
|
|
||||||
@FXML VBox leftVBox;
|
@FXML
|
||||||
@FXML AnchorPane content;
|
VBox leftVBox;
|
||||||
|
@FXML
|
||||||
|
AnchorPane content;
|
||||||
|
|
||||||
private WizardItem seedWords, password, fiatAccount, restrictions;
|
private WizardItem seedWords, password, fiatAccount, restrictions;
|
||||||
private Navigation.Listener listener;
|
private Navigation.Listener listener;
|
||||||
|
@ -63,8 +65,7 @@ public class AccountSetupWizard extends ActivatableView implements Wizard {
|
||||||
|
|
||||||
if (viewClass == SeedWordsView.class) {
|
if (viewClass == SeedWordsView.class) {
|
||||||
seedWords.show();
|
seedWords.show();
|
||||||
}
|
} else if (viewClass == PasswordView.class) {
|
||||||
else if (viewClass == PasswordView.class) {
|
|
||||||
seedWords.onCompleted();
|
seedWords.onCompleted();
|
||||||
password.show();
|
password.show();
|
||||||
} else if (viewClass == ArbitratorSelectionView.class) {
|
} else if (viewClass == ArbitratorSelectionView.class) {
|
||||||
|
@ -107,8 +108,7 @@ public class AccountSetupWizard extends ActivatableView implements Wizard {
|
||||||
if (currentStep instanceof SeedWordsView) {
|
if (currentStep instanceof SeedWordsView) {
|
||||||
seedWords.onCompleted();
|
seedWords.onCompleted();
|
||||||
password.show();
|
password.show();
|
||||||
}
|
} else if (currentStep instanceof PasswordView) {
|
||||||
else if (currentStep instanceof PasswordView) {
|
|
||||||
password.onCompleted();
|
password.onCompleted();
|
||||||
restrictions.show();
|
restrictions.show();
|
||||||
} else if (currentStep instanceof ArbitratorSelectionView) {
|
} else if (currentStep instanceof ArbitratorSelectionView) {
|
||||||
|
|
|
@ -38,7 +38,8 @@ import javax.inject.Inject;
|
||||||
@FxmlView
|
@FxmlView
|
||||||
public class FundsView extends ActivatableViewAndModel<TabPane, Activatable> {
|
public class FundsView extends ActivatableViewAndModel<TabPane, Activatable> {
|
||||||
|
|
||||||
@FXML Tab reservedTab, withdrawalTab, transactionsTab;
|
@FXML
|
||||||
|
Tab reservedTab, withdrawalTab, transactionsTab;
|
||||||
|
|
||||||
private Navigation.Listener navigationListener;
|
private Navigation.Listener navigationListener;
|
||||||
private ChangeListener<Tab> tabChangeListener;
|
private ChangeListener<Tab> tabChangeListener;
|
||||||
|
|
|
@ -47,7 +47,8 @@ import java.util.stream.Stream;
|
||||||
|
|
||||||
@FxmlView
|
@FxmlView
|
||||||
public class ReservedView extends ActivatableView<VBox, Void> {
|
public class ReservedView extends ActivatableView<VBox, Void> {
|
||||||
@FXML TableView<ReservedListItem> table;
|
@FXML
|
||||||
|
TableView<ReservedListItem> table;
|
||||||
@FXML
|
@FXML
|
||||||
TableColumn<ReservedListItem, ReservedListItem> labelColumn, addressColumn, balanceColumn, confidenceColumn;
|
TableColumn<ReservedListItem, ReservedListItem> labelColumn, addressColumn, balanceColumn, confidenceColumn;
|
||||||
|
|
||||||
|
@ -154,8 +155,7 @@ public class ReservedView extends ActivatableView<VBox, Void> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
setGraphic(hyperlink);
|
setGraphic(hyperlink);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
setGraphic(null);
|
setGraphic(null);
|
||||||
setId(null);
|
setId(null);
|
||||||
}
|
}
|
||||||
|
@ -233,8 +233,7 @@ public class ReservedView extends ActivatableView<VBox, Void> {
|
||||||
|
|
||||||
if (item != null && !empty) {
|
if (item != null && !empty) {
|
||||||
setGraphic(item.getProgressIndicator());
|
setGraphic(item.getProgressIndicator());
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
setGraphic(null);
|
setGraphic(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<?import javafx.scene.control.*?>
|
<?import javafx.scene.control.TabPane?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
<TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.offer.BuyOfferView"
|
<TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.offer.BuyOfferView"
|
||||||
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
|
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
|
||||||
AnchorPane.topAnchor="0.0"
|
AnchorPane.topAnchor="0.0"
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<?import javafx.scene.control.*?>
|
<?import javafx.scene.control.TabPane?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
<TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.offer.SellOfferView"
|
<TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.offer.SellOfferView"
|
||||||
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
|
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
|
||||||
AnchorPane.topAnchor="0.0"
|
AnchorPane.topAnchor="0.0"
|
||||||
|
|
|
@ -38,7 +38,8 @@ import javax.inject.Inject;
|
||||||
@FxmlView
|
@FxmlView
|
||||||
public class PortfolioView extends ActivatableViewAndModel<TabPane, Activatable> {
|
public class PortfolioView extends ActivatableViewAndModel<TabPane, Activatable> {
|
||||||
|
|
||||||
@FXML Tab openOffersTab, pendingTradesTab, closedTradesTab;
|
@FXML
|
||||||
|
Tab openOffersTab, pendingTradesTab, closedTradesTab;
|
||||||
private final Tab failedTradesTab = new Tab("Failed");
|
private final Tab failedTradesTab = new Tab("Failed");
|
||||||
private Tab currentTab;
|
private Tab currentTab;
|
||||||
private Navigation.Listener navigationListener;
|
private Navigation.Listener navigationListener;
|
||||||
|
|
|
@ -100,8 +100,7 @@ public class ClosedTradesView extends ActivatableViewAndModel<VBox, ClosedTrades
|
||||||
offerDetailsPopup.show(tradable.getOffer());
|
offerDetailsPopup.show(tradable.getOffer());
|
||||||
});
|
});
|
||||||
setGraphic(hyperlink);
|
setGraphic(hyperlink);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
setGraphic(null);
|
setGraphic(null);
|
||||||
setId(null);
|
setId(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,8 +91,7 @@ class ClosedTradesViewModel extends ActivatableWithDataModel<ClosedTradesDataMod
|
||||||
log.error("That must not happen. We got a pending state but we are in the closed trades list.");
|
log.error("That must not happen. We got a pending state but we are in the closed trades list.");
|
||||||
return trade.getState().toString();
|
return trade.getState().toString();
|
||||||
}
|
}
|
||||||
}
|
} else if (item.getTradable() instanceof OpenOffer) {
|
||||||
else if (item.getTradable() instanceof OpenOffer) {
|
|
||||||
OpenOffer.State state = ((OpenOffer) item.getTradable()).getState();
|
OpenOffer.State state = ((OpenOffer) item.getTradable()).getState();
|
||||||
log.trace("OpenOffer state {}", state);
|
log.trace("OpenOffer state {}", state);
|
||||||
switch (state) {
|
switch (state) {
|
||||||
|
|
|
@ -32,8 +32,10 @@ import javax.inject.Inject;
|
||||||
@FxmlView
|
@FxmlView
|
||||||
public class FailedTradesView extends ActivatableViewAndModel<VBox, FailedTradesViewModel> {
|
public class FailedTradesView extends ActivatableViewAndModel<VBox, FailedTradesViewModel> {
|
||||||
|
|
||||||
@FXML TableView<FailedTradesListItem> table;
|
@FXML
|
||||||
@FXML TableColumn<FailedTradesListItem, FailedTradesListItem> priceColumn, amountColumn, volumeColumn,
|
TableView<FailedTradesListItem> table;
|
||||||
|
@FXML
|
||||||
|
TableColumn<FailedTradesListItem, FailedTradesListItem> priceColumn, amountColumn, volumeColumn,
|
||||||
directionColumn, dateColumn, tradeIdColumn, stateColumn;
|
directionColumn, dateColumn, tradeIdColumn, stateColumn;
|
||||||
private final TradeDetailsPopup tradeDetailsPopup;
|
private final TradeDetailsPopup tradeDetailsPopup;
|
||||||
|
|
||||||
|
@ -86,8 +88,7 @@ public class FailedTradesView extends ActivatableViewAndModel<VBox, FailedTrades
|
||||||
tradeDetailsPopup.show(trade);
|
tradeDetailsPopup.show(trade);
|
||||||
});
|
});
|
||||||
setGraphic(hyperlink);
|
setGraphic(hyperlink);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
setGraphic(null);
|
setGraphic(null);
|
||||||
setId(null);
|
setId(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,14 +17,13 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.main.portfolio.pendingtrades.steps;
|
package io.bitsquare.gui.main.portfolio.pendingtrades.steps;
|
||||||
|
|
||||||
import io.bitsquare.gui.util.Colors;
|
|
||||||
|
|
||||||
import javafx.geometry.Insets;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.*;
|
|
||||||
|
|
||||||
import de.jensd.fx.fontawesome.AwesomeDude;
|
import de.jensd.fx.fontawesome.AwesomeDude;
|
||||||
import de.jensd.fx.fontawesome.AwesomeIcon;
|
import de.jensd.fx.fontawesome.AwesomeIcon;
|
||||||
|
import io.bitsquare.gui.util.Colors;
|
||||||
|
import javafx.geometry.Insets;
|
||||||
|
import javafx.geometry.Pos;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
|
|
||||||
public class TradeWizardItem extends Button {
|
public class TradeWizardItem extends Button {
|
||||||
public Class<? extends TradeStepDetailsView> getViewClass() {
|
public Class<? extends TradeStepDetailsView> getViewClass() {
|
||||||
|
|
|
@ -18,14 +18,12 @@
|
||||||
package io.bitsquare.gui.util;
|
package io.bitsquare.gui.util;
|
||||||
|
|
||||||
import com.google.common.base.Stopwatch;
|
import com.google.common.base.Stopwatch;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
import javafx.animation.AnimationTimer;
|
import javafx.animation.AnimationTimer;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
public class Profiler {
|
public class Profiler {
|
||||||
private static final Logger log = LoggerFactory.getLogger(Profiler.class);
|
private static final Logger log = LoggerFactory.getLogger(Profiler.class);
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,7 @@ public class OptionalBtcValidator extends BtcValidator {
|
||||||
result = validateIfNotNegative(input)
|
result = validateIfNotNegative(input)
|
||||||
.and(validateIfNotFractionalBtcValue(input))
|
.and(validateIfNotFractionalBtcValue(input))
|
||||||
.and(validateIfNotExceedsMaxBtcValue(input));
|
.and(validateIfNotExceedsMaxBtcValue(input));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// we accept zero input
|
// we accept zero input
|
||||||
return new ValidationResult(true);
|
return new ValidationResult(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,7 @@ public class OptionalFiatValidator extends FiatValidator {
|
||||||
result = validateIfNotNegative(input)
|
result = validateIfNotNegative(input)
|
||||||
.and(validateIfNotExceedsMinFiatValue(input))
|
.and(validateIfNotExceedsMinFiatValue(input))
|
||||||
.and(validateIfNotExceedsMaxFiatValue(input));
|
.and(validateIfNotExceedsMaxFiatValue(input));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// we accept zero input
|
// we accept zero input
|
||||||
return new ValidationResult(true);
|
return new ValidationResult(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
package io.bitsquare.app;
|
package io.bitsquare.app;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.springframework.core.env.ConfigurableEnvironment;
|
import org.springframework.core.env.ConfigurableEnvironment;
|
||||||
import org.springframework.core.env.MutablePropertySources;
|
import org.springframework.core.env.MutablePropertySources;
|
||||||
import org.springframework.core.env.PropertySource;
|
import org.springframework.core.env.PropertySource;
|
||||||
|
@ -26,7 +25,7 @@ import org.springframework.mock.env.MockPropertySource;
|
||||||
|
|
||||||
import static io.bitsquare.app.BitsquareEnvironment.*;
|
import static io.bitsquare.app.BitsquareEnvironment.*;
|
||||||
import static org.hamcrest.CoreMatchers.equalTo;
|
import static org.hamcrest.CoreMatchers.equalTo;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertThat;
|
||||||
import static org.springframework.core.env.PropertySource.named;
|
import static org.springframework.core.env.PropertySource.named;
|
||||||
import static org.springframework.core.env.StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME;
|
import static org.springframework.core.env.StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME;
|
||||||
import static org.springframework.core.env.StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME;
|
import static org.springframework.core.env.StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
~ You should have received a copy of the GNU Affero General Public License
|
~ You should have received a copy of the GNU Affero General Public License
|
||||||
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
<AnchorPane xmlns:fx="http://javafx.com/fxml">
|
<AnchorPane xmlns:fx="http://javafx.com/fxml">
|
||||||
|
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
<AnchorPane fx:id="root" fx:controller="io.bitsquare.common.fxml.FxmlViewLoaderTests$MissingFxmlViewAnnotation"
|
<AnchorPane fx:id="root" fx:controller="io.bitsquare.common.fxml.FxmlViewLoaderTests$MissingFxmlViewAnnotation"
|
||||||
xmlns:fx="http://javafx.com/fxml">
|
xmlns:fx="http://javafx.com/fxml">
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
<AnchorPane fx:id="root" fx:controller="io.bitsquare.common.fxml.FxmlViewLoaderTests$WellFormed"
|
<AnchorPane fx:id="root" fx:controller="io.bitsquare.common.fxml.FxmlViewLoaderTests$WellFormed"
|
||||||
xmlns:fx="http://javafx.com/fxml">
|
xmlns:fx="http://javafx.com/fxml">
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
|
|
|
@ -19,24 +19,18 @@ package io.bitsquare.common.fxml;
|
||||||
|
|
||||||
import io.bitsquare.gui.common.ViewfxException;
|
import io.bitsquare.gui.common.ViewfxException;
|
||||||
import io.bitsquare.gui.common.fxml.FxmlViewLoader;
|
import io.bitsquare.gui.common.fxml.FxmlViewLoader;
|
||||||
import io.bitsquare.gui.common.view.AbstractView;
|
import io.bitsquare.gui.common.view.*;
|
||||||
import io.bitsquare.gui.common.view.FxmlView;
|
|
||||||
import io.bitsquare.gui.common.view.View;
|
|
||||||
import io.bitsquare.gui.common.view.ViewFactory;
|
|
||||||
import io.bitsquare.gui.common.view.ViewLoader;
|
|
||||||
|
|
||||||
import java.util.ResourceBundle;
|
|
||||||
|
|
||||||
import javafx.fxml.LoadException;
|
import javafx.fxml.LoadException;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.rules.ExpectedException;
|
import org.junit.rules.ExpectedException;
|
||||||
|
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertThat;
|
||||||
import static org.mockito.BDDMockito.given;
|
import static org.mockito.BDDMockito.given;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,11 @@ package io.bitsquare.common.support;
|
||||||
import io.bitsquare.gui.common.view.AbstractView;
|
import io.bitsquare.gui.common.view.AbstractView;
|
||||||
import io.bitsquare.gui.common.view.CachingViewLoader;
|
import io.bitsquare.gui.common.view.CachingViewLoader;
|
||||||
import io.bitsquare.gui.common.view.ViewLoader;
|
import io.bitsquare.gui.common.view.ViewLoader;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.mockito.BDDMockito.then;
|
import static org.mockito.BDDMockito.then;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.times;
|
||||||
|
|
||||||
public class CachingViewLoaderTests {
|
public class CachingViewLoaderTests {
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ public class FileUtilities {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes both input and output streams when done.
|
* Closes both input and output streams when done.
|
||||||
|
*
|
||||||
* @param in Stream to read from
|
* @param in Stream to read from
|
||||||
* @param out Stream to write to
|
* @param out Stream to write to
|
||||||
* @throws java.io.IOException - If close on input or output fails
|
* @throws java.io.IOException - If close on input or output fails
|
||||||
|
@ -39,6 +40,7 @@ public class FileUtilities {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Won't close the input stream when it's done, needed to handle ZipInputStreams
|
* Won't close the input stream when it's done, needed to handle ZipInputStreams
|
||||||
|
*
|
||||||
* @param in Won't be closed
|
* @param in Won't be closed
|
||||||
* @param out Will be closed
|
* @param out Will be closed
|
||||||
* @throws java.io.IOException - If close on output fails
|
* @throws java.io.IOException - If close on output fails
|
||||||
|
@ -84,6 +86,7 @@ public class FileUtilities {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads the input stream, deletes fileToWriteTo if it exists and over writes it with the stream.
|
* Reads the input stream, deletes fileToWriteTo if it exists and over writes it with the stream.
|
||||||
|
*
|
||||||
* @param readFrom Stream to read from
|
* @param readFrom Stream to read from
|
||||||
* @param fileToWriteTo File to write to
|
* @param fileToWriteTo File to write to
|
||||||
* @throws java.io.IOException - If any of the file operations fail
|
* @throws java.io.IOException - If any of the file operations fail
|
||||||
|
@ -110,6 +113,7 @@ public class FileUtilities {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This has to exist somewhere! Why isn't it a part of the standard Java library?
|
* This has to exist somewhere! Why isn't it a part of the standard Java library?
|
||||||
|
*
|
||||||
* @param destinationDirectory Directory files are to be extracted to
|
* @param destinationDirectory Directory files are to be extracted to
|
||||||
* @param zipFileInputStream Stream to unzip
|
* @param zipFileInputStream Stream to unzip
|
||||||
* @throws java.io.IOException - If there are any file errors
|
* @throws java.io.IOException - If there are any file errors
|
||||||
|
|
|
@ -80,8 +80,7 @@ abstract public class OnionProxyContext {
|
||||||
/**
|
/**
|
||||||
* Sets environment variables and working directory needed for Tor
|
* Sets environment variables and working directory needed for Tor
|
||||||
*
|
*
|
||||||
* @param processBuilder
|
* @param processBuilder we will call start on this to run Tor
|
||||||
* we will call start on this to run Tor
|
|
||||||
*/
|
*/
|
||||||
void setEnvironmentArgsAndWorkingDirectoryForStart(ProcessBuilder processBuilder) {
|
void setEnvironmentArgsAndWorkingDirectoryForStart(ProcessBuilder processBuilder) {
|
||||||
processBuilder.directory(getWorkingDirectory());
|
processBuilder.directory(getWorkingDirectory());
|
||||||
|
|
|
@ -50,11 +50,11 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||||
* Note that you will most likely need to actually call into the
|
* Note that you will most likely need to actually call into the
|
||||||
* AndroidOnionProxyManager or JavaOnionProxyManager in order to create the
|
* AndroidOnionProxyManager or JavaOnionProxyManager in order to create the
|
||||||
* right bindings for your environment.
|
* right bindings for your environment.
|
||||||
* <p/>
|
* <p>
|
||||||
* This class is thread safe but that's mostly because we hit everything over
|
* This class is thread safe but that's mostly because we hit everything over
|
||||||
* the head with 'synchronized'. Given the way this class is used there
|
* the head with 'synchronized'. Given the way this class is used there
|
||||||
* shouldn't be any performance implications of this.
|
* shouldn't be any performance implications of this.
|
||||||
* <p/>
|
* <p>
|
||||||
* This class began life as TorPlugin from the Briar Project
|
* This class began life as TorPlugin from the Briar Project
|
||||||
*/
|
*/
|
||||||
public abstract class OnionProxyManager {
|
public abstract class OnionProxyManager {
|
||||||
|
@ -98,17 +98,13 @@ public abstract class OnionProxyManager {
|
||||||
* given time for bootstrap to finish and if it doesn't then will restart
|
* given time for bootstrap to finish and if it doesn't then will restart
|
||||||
* the bootstrap process the given number of repeats.
|
* the bootstrap process the given number of repeats.
|
||||||
*
|
*
|
||||||
* @param secondsBeforeTimeOut
|
* @param secondsBeforeTimeOut Seconds to wait for boot strapping to finish
|
||||||
* Seconds to wait for boot strapping to finish
|
* @param numberOfRetries Number of times to try recycling the Tor OP before giving up
|
||||||
* @param numberOfRetries
|
|
||||||
* Number of times to try recycling the Tor OP before giving up
|
|
||||||
* on bootstrapping working
|
* on bootstrapping working
|
||||||
* @return True if bootstrap succeeded, false if there is a problem or the
|
* @return True if bootstrap succeeded, false if there is a problem or the
|
||||||
* bootstrap couldn't complete in the given time.
|
* bootstrap couldn't complete in the given time.
|
||||||
* @throws java.lang.InterruptedException
|
* @throws java.lang.InterruptedException - You know, if we are interrupted
|
||||||
* - You know, if we are interrupted
|
* @throws java.io.IOException - IO Exceptions
|
||||||
* @throws java.io.IOException
|
|
||||||
* - IO Exceptions
|
|
||||||
*/
|
*/
|
||||||
public synchronized boolean startWithRepeat(int secondsBeforeTimeOut, int numberOfRetries)
|
public synchronized boolean startWithRepeat(int secondsBeforeTimeOut, int numberOfRetries)
|
||||||
throws InterruptedException, IOException {
|
throws InterruptedException, IOException {
|
||||||
|
@ -165,8 +161,7 @@ public abstract class OnionProxyManager {
|
||||||
* listening on
|
* listening on
|
||||||
*
|
*
|
||||||
* @return Discovered socks port
|
* @return Discovered socks port
|
||||||
* @throws java.io.IOException
|
* @throws java.io.IOException - File errors
|
||||||
* - File errors
|
|
||||||
*/
|
*/
|
||||||
public synchronized int getIPv4LocalHostSocksPort() throws IOException {
|
public synchronized int getIPv4LocalHostSocksPort() throws IOException {
|
||||||
if (isRunning() == false) {
|
if (isRunning() == false) {
|
||||||
|
@ -191,14 +186,11 @@ public abstract class OnionProxyManager {
|
||||||
/**
|
/**
|
||||||
* Publishes a hidden service
|
* Publishes a hidden service
|
||||||
*
|
*
|
||||||
* @param hiddenServicePort
|
* @param hiddenServicePort The port that the hidden service will accept connections on
|
||||||
* The port that the hidden service will accept connections on
|
* @param localPort The local port that the hidden service will relay connections
|
||||||
* @param localPort
|
|
||||||
* The local port that the hidden service will relay connections
|
|
||||||
* to
|
* to
|
||||||
* @return The hidden service's onion address in the form X.onion.
|
* @return The hidden service's onion address in the form X.onion.
|
||||||
* @throws java.io.IOException
|
* @throws java.io.IOException - File errors
|
||||||
* - File errors
|
|
||||||
*/
|
*/
|
||||||
public synchronized String publishHiddenService(int hiddenServicePort, int localPort) throws IOException {
|
public synchronized String publishHiddenService(int hiddenServicePort, int localPort) throws IOException {
|
||||||
if (controlConnection == null) {
|
if (controlConnection == null) {
|
||||||
|
@ -283,8 +275,7 @@ public abstract class OnionProxyManager {
|
||||||
* going to work until you either call startWithRepeat or
|
* going to work until you either call startWithRepeat or
|
||||||
* installAndStartTorOp
|
* installAndStartTorOp
|
||||||
*
|
*
|
||||||
* @throws java.io.IOException
|
* @throws java.io.IOException - File errors
|
||||||
* - File errors
|
|
||||||
*/
|
*/
|
||||||
public synchronized void stop() throws IOException {
|
public synchronized void stop() throws IOException {
|
||||||
try {
|
try {
|
||||||
|
@ -308,8 +299,7 @@ public abstract class OnionProxyManager {
|
||||||
* to network connections.
|
* to network connections.
|
||||||
*
|
*
|
||||||
* @return True if running
|
* @return True if running
|
||||||
* @throws java.io.IOException
|
* @throws java.io.IOException - IO exceptions
|
||||||
* - IO exceptions
|
|
||||||
*/
|
*/
|
||||||
public synchronized boolean isRunning() throws IOException {
|
public synchronized boolean isRunning() throws IOException {
|
||||||
return isBootstrapped() && isNetworkEnabled();
|
return isBootstrapped() && isNetworkEnabled();
|
||||||
|
@ -318,11 +308,9 @@ public abstract class OnionProxyManager {
|
||||||
/**
|
/**
|
||||||
* Tells the Tor OP if it should accept network connections
|
* Tells the Tor OP if it should accept network connections
|
||||||
*
|
*
|
||||||
* @param enable
|
* @param enable If true then the Tor OP will accept SOCKS connections,
|
||||||
* If true then the Tor OP will accept SOCKS connections,
|
|
||||||
* otherwise not.
|
* otherwise not.
|
||||||
* @throws java.io.IOException
|
* @throws java.io.IOException - IO exceptions
|
||||||
* - IO exceptions
|
|
||||||
*/
|
*/
|
||||||
public synchronized void enableNetwork(boolean enable) throws IOException {
|
public synchronized void enableNetwork(boolean enable) throws IOException {
|
||||||
if (controlConnection == null) {
|
if (controlConnection == null) {
|
||||||
|
@ -337,8 +325,7 @@ public abstract class OnionProxyManager {
|
||||||
*
|
*
|
||||||
* @return True if network is enabled (that doesn't mean that the device is
|
* @return True if network is enabled (that doesn't mean that the device is
|
||||||
* online, only that the Tor OP is trying to connect to the network)
|
* online, only that the Tor OP is trying to connect to the network)
|
||||||
* @throws java.io.IOException
|
* @throws java.io.IOException - IO exceptions
|
||||||
* - IO exceptions
|
|
||||||
*/
|
*/
|
||||||
public synchronized boolean isNetworkEnabled() throws IOException {
|
public synchronized boolean isNetworkEnabled() throws IOException {
|
||||||
if (controlConnection == null) {
|
if (controlConnection == null) {
|
||||||
|
@ -391,10 +378,8 @@ public abstract class OnionProxyManager {
|
||||||
* to actually connect it to the network.
|
* to actually connect it to the network.
|
||||||
*
|
*
|
||||||
* @return True if all files installed and Tor OP successfully started
|
* @return True if all files installed and Tor OP successfully started
|
||||||
* @throws java.io.IOException
|
* @throws java.io.IOException - IO Exceptions
|
||||||
* - IO Exceptions
|
* @throws java.lang.InterruptedException - If we are, well, interrupted
|
||||||
* @throws java.lang.InterruptedException
|
|
||||||
* - If we are, well, interrupted
|
|
||||||
*/
|
*/
|
||||||
public synchronized boolean installAndStartTorOp() throws IOException, InterruptedException {
|
public synchronized boolean installAndStartTorOp() throws IOException, InterruptedException {
|
||||||
// The Tor OP will die if it looses the connection to its socket so if
|
// The Tor OP will die if it looses the connection to its socket so if
|
||||||
|
@ -598,8 +583,7 @@ public abstract class OnionProxyManager {
|
||||||
/**
|
/**
|
||||||
* Alas old versions of Android do not support setExecutable.
|
* Alas old versions of Android do not support setExecutable.
|
||||||
*
|
*
|
||||||
* @param f
|
* @param f File to make executable
|
||||||
* File to make executable
|
|
||||||
* @return True if it worked, otherwise false.
|
* @return True if it worked, otherwise false.
|
||||||
*/
|
*/
|
||||||
protected abstract boolean setExecutable(File f);
|
protected abstract boolean setExecutable(File f);
|
||||||
|
|
|
@ -34,6 +34,7 @@ import java.util.Scanner;
|
||||||
|
|
||||||
public class OsData {
|
public class OsData {
|
||||||
public enum OsType {Windows, Linux32, Linux64, Mac, Android}
|
public enum OsType {Windows, Linux32, Linux64, Mac, Android}
|
||||||
|
|
||||||
private static OsType detectedType = null;
|
private static OsType detectedType = null;
|
||||||
|
|
||||||
public static OsType getOsType() {
|
public static OsType getOsType() {
|
||||||
|
|
|
@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
public interface WriteObserver {
|
public interface WriteObserver {
|
||||||
/**
|
/**
|
||||||
* Waits timeout of unit to see if file is modified
|
* Waits timeout of unit to see if file is modified
|
||||||
|
*
|
||||||
* @param timeout How long to wait before returning
|
* @param timeout How long to wait before returning
|
||||||
* @param unit Unit to wait in
|
* @param unit Unit to wait in
|
||||||
* @return True if file was modified, false if it was not
|
* @return True if file was modified, false if it was not
|
||||||
|
|
|
@ -44,6 +44,7 @@ public class P2PServiceTest {
|
||||||
private P2PService p2PService1, p2PService2, p2PService3;
|
private P2PService p2PService1, p2PService2, p2PService3;
|
||||||
private SeedNode seedNode1, seedNode2, seedNode3;
|
private SeedNode seedNode1, seedNode2, seedNode3;
|
||||||
private File dir1, dir2, dir3;
|
private File dir1, dir2, dir3;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() throws InterruptedException, CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException, CryptoException {
|
public void setup() throws InterruptedException, CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException, CryptoException {
|
||||||
Security.addProvider(new BouncyCastleProvider());
|
Security.addProvider(new BouncyCastleProvider());
|
||||||
|
|
|
@ -40,7 +40,8 @@
|
||||||
<!-- broken with Java 8 (MSHADE-174), using ProGuard instead. -->
|
<!-- broken with Java 8 (MSHADE-174), using ProGuard instead. -->
|
||||||
<minimizeJar>false</minimizeJar>
|
<minimizeJar>false</minimizeJar>
|
||||||
<transformers>
|
<transformers>
|
||||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
<transformer
|
||||||
|
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||||
<mainClass>io.bitsquare.p2p.seed.SeedNodeMain</mainClass>
|
<mainClass>io.bitsquare.p2p.seed.SeedNodeMain</mainClass>
|
||||||
</transformer>
|
</transformer>
|
||||||
</transformers>
|
</transformers>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue