mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-03 20:24:24 -04:00
Removed javafx Platform dependencies from core
This commit is contained in:
parent
7d4b30e8db
commit
7e6098bdaf
115 changed files with 332 additions and 305 deletions
|
@ -22,7 +22,7 @@
|
|||
<parent>
|
||||
<artifactId>parent</artifactId>
|
||||
<groupId>io.bitsquare</groupId>
|
||||
<version>0.1.3-SNAPSHOT</version>
|
||||
<version>0.1.4-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
547
gui/src/main/java/eu/hansolo/enzo/notification/Notification.java
Normal file
547
gui/src/main/java/eu/hansolo/enzo/notification/Notification.java
Normal file
|
@ -0,0 +1,547 @@
|
|||
/*
|
||||
* Copyright (c) 2013 by Gerrit Grunwald
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package eu.hansolo.enzo.notification;
|
||||
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import javafx.animation.KeyFrame;
|
||||
import javafx.animation.KeyValue;
|
||||
import javafx.animation.Timeline;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.property.ObjectProperty;
|
||||
import javafx.beans.property.ObjectPropertyBase;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.event.EventType;
|
||||
import javafx.event.WeakEventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.image.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Screen;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.StageStyle;
|
||||
import javafx.util.Duration;
|
||||
|
||||
import org.controlsfx.control.PopOver;
|
||||
|
||||
|
||||
/**
|
||||
* A copy of the original {@link eu.hansolo.enzo.notification.Notification} class at revision eb1d321, containing
|
||||
* several changes that were otherwise not possible through subclassing or other customization via the existing
|
||||
* Notification API. See git history for this file for exact details as to what has been changed. All other
|
||||
* {@code eu.hansolo.enzo.*} types are loaded from the enzo jar (see build.gradle for details).
|
||||
*/
|
||||
public class Notification {
|
||||
public static final Image INFO_ICON = new Image(Notifier.class.getResourceAsStream("info.png"));
|
||||
public static final Image WARNING_ICON = new Image(Notifier.class.getResourceAsStream("warning.png"));
|
||||
public static final Image SUCCESS_ICON = new Image(Notifier.class.getResourceAsStream("success.png"));
|
||||
public static final Image ERROR_ICON = new Image(Notifier.class.getResourceAsStream("error.png"));
|
||||
public final String TITLE;
|
||||
public final String MESSAGE;
|
||||
public final Image IMAGE;
|
||||
|
||||
|
||||
// ******************** Constructors **************************************
|
||||
public Notification(final String TITLE, final String MESSAGE) {
|
||||
this(TITLE, MESSAGE, null);
|
||||
}
|
||||
|
||||
public Notification(final String MESSAGE, final Image IMAGE) {
|
||||
this("", MESSAGE, IMAGE);
|
||||
}
|
||||
|
||||
public Notification(final String TITLE, final String MESSAGE, final Image IMAGE) {
|
||||
this.TITLE = TITLE;
|
||||
this.MESSAGE = MESSAGE;
|
||||
this.IMAGE = IMAGE;
|
||||
}
|
||||
|
||||
|
||||
// ******************** Inner Classes *************************************
|
||||
public enum Notifier {
|
||||
INSTANCE;
|
||||
|
||||
private static final double ICON_WIDTH = 24;
|
||||
private static final double ICON_HEIGHT = 24;
|
||||
private static double width = 321;
|
||||
private static double height = 49;
|
||||
private static double offsetX = 0;
|
||||
private static double offsetY = 2;
|
||||
private static double spacingY = 5;
|
||||
private static Pos popupLocation = Pos.TOP_RIGHT;
|
||||
private static Stage stageRef = null;
|
||||
private Duration popupLifetime;
|
||||
private Duration popupAnimationTime;
|
||||
private Stage stage;
|
||||
private Scene scene;
|
||||
private ObservableList<PopOver> popups;
|
||||
|
||||
|
||||
// ******************** Constructor ***************************************
|
||||
Notifier() {
|
||||
init();
|
||||
initGraphics();
|
||||
}
|
||||
|
||||
|
||||
// ******************** Initialization ************************************
|
||||
private void init() {
|
||||
popupLifetime = Duration.millis(5000);
|
||||
popupAnimationTime = Duration.millis(500);
|
||||
popups = FXCollections.observableArrayList();
|
||||
}
|
||||
|
||||
private void initGraphics() {
|
||||
scene = new Scene(new Region());
|
||||
scene.setFill(null);
|
||||
scene.getStylesheets().setAll(
|
||||
getClass().getResource("/io/bitsquare/gui/bitsquare.css").toExternalForm(),
|
||||
getClass().getResource("/io/bitsquare/gui/images.css").toExternalForm());
|
||||
|
||||
stage = new Stage();
|
||||
stage.initStyle(StageStyle.TRANSPARENT);
|
||||
}
|
||||
|
||||
|
||||
// ******************** Methods *******************************************
|
||||
|
||||
/**
|
||||
* @param STAGE_REF The Notification will be positioned relative to the given Stage.<br>
|
||||
* If null then the Notification will be positioned relative to the primary Screen.
|
||||
* @param POPUP_LOCATION The default is TOP_RIGHT of primary Screen.
|
||||
*/
|
||||
public static void setPopupLocation(final Stage STAGE_REF, final Pos POPUP_LOCATION) {
|
||||
if (null != STAGE_REF) {
|
||||
INSTANCE.stage.initOwner(STAGE_REF);
|
||||
Notifier.stageRef = STAGE_REF;
|
||||
}
|
||||
Notifier.popupLocation = POPUP_LOCATION;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Notification's owner stage so that when the owner
|
||||
* stage is closed Notifications will be shut down as well.<br>
|
||||
* This is only needed if <code>setPopupLocation</code> is called
|
||||
* <u>without</u> a stage reference.
|
||||
*
|
||||
* @param OWNER
|
||||
*/
|
||||
public static void setNotificationOwner(final Stage OWNER) {
|
||||
INSTANCE.stage.initOwner(OWNER);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OFFSET_X The horizontal shift required.
|
||||
* <br> The default is 0 px.
|
||||
*/
|
||||
public static void setOffsetX(final double OFFSET_X) {
|
||||
Notifier.offsetX = OFFSET_X;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OFFSET_Y The vertical shift required.
|
||||
* <br> The default is 25 px.
|
||||
*/
|
||||
public static void setOffsetY(final double OFFSET_Y) {
|
||||
Notifier.offsetY = OFFSET_Y;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param WIDTH The default is 300 px.
|
||||
*/
|
||||
public static void setWidth(final double WIDTH) {
|
||||
Notifier.width = WIDTH;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param HEIGHT The default is 80 px.
|
||||
*/
|
||||
public static void setHeight(final double HEIGHT) {
|
||||
Notifier.height = HEIGHT;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SPACING_Y The spacing between multiple Notifications.
|
||||
* <br> The default is 5 px.
|
||||
*/
|
||||
public static void setSpacingY(final double SPACING_Y) {
|
||||
Notifier.spacingY = SPACING_Y;
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
popups.clear();
|
||||
stage.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Duration that the notification will stay on screen before it
|
||||
* will fade out. The default is 5000 ms
|
||||
*
|
||||
* @return the Duration the popup notification will stay on screen
|
||||
*/
|
||||
public Duration getPopupLifetime() {
|
||||
return popupLifetime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the Duration that the popup notification will stay on screen before it
|
||||
* will fade out. The parameter is limited to values between 2 and 20 seconds.
|
||||
*
|
||||
* @param POPUP_LIFETIME
|
||||
*/
|
||||
public void setPopupLifetime(final Duration POPUP_LIFETIME) {
|
||||
popupLifetime = Duration.millis(clamp(2000, 20000, POPUP_LIFETIME.toMillis()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Duration that it takes to fade out the notification
|
||||
* The parameter is limited to values between 0 and 1000 ms
|
||||
*
|
||||
* @return the Duration that it takes to fade out the notification
|
||||
*/
|
||||
public Duration getPopupAnimationTime() {
|
||||
return popupAnimationTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the Duration that it takes to fade out the notification
|
||||
* The parameter is limited to values between 0 and 1000 ms
|
||||
* Default value is 500 ms
|
||||
*
|
||||
* @param POPUP_ANIMATION_TIME
|
||||
*/
|
||||
public void setPopupAnimationTime(final Duration POPUP_ANIMATION_TIME) {
|
||||
popupAnimationTime = Duration.millis(clamp(0, 1000, POPUP_ANIMATION_TIME.toMillis()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the given Notification on the screen
|
||||
*
|
||||
* @param NOTIFICATION
|
||||
*/
|
||||
public void notify(final Notification NOTIFICATION) {
|
||||
preOrder();
|
||||
showPopup(NOTIFICATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a Notification with the given parameters on the screen
|
||||
*
|
||||
* @param TITLE
|
||||
* @param MESSAGE
|
||||
* @param IMAGE
|
||||
*/
|
||||
public void notify(final String TITLE, final String MESSAGE, final Image IMAGE) {
|
||||
notify(new Notification(TITLE, MESSAGE, IMAGE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a Notification with the given title and message and an Info icon
|
||||
*
|
||||
* @param TITLE
|
||||
* @param MESSAGE
|
||||
*/
|
||||
public void notifyInfo(final String TITLE, final String MESSAGE) {
|
||||
notify(new Notification(TITLE, MESSAGE, Notification.INFO_ICON));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a Notification with the given title and message and a Warning icon
|
||||
*
|
||||
* @param TITLE
|
||||
* @param MESSAGE
|
||||
*/
|
||||
public void notifyWarning(final String TITLE, final String MESSAGE) {
|
||||
notify(new Notification(TITLE, MESSAGE, Notification.WARNING_ICON));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a Notification with the given title and message and a Checkmark icon
|
||||
*
|
||||
* @param TITLE
|
||||
* @param MESSAGE
|
||||
*/
|
||||
public void notifySuccess(final String TITLE, final String MESSAGE) {
|
||||
notify(new Notification(TITLE, MESSAGE, Notification.SUCCESS_ICON));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a Notification with the given title and message and an Error icon
|
||||
*
|
||||
* @param TITLE
|
||||
* @param MESSAGE
|
||||
*/
|
||||
public void notifyError(final String TITLE, final String MESSAGE) {
|
||||
notify(new Notification(TITLE, MESSAGE, Notification.ERROR_ICON));
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes sure that the given VALUE is within the range of MIN to MAX
|
||||
*
|
||||
* @param MIN
|
||||
* @param MAX
|
||||
* @param VALUE
|
||||
* @return
|
||||
*/
|
||||
private double clamp(final double MIN, final double MAX, final double VALUE) {
|
||||
if (VALUE < MIN) return MIN;
|
||||
if (VALUE > MAX) return MAX;
|
||||
return VALUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reorder the popup Notifications on screen so that the latest Notification will stay on top
|
||||
*/
|
||||
private void preOrder() {
|
||||
if (popups.isEmpty()) return;
|
||||
IntStream.range(0, popups.size()).parallel().forEachOrdered(
|
||||
i -> Platform.runLater(() -> {
|
||||
switch (popupLocation) {
|
||||
case TOP_LEFT:
|
||||
case TOP_CENTER:
|
||||
case TOP_RIGHT:
|
||||
popups.get(i).setY(popups.get(i).getY() + height + spacingY);
|
||||
break;
|
||||
|
||||
case BOTTOM_LEFT:
|
||||
case BOTTOM_CENTER:
|
||||
case BOTTOM_RIGHT:
|
||||
popups.get(i).setY(popups.get(i).getY() - height - spacingY);
|
||||
break;
|
||||
|
||||
default:
|
||||
popups.get(i).setY(popups.get(i).getY() - height - spacingY);
|
||||
break;
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and shows a popup with the data from the given Notification object
|
||||
*
|
||||
* @param NOTIFICATION
|
||||
*/
|
||||
private void showPopup(final Notification NOTIFICATION) {
|
||||
ImageView icon = new ImageView(
|
||||
new Image(Notifier.class.getResourceAsStream("/images/notification_logo.png")));
|
||||
icon.relocate(10, 7);
|
||||
|
||||
Label title = new Label(NOTIFICATION.TITLE);
|
||||
title.setStyle(" -fx-text-fill:#333333; -fx-font-size:12; -fx-font-weight:bold;");
|
||||
title.relocate(60, 6);
|
||||
|
||||
Label message = new Label(NOTIFICATION.MESSAGE);
|
||||
message.relocate(60, 25);
|
||||
message.setStyle(" -fx-text-fill:#333333; -fx-font-size:11; ");
|
||||
|
||||
Pane popupLayout = new Pane();
|
||||
popupLayout.setPrefSize(width, height);
|
||||
popupLayout.getChildren().addAll(icon, title, message);
|
||||
|
||||
PopOver popOver = new PopOver(popupLayout);
|
||||
popOver.setDetachable(false);
|
||||
popOver.setArrowSize(0);
|
||||
popOver.setX(getX());
|
||||
popOver.setY(getY());
|
||||
popOver.addEventHandler(MouseEvent.MOUSE_PRESSED, new WeakEventHandler<>(event ->
|
||||
fireNotificationEvent(new NotificationEvent(NOTIFICATION, Notifier.this, popOver,
|
||||
NotificationEvent.NOTIFICATION_PRESSED))
|
||||
));
|
||||
popups.add(popOver);
|
||||
|
||||
// Add a timeline for popup fade out
|
||||
KeyValue fadeOutBegin = new KeyValue(popOver.opacityProperty(), 1.0);
|
||||
KeyValue fadeOutEnd = new KeyValue(popOver.opacityProperty(), 0.0);
|
||||
|
||||
KeyFrame kfBegin = new KeyFrame(Duration.ZERO, fadeOutBegin);
|
||||
KeyFrame kfEnd = new KeyFrame(popupAnimationTime, fadeOutEnd);
|
||||
|
||||
Timeline timeline = new Timeline(kfBegin, kfEnd);
|
||||
timeline.setDelay(popupLifetime);
|
||||
timeline.setOnFinished(actionEvent -> Platform.runLater(() -> {
|
||||
popOver.hide();
|
||||
popups.remove(popOver);
|
||||
fireNotificationEvent(new NotificationEvent(NOTIFICATION, Notifier.this, popOver,
|
||||
NotificationEvent.HIDE_NOTIFICATION));
|
||||
}));
|
||||
|
||||
if (stage.isShowing()) {
|
||||
stage.toFront();
|
||||
}
|
||||
else {
|
||||
stage.show();
|
||||
}
|
||||
|
||||
popOver.show(stage);
|
||||
fireNotificationEvent(new NotificationEvent(NOTIFICATION, Notifier.this, popOver,
|
||||
NotificationEvent.SHOW_NOTIFICATION));
|
||||
timeline.play();
|
||||
}
|
||||
|
||||
private double getX() {
|
||||
if (null == stageRef) return calcX(0.0, Screen.getPrimary().getBounds().getWidth());
|
||||
|
||||
return calcX(stageRef.getX(), stageRef.getWidth());
|
||||
}
|
||||
|
||||
private double getY() {
|
||||
if (null == stageRef) return calcY(0.0, Screen.getPrimary().getBounds().getHeight());
|
||||
return calcY(stageRef.getY(), stageRef.getHeight());
|
||||
}
|
||||
|
||||
private double calcX(final double LEFT, final double TOTAL_WIDTH) {
|
||||
switch (popupLocation) {
|
||||
case TOP_LEFT:
|
||||
case CENTER_LEFT:
|
||||
case BOTTOM_LEFT:
|
||||
return LEFT + offsetX;
|
||||
case TOP_CENTER:
|
||||
case CENTER:
|
||||
case BOTTOM_CENTER:
|
||||
return LEFT + (TOTAL_WIDTH - width) * 0.5 - offsetX;
|
||||
case TOP_RIGHT:
|
||||
case CENTER_RIGHT:
|
||||
case BOTTOM_RIGHT:
|
||||
return LEFT + TOTAL_WIDTH - width - offsetX;
|
||||
default:
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
private double calcY(final double TOP, final double TOTAL_HEIGHT) {
|
||||
switch (popupLocation) {
|
||||
case TOP_LEFT:
|
||||
case TOP_CENTER:
|
||||
case TOP_RIGHT:
|
||||
return TOP + offsetY;
|
||||
case CENTER_LEFT:
|
||||
case CENTER:
|
||||
case CENTER_RIGHT:
|
||||
return TOP + (TOTAL_HEIGHT - height) / 2 - offsetY;
|
||||
case BOTTOM_LEFT:
|
||||
case BOTTOM_CENTER:
|
||||
case BOTTOM_RIGHT:
|
||||
return TOP + TOTAL_HEIGHT - height - offsetY;
|
||||
default:
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ******************** Event handling ********************************
|
||||
public final ObjectProperty<EventHandler<NotificationEvent>> onNotificationPressedProperty() {
|
||||
return onNotificationPressed;
|
||||
}
|
||||
|
||||
public final void setOnNotificationPressed(EventHandler<NotificationEvent> value) {
|
||||
onNotificationPressedProperty().set(value);
|
||||
}
|
||||
|
||||
public final EventHandler<NotificationEvent> getOnNotificationPressed() {
|
||||
return onNotificationPressedProperty().get();
|
||||
}
|
||||
|
||||
private final ObjectProperty<EventHandler<NotificationEvent>> onNotificationPressed = new
|
||||
ObjectPropertyBase<EventHandler<NotificationEvent>>() {
|
||||
@Override
|
||||
public Object getBean() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "onNotificationPressed";
|
||||
}
|
||||
};
|
||||
|
||||
public final ObjectProperty<EventHandler<NotificationEvent>> onShowNotificationProperty() {
|
||||
return onShowNotification;
|
||||
}
|
||||
|
||||
public final void setOnShowNotification(EventHandler<NotificationEvent> value) {
|
||||
onShowNotificationProperty().set(value);
|
||||
}
|
||||
|
||||
public final EventHandler<NotificationEvent> getOnShowNotification() {
|
||||
return onShowNotificationProperty().get();
|
||||
}
|
||||
|
||||
private final ObjectProperty<EventHandler<NotificationEvent>> onShowNotification = new
|
||||
ObjectPropertyBase<EventHandler<NotificationEvent>>() {
|
||||
@Override
|
||||
public Object getBean() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "onShowNotification";
|
||||
}
|
||||
};
|
||||
|
||||
public final ObjectProperty<EventHandler<NotificationEvent>> onHideNotificationProperty() {
|
||||
return onHideNotification;
|
||||
}
|
||||
|
||||
public final void setOnHideNotification(EventHandler<NotificationEvent> value) {
|
||||
onHideNotificationProperty().set(value);
|
||||
}
|
||||
|
||||
public final EventHandler<NotificationEvent> getOnHideNotification() {
|
||||
return onHideNotificationProperty().get();
|
||||
}
|
||||
|
||||
private final ObjectProperty<EventHandler<NotificationEvent>> onHideNotification = new
|
||||
ObjectPropertyBase<EventHandler<NotificationEvent>>() {
|
||||
@Override
|
||||
public Object getBean() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "onHideNotification";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
public void fireNotificationEvent(final NotificationEvent EVENT) {
|
||||
final EventType TYPE = EVENT.getEventType();
|
||||
final EventHandler<NotificationEvent> HANDLER;
|
||||
if (NotificationEvent.NOTIFICATION_PRESSED == TYPE) {
|
||||
HANDLER = getOnNotificationPressed();
|
||||
}
|
||||
else if (NotificationEvent.SHOW_NOTIFICATION == TYPE) {
|
||||
HANDLER = getOnShowNotification();
|
||||
}
|
||||
else if (NotificationEvent.HIDE_NOTIFICATION == TYPE) {
|
||||
HANDLER = getOnHideNotification();
|
||||
}
|
||||
else {
|
||||
HANDLER = null;
|
||||
}
|
||||
if (null == HANDLER) return;
|
||||
HANDLER.handle(EVENT);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -17,11 +17,11 @@
|
|||
|
||||
package io.bitsquare.app;
|
||||
|
||||
import io.bitsquare.common.view.CachingViewLoader;
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.common.view.guice.InjectorViewFactory;
|
||||
import io.bitsquare.gui.SystemTray;
|
||||
import io.bitsquare.gui.common.view.CachingViewLoader;
|
||||
import io.bitsquare.gui.common.view.View;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.common.view.guice.InjectorViewFactory;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.main.MainView;
|
||||
import io.bitsquare.gui.main.debug.DebugView;
|
||||
|
@ -29,6 +29,8 @@ import io.bitsquare.gui.util.ImageUtil;
|
|||
import io.bitsquare.storage.FileManager;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
||||
import org.bitcoinj.utils.Threading;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
|
@ -73,6 +75,8 @@ public class BitsquareApp extends Application {
|
|||
|
||||
log.trace("BitsquareApp.start");
|
||||
try {
|
||||
Threading.USER_THREAD = Platform::runLater;
|
||||
|
||||
bitsquareAppModule = new BitsquareAppModule(env, primaryStage);
|
||||
injector = Guice.createInjector(bitsquareAppModule);
|
||||
injector.getInstance(InjectorViewFactory.class).setInjector(injector);
|
||||
|
|
|
@ -137,7 +137,7 @@ public class BitsquareAppMain extends BitsquareExecutable {
|
|||
.ofType(RegTestHost.class)
|
||||
.withValuesConvertedBy(new EnumValueConverter(RegTestHost.class));
|
||||
|
||||
|
||||
|
||||
parser.accepts(BOOTSTRAP_NODE_NAME_KEY, description("", BootstrapNodes.DEFAULT.getName()))
|
||||
.withRequiredArg();
|
||||
parser.accepts(BOOTSTRAP_NODE_IP_KEY, description("", BootstrapNodes.DEFAULT.getIp()))
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.app;
|
||||
|
||||
import io.bitsquare.util.Utilities;
|
||||
import io.bitsquare.gui.util.GUIUtil;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
|
@ -95,7 +95,7 @@ public class UpdateProcess {
|
|||
log.info("UpdateFX current version " + BUILD_VERSION);
|
||||
|
||||
// process.timeout() will cause an error state back but we don't want to break startup in case of an timeout
|
||||
timeoutTimer = Utilities.setTimeout(10000, animationTimer -> {
|
||||
timeoutTimer = GUIUtil.setTimeout(10000, animationTimer -> {
|
||||
process.onCompleted();
|
||||
return null;
|
||||
});
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
package io.bitsquare.gui;
|
||||
|
||||
import io.bitsquare.BitsquareModule;
|
||||
import io.bitsquare.common.fxml.FxmlViewLoader;
|
||||
import io.bitsquare.common.view.CachingViewLoader;
|
||||
import io.bitsquare.common.view.ViewFactory;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.common.view.guice.InjectorViewFactory;
|
||||
import io.bitsquare.gui.common.fxml.FxmlViewLoader;
|
||||
import io.bitsquare.gui.common.view.CachingViewLoader;
|
||||
import io.bitsquare.gui.common.view.ViewFactory;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.common.view.guice.InjectorViewFactory;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.main.MainView;
|
||||
import io.bitsquare.gui.main.offer.offerbook.OfferBook;
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package io.bitsquare.gui;
|
||||
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewPath;
|
||||
import io.bitsquare.gui.common.view.View;
|
||||
import io.bitsquare.gui.common.view.ViewPath;
|
||||
import io.bitsquare.gui.main.MainView;
|
||||
import io.bitsquare.gui.main.offer.BuyOfferView;
|
||||
import io.bitsquare.storage.Storage;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common;
|
||||
package io.bitsquare.gui.common;
|
||||
|
||||
import static java.lang.String.format;
|
||||
|
|
@ -15,13 +15,13 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.fxml;
|
||||
package io.bitsquare.gui.common.fxml;
|
||||
|
||||
import io.bitsquare.common.ViewfxException;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewFactory;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.common.ViewfxException;
|
||||
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.io.IOException;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.model;
|
||||
package io.bitsquare.gui.common.model;
|
||||
|
||||
public interface Activatable {
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.model;
|
||||
package io.bitsquare.gui.common.model;
|
||||
|
||||
public abstract class ActivatableWithDataModel<D extends Activatable> extends WithDataModel<D> implements Activatable {
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.model;
|
||||
package io.bitsquare.gui.common.model;
|
||||
|
||||
public interface DataModel extends Model {
|
||||
}
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.model;
|
||||
package io.bitsquare.gui.common.model;
|
||||
|
||||
public interface Model {
|
||||
}
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.model;
|
||||
package io.bitsquare.gui.common.model;
|
||||
|
||||
public interface ViewModel extends Model {
|
||||
}
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.model;
|
||||
package io.bitsquare.gui.common.model;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.view;
|
||||
package io.bitsquare.gui.common.view;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.*;
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.view;
|
||||
package io.bitsquare.gui.common.view;
|
||||
|
||||
import javafx.scene.*;
|
||||
|
|
@ -15,9 +15,9 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.view;
|
||||
package io.bitsquare.gui.common.view;
|
||||
|
||||
import io.bitsquare.common.model.Activatable;
|
||||
import io.bitsquare.gui.common.model.Activatable;
|
||||
|
||||
import javafx.scene.*;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.view;
|
||||
package io.bitsquare.gui.common.view;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.view;
|
||||
package io.bitsquare.gui.common.view;
|
||||
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.view;
|
||||
package io.bitsquare.gui.common.view;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.view;
|
||||
package io.bitsquare.gui.common.view;
|
||||
|
||||
import java.net.URL;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.view;
|
||||
package io.bitsquare.gui.common.view;
|
||||
|
||||
import javafx.scene.*;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.view;
|
||||
package io.bitsquare.gui.common.view;
|
||||
|
||||
import javafx.util.Callback;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.view;
|
||||
package io.bitsquare.gui.common.view;
|
||||
|
||||
public interface ViewLoader {
|
||||
View load(Class<? extends View> viewClass);
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.view;
|
||||
package io.bitsquare.gui.common.view;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.view;
|
||||
package io.bitsquare.gui.common.view;
|
||||
|
||||
public interface Wizard extends View {
|
||||
void nextStep(Step currentStep);
|
|
@ -15,9 +15,9 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.common.view.guice;
|
||||
package io.bitsquare.gui.common.view.guice;
|
||||
|
||||
import io.bitsquare.common.view.ViewFactory;
|
||||
import io.bitsquare.gui.common.view.ViewFactory;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
|
@ -18,6 +18,7 @@
|
|||
package io.bitsquare.gui.components;
|
||||
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.util.GUIUtil;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
|
@ -86,7 +87,7 @@ public class AddressTextField extends AnchorPane {
|
|||
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
|
||||
copyIcon.setOnMouseClicked(e -> {
|
||||
if (address.get() != null && address.get().length() > 0)
|
||||
Utilities.copyToClipboard(address.get());
|
||||
GUIUtil.copyToClipboard(address.get());
|
||||
});
|
||||
|
||||
Label qrCode = new Label();
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.components;
|
||||
|
||||
import io.bitsquare.util.Utilities;
|
||||
import io.bitsquare.gui.util.GUIUtil;
|
||||
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
|
@ -45,7 +45,7 @@ public class TextFieldWithCopyIcon extends AnchorPane {
|
|||
AnchorPane.setRightAnchor(copyIcon, 0.0);
|
||||
copyIcon.setOnMouseClicked(e -> {
|
||||
if (getText() != null && getText().length() > 0)
|
||||
Utilities.copyToClipboard(getText());
|
||||
GUIUtil.copyToClipboard(getText());
|
||||
});
|
||||
TextField txIdLabel = new TextField();
|
||||
txIdLabel.setEditable(false);
|
||||
|
|
|
@ -20,6 +20,7 @@ package io.bitsquare.gui.components;
|
|||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.btc.listeners.TxConfidenceListener;
|
||||
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
|
||||
import io.bitsquare.gui.util.GUIUtil;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
||||
import org.bitcoinj.core.TransactionConfidence;
|
||||
|
@ -106,7 +107,7 @@ public class TxIdTextField extends AnchorPane {
|
|||
}
|
||||
});
|
||||
|
||||
copyIcon.setOnMouseClicked(e -> Utilities.copyToClipboard(txID));
|
||||
copyIcon.setOnMouseClicked(e -> GUIUtil.copyToClipboard(txID));
|
||||
}
|
||||
|
||||
public void cleanup() {
|
||||
|
|
|
@ -18,14 +18,14 @@
|
|||
package io.bitsquare.gui.main;
|
||||
|
||||
import io.bitsquare.BitsquareException;
|
||||
import io.bitsquare.common.view.CachingViewLoader;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.InitializableView;
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.fiat.FiatAccount;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.common.view.CachingViewLoader;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.InitializableView;
|
||||
import io.bitsquare.gui.common.view.View;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.components.SystemNotification;
|
||||
import io.bitsquare.gui.main.account.AccountView;
|
||||
|
|
|
@ -21,8 +21,8 @@ import io.bitsquare.app.UpdateProcess;
|
|||
import io.bitsquare.arbitration.ArbitrationRepository;
|
||||
import io.bitsquare.btc.BitcoinNetwork;
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.fiat.FiatAccount;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.locale.CountryUtil;
|
||||
import io.bitsquare.p2p.BaseP2PService;
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
|
||||
package io.bitsquare.gui.main.account;
|
||||
|
||||
import io.bitsquare.common.view.ActivatableView;
|
||||
import io.bitsquare.common.view.CachingViewLoader;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.common.view.ActivatableView;
|
||||
import io.bitsquare.gui.common.view.CachingViewLoader;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.View;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.main.MainView;
|
||||
import io.bitsquare.gui.main.account.arbitrator.ArbitratorSettingsView;
|
||||
import io.bitsquare.gui.main.account.settings.AccountSettingsView;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.main.account;
|
||||
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.user.User;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.arbitrator;
|
||||
|
||||
import io.bitsquare.common.view.AbstractView;
|
||||
import io.bitsquare.common.view.CachingViewLoader;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.common.view.AbstractView;
|
||||
import io.bitsquare.gui.common.view.CachingViewLoader;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.View;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.main.account.arbitrator.registration.ArbitratorRegistrationView;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
|
|
@ -19,11 +19,11 @@ package io.bitsquare.gui.main.account.arbitrator.browser;
|
|||
|
||||
import io.bitsquare.arbitration.Arbitrator;
|
||||
import io.bitsquare.arbitration.ArbitratorService;
|
||||
import io.bitsquare.common.view.ActivatableView;
|
||||
import io.bitsquare.common.view.CachingViewLoader;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.common.view.ActivatableView;
|
||||
import io.bitsquare.gui.common.view.CachingViewLoader;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.View;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.main.account.arbitrator.profile.ArbitratorProfileView;
|
||||
import io.bitsquare.user.AccountSettings;
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
package io.bitsquare.gui.main.account.arbitrator.profile;
|
||||
|
||||
import io.bitsquare.arbitration.Arbitrator;
|
||||
import io.bitsquare.common.view.AbstractView;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.AbstractView;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
|
|
@ -20,13 +20,13 @@ package io.bitsquare.gui.main.account.arbitrator.registration;
|
|||
import io.bitsquare.arbitration.Arbitrator;
|
||||
import io.bitsquare.arbitration.ArbitratorService;
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.common.view.ActivatableView;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.ActivatableView;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.gui.util.GUIUtil;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
import io.bitsquare.locale.LanguageUtil;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
|
@ -284,7 +284,7 @@ public class ArbitratorRegistrationView extends ActivatableView<AnchorPane, Void
|
|||
securityDepositAddressTextField.setText(securityDepositAddress);
|
||||
|
||||
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
|
||||
copyIcon.setOnMouseClicked(e -> Utilities.copyToClipboard(securityDepositAddress));
|
||||
copyIcon.setOnMouseClicked(e -> GUIUtil.copyToClipboard(securityDepositAddress));
|
||||
|
||||
paymentDoneButton.setDisable(walletService.getArbitratorDepositBalance().isZero());
|
||||
log.debug("getArbitratorDepositBalance " + walletService.getArbitratorDepositBalance());
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.altcoin;
|
||||
|
||||
import io.bitsquare.common.model.Activatable;
|
||||
import io.bitsquare.common.model.DataModel;
|
||||
import io.bitsquare.fiat.FiatAccount;
|
||||
import io.bitsquare.gui.common.model.Activatable;
|
||||
import io.bitsquare.gui.common.model.DataModel;
|
||||
import io.bitsquare.locale.CountryUtil;
|
||||
import io.bitsquare.locale.CurrencyUtil;
|
||||
import io.bitsquare.user.User;
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.altcoin;
|
||||
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.Wizard;
|
||||
import io.bitsquare.fiat.FiatAccount;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.Wizard;
|
||||
import io.bitsquare.gui.components.InputTextField;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.main.help.Help;
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.altcoin;
|
||||
|
||||
import io.bitsquare.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.fiat.FiatAccount;
|
||||
import io.bitsquare.gui.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.gui.util.validation.BankAccountNumberValidator;
|
||||
import io.bitsquare.gui.util.validation.InputValidator;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.changepassword;
|
||||
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.InitializableView;
|
||||
import io.bitsquare.common.view.Wizard;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.InitializableView;
|
||||
import io.bitsquare.gui.common.view.Wizard;
|
||||
import io.bitsquare.gui.main.help.Help;
|
||||
import io.bitsquare.gui.main.help.HelpId;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.changepassword;
|
||||
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.gui.util.validation.InputValidator;
|
||||
import io.bitsquare.gui.util.validation.PasswordValidator;
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.fiat;
|
||||
|
||||
import io.bitsquare.common.model.Activatable;
|
||||
import io.bitsquare.common.model.DataModel;
|
||||
import io.bitsquare.fiat.FiatAccount;
|
||||
import io.bitsquare.gui.common.model.Activatable;
|
||||
import io.bitsquare.gui.common.model.DataModel;
|
||||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.locale.CountryUtil;
|
||||
import io.bitsquare.locale.CurrencyUtil;
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.fiat;
|
||||
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.Wizard;
|
||||
import io.bitsquare.fiat.FiatAccount;
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.Wizard;
|
||||
import io.bitsquare.gui.components.InputTextField;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.main.help.Help;
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.fiat;
|
||||
|
||||
import io.bitsquare.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.fiat.FiatAccount;
|
||||
import io.bitsquare.gui.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.gui.util.validation.BankAccountNumberValidator;
|
||||
import io.bitsquare.gui.util.validation.InputValidator;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.password;
|
||||
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.InitializableView;
|
||||
import io.bitsquare.common.view.Wizard;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.InitializableView;
|
||||
import io.bitsquare.gui.common.view.Wizard;
|
||||
import io.bitsquare.gui.main.help.Help;
|
||||
import io.bitsquare.gui.main.help.HelpId;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.password;
|
||||
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.gui.util.validation.InputValidator;
|
||||
import io.bitsquare.gui.util.validation.PasswordValidator;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import io.bitsquare.btc.AddressEntry;
|
|||
import io.bitsquare.btc.FeePolicy;
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.btc.listeners.BalanceListener;
|
||||
import io.bitsquare.common.model.DataModel;
|
||||
import io.bitsquare.gui.common.model.DataModel;
|
||||
import io.bitsquare.user.User;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.registration;
|
||||
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.InitializableView;
|
||||
import io.bitsquare.common.view.Wizard;
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.InitializableView;
|
||||
import io.bitsquare.gui.common.view.Wizard;
|
||||
import io.bitsquare.gui.components.AddressTextField;
|
||||
import io.bitsquare.gui.components.BalanceTextField;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
package io.bitsquare.gui.main.account.content.registration;
|
||||
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.common.model.WithDataModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.gui.common.model.WithDataModel;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
package io.bitsquare.gui.main.account.content.restrictions;
|
||||
|
||||
import io.bitsquare.arbitration.Arbitrator;
|
||||
import io.bitsquare.common.model.Activatable;
|
||||
import io.bitsquare.common.model.DataModel;
|
||||
import io.bitsquare.gui.common.model.Activatable;
|
||||
import io.bitsquare.gui.common.model.DataModel;
|
||||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.locale.CountryUtil;
|
||||
import io.bitsquare.locale.LanguageUtil;
|
||||
|
|
|
@ -18,12 +18,12 @@
|
|||
package io.bitsquare.gui.main.account.content.restrictions;
|
||||
|
||||
import io.bitsquare.arbitration.Arbitrator;
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.CachingViewLoader;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.common.view.Wizard;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.CachingViewLoader;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.View;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.common.view.Wizard;
|
||||
import io.bitsquare.gui.main.account.arbitrator.browser.BrowserView;
|
||||
import io.bitsquare.gui.main.help.Help;
|
||||
import io.bitsquare.gui.main.help.HelpId;
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
package io.bitsquare.gui.main.account.content.restrictions;
|
||||
|
||||
import io.bitsquare.arbitration.Arbitrator;
|
||||
import io.bitsquare.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.gui.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.locale.Region;
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.seedwords;
|
||||
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.InitializableView;
|
||||
import io.bitsquare.common.view.Wizard;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.InitializableView;
|
||||
import io.bitsquare.gui.common.view.Wizard;
|
||||
import io.bitsquare.gui.main.help.Help;
|
||||
import io.bitsquare.gui.main.help.HelpId;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package io.bitsquare.gui.main.account.content.seedwords;
|
||||
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
|
|
@ -17,14 +17,14 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.settings;
|
||||
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.CachingViewLoader;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.common.view.ViewPath;
|
||||
import io.bitsquare.common.view.Wizard;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.CachingViewLoader;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.View;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.common.view.ViewPath;
|
||||
import io.bitsquare.gui.common.view.Wizard;
|
||||
import io.bitsquare.gui.main.MainView;
|
||||
import io.bitsquare.gui.main.account.AccountView;
|
||||
import io.bitsquare.gui.main.account.content.changepassword.ChangePasswordView;
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.setup;
|
||||
|
||||
import io.bitsquare.common.view.ActivatableView;
|
||||
import io.bitsquare.common.view.CachingViewLoader;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.common.view.Wizard;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.common.view.ActivatableView;
|
||||
import io.bitsquare.gui.common.view.CachingViewLoader;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.View;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.common.view.Wizard;
|
||||
import io.bitsquare.gui.main.MainView;
|
||||
import io.bitsquare.gui.main.account.content.fiat.FiatAccountView;
|
||||
import io.bitsquare.gui.main.account.content.password.PasswordView;
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
package io.bitsquare.gui.main.debug;
|
||||
|
||||
import io.bitsquare.common.taskrunner.Task;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.InitializableView;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.InitializableView;
|
||||
import io.bitsquare.trade.protocol.availability.CheckOfferAvailabilityProtocol;
|
||||
import io.bitsquare.trade.protocol.availability.tasks.ProcessReportOfferAvailabilityMessage;
|
||||
import io.bitsquare.trade.protocol.availability.tasks.RequestIsOfferAvailable;
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
|
||||
package io.bitsquare.gui.main.funds;
|
||||
|
||||
import io.bitsquare.common.model.Activatable;
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.CachingViewLoader;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.common.model.Activatable;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.CachingViewLoader;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.View;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.main.MainView;
|
||||
import io.bitsquare.gui.main.funds.reserved.ReservedView;
|
||||
import io.bitsquare.gui.main.funds.transactions.TransactionsView;
|
||||
|
|
|
@ -19,11 +19,11 @@ package io.bitsquare.gui.main.funds.reserved;
|
|||
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.btc.listeners.BalanceListener;
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.gui.util.GUIUtil;
|
||||
import io.bitsquare.trade.TradeManager;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
|
||||
|
@ -188,7 +188,7 @@ public class ReservedView extends ActivatableViewAndModel {
|
|||
|
||||
if (item != null && !empty) {
|
||||
setGraphic(copyIcon);
|
||||
copyIcon.setOnMouseClicked(e -> Utilities.copyToClipboard(item
|
||||
copyIcon.setOnMouseClicked(e -> GUIUtil.copyToClipboard(item
|
||||
.addressStringProperty().get()));
|
||||
|
||||
}
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
package io.bitsquare.gui.main.funds.transactions;
|
||||
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
|
|
@ -22,12 +22,12 @@ import io.bitsquare.btc.FeePolicy;
|
|||
import io.bitsquare.btc.Restrictions;
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.btc.listeners.BalanceListener;
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.gui.util.GUIUtil;
|
||||
import io.bitsquare.trade.TradeManager;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
||||
import org.bitcoinj.core.AddressFormatException;
|
||||
import org.bitcoinj.core.Coin;
|
||||
|
@ -275,7 +275,7 @@ public class WithdrawalView extends ActivatableViewAndModel {
|
|||
|
||||
if (item != null && !empty) {
|
||||
setGraphic(copyIcon);
|
||||
copyIcon.setOnMouseClicked(e -> Utilities.copyToClipboard(item
|
||||
copyIcon.setOnMouseClicked(e -> GUIUtil.copyToClipboard(item
|
||||
.addressStringProperty().get()));
|
||||
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package io.bitsquare.gui.main.home;
|
||||
|
||||
import io.bitsquare.common.view.AbstractView;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.AbstractView;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
|
||||
// home is just hosting the arbiters buttons yet, but that's just for dev, not clear yet what will be in home,
|
||||
// probably overview, event history, news, charts,... -> low prio
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package io.bitsquare.gui.main.msg;
|
||||
|
||||
import io.bitsquare.common.view.AbstractView;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.AbstractView;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
|
||||
// will be probably only used for arbitration communication, will be renamed and the icon changed
|
||||
@FxmlView
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.offer;
|
||||
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
package io.bitsquare.gui.main.offer;
|
||||
|
||||
import io.bitsquare.common.view.ActivatableView;
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.common.view.ActivatableView;
|
||||
import io.bitsquare.gui.common.view.View;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.components.InputTextField;
|
||||
import io.bitsquare.gui.main.MainView;
|
||||
import io.bitsquare.gui.main.offer.createoffer.CreateOfferView;
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.offer;
|
||||
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
|
|
@ -23,9 +23,9 @@ import io.bitsquare.btc.AddressEntry;
|
|||
import io.bitsquare.btc.FeePolicy;
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.btc.listeners.BalanceListener;
|
||||
import io.bitsquare.common.model.Activatable;
|
||||
import io.bitsquare.common.model.DataModel;
|
||||
import io.bitsquare.fiat.FiatAccount;
|
||||
import io.bitsquare.gui.common.model.Activatable;
|
||||
import io.bitsquare.gui.common.model.DataModel;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.offer.Offer;
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
package io.bitsquare.gui.main.offer.createoffer;
|
||||
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.components.AddressTextField;
|
||||
import io.bitsquare.gui.components.BalanceTextField;
|
||||
import io.bitsquare.gui.components.InfoDisplay;
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
package io.bitsquare.gui.main.offer.createoffer;
|
||||
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.gui.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.gui.util.validation.BtcValidator;
|
||||
import io.bitsquare.gui.util.validation.FiatValidator;
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
package io.bitsquare.gui.main.offer.offerbook;
|
||||
|
||||
import io.bitsquare.fiat.FiatAccount;
|
||||
import io.bitsquare.gui.util.GUIUtil;
|
||||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.locale.CurrencyUtil;
|
||||
import io.bitsquare.offer.Offer;
|
||||
import io.bitsquare.offer.OfferBookService;
|
||||
import io.bitsquare.trade.TradeManager;
|
||||
import io.bitsquare.user.User;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -182,7 +182,7 @@ public class OfferBook {
|
|||
private void startPolling() {
|
||||
addListeners();
|
||||
setBankAccount(user.currentFiatAccountProperty().get());
|
||||
pollingTimer = Utilities.setInterval(POLLING_INTERVAL, (animationTimer) -> {
|
||||
pollingTimer = GUIUtil.setInterval(POLLING_INTERVAL, (animationTimer) -> {
|
||||
offerBookService.requestInvalidationTimeStampFromDHT(fiatCode);
|
||||
return null;
|
||||
});
|
||||
|
|
|
@ -19,9 +19,9 @@ package io.bitsquare.gui.main.offer.offerbook;
|
|||
|
||||
import io.bitsquare.common.handlers.ErrorMessageHandler;
|
||||
import io.bitsquare.common.handlers.ResultHandler;
|
||||
import io.bitsquare.common.model.Activatable;
|
||||
import io.bitsquare.common.model.DataModel;
|
||||
import io.bitsquare.fiat.FiatAccount;
|
||||
import io.bitsquare.gui.common.model.Activatable;
|
||||
import io.bitsquare.gui.common.model.DataModel;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.locale.CurrencyUtil;
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
package io.bitsquare.gui.main.offer.offerbook;
|
||||
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.components.InputTextField;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.main.MainView;
|
||||
|
|
|
@ -19,8 +19,8 @@ package io.bitsquare.gui.main.offer.offerbook;
|
|||
|
||||
import io.bitsquare.common.handlers.ErrorMessageHandler;
|
||||
import io.bitsquare.common.handlers.ResultHandler;
|
||||
import io.bitsquare.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.gui.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.gui.util.validation.InputValidator;
|
||||
import io.bitsquare.gui.util.validation.OptionalBtcValidator;
|
||||
|
|
|
@ -21,8 +21,8 @@ import io.bitsquare.btc.AddressEntry;
|
|||
import io.bitsquare.btc.FeePolicy;
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.btc.listeners.BalanceListener;
|
||||
import io.bitsquare.common.model.Activatable;
|
||||
import io.bitsquare.common.model.DataModel;
|
||||
import io.bitsquare.gui.common.model.Activatable;
|
||||
import io.bitsquare.gui.common.model.DataModel;
|
||||
import io.bitsquare.offer.Offer;
|
||||
import io.bitsquare.trade.TradeManager;
|
||||
import io.bitsquare.trade.handlers.TakeOfferResultHandler;
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
package io.bitsquare.gui.main.offer.takeoffer;
|
||||
|
||||
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.components.AddressTextField;
|
||||
import io.bitsquare.gui.components.BalanceTextField;
|
||||
import io.bitsquare.gui.components.InfoDisplay;
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
package io.bitsquare.gui.main.offer.takeoffer;
|
||||
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.gui.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.gui.util.validation.BtcValidator;
|
||||
import io.bitsquare.gui.util.validation.InputValidator;
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio;
|
||||
|
||||
import io.bitsquare.common.model.Activatable;
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.CachingViewLoader;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.common.model.Activatable;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.CachingViewLoader;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.View;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.main.MainView;
|
||||
import io.bitsquare.gui.main.portfolio.closedtrades.ClosedTradesView;
|
||||
import io.bitsquare.gui.main.portfolio.openoffer.OpenOffersView;
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio.closedtrades;
|
||||
|
||||
import io.bitsquare.common.model.Activatable;
|
||||
import io.bitsquare.common.model.DataModel;
|
||||
import io.bitsquare.gui.common.model.Activatable;
|
||||
import io.bitsquare.gui.common.model.DataModel;
|
||||
import io.bitsquare.offer.Offer;
|
||||
import io.bitsquare.trade.Trade;
|
||||
import io.bitsquare.trade.TradeManager;
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio.closedtrades;
|
||||
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio.closedtrades;
|
||||
|
||||
import io.bitsquare.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.gui.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.trade.states.OffererTradeState;
|
||||
import io.bitsquare.trade.states.TakerTradeState;
|
||||
|
|
|
@ -19,8 +19,8 @@ package io.bitsquare.gui.main.portfolio.openoffer;
|
|||
|
||||
import io.bitsquare.common.handlers.ErrorMessageHandler;
|
||||
import io.bitsquare.common.handlers.ResultHandler;
|
||||
import io.bitsquare.common.model.Activatable;
|
||||
import io.bitsquare.common.model.DataModel;
|
||||
import io.bitsquare.gui.common.model.Activatable;
|
||||
import io.bitsquare.gui.common.model.DataModel;
|
||||
import io.bitsquare.offer.Offer;
|
||||
import io.bitsquare.trade.Trade;
|
||||
import io.bitsquare.trade.TradeManager;
|
||||
|
|
|
@ -17,15 +17,15 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio.openoffer;
|
||||
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.main.MainView;
|
||||
import io.bitsquare.gui.main.funds.FundsView;
|
||||
import io.bitsquare.gui.main.funds.withdrawal.WithdrawalView;
|
||||
import io.bitsquare.gui.util.GUIUtil;
|
||||
import io.bitsquare.offer.Offer;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -86,7 +86,7 @@ public class OpenOffersView extends ActivatableViewAndModel<GridPane, OpenOffers
|
|||
private void openOfferDetails(OpenOfferListItem item) {
|
||||
// TODO Open popup with details view
|
||||
log.debug("openOfferDetails " + item);
|
||||
Utilities.copyToClipboard(item.getOffer().getId());
|
||||
GUIUtil.copyToClipboard(item.getOffer().getId());
|
||||
Popups.openWarningPopup("Under construction",
|
||||
"The offer ID was copied to the clipboard. " +
|
||||
"Use that to identify your trading peer in the IRC chat room \n\n" +
|
||||
|
|
|
@ -19,8 +19,8 @@ package io.bitsquare.gui.main.portfolio.openoffer;
|
|||
|
||||
import io.bitsquare.common.handlers.ErrorMessageHandler;
|
||||
import io.bitsquare.common.handlers.ResultHandler;
|
||||
import io.bitsquare.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.gui.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.offer.Offer;
|
||||
|
||||
|
|
|
@ -20,9 +20,9 @@ package io.bitsquare.gui.main.portfolio.pendingtrades;
|
|||
import io.bitsquare.btc.FeePolicy;
|
||||
import io.bitsquare.btc.TradeWalletService;
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.common.model.Activatable;
|
||||
import io.bitsquare.common.model.DataModel;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.common.model.Activatable;
|
||||
import io.bitsquare.gui.common.model.DataModel;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.main.MainView;
|
||||
import io.bitsquare.gui.main.portfolio.PortfolioView;
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio.pendingtrades;
|
||||
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.util.GUIUtil;
|
||||
import io.bitsquare.trade.Trade;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.utils.Fiat;
|
||||
|
@ -192,7 +192,7 @@ public class PendingTradesView extends ActivatableViewAndModel<VBox, PendingTrad
|
|||
private void openOfferDetails(String id) {
|
||||
// TODO Open popup with details view
|
||||
log.debug("Trade details " + id);
|
||||
Utilities.copyToClipboard(id);
|
||||
GUIUtil.copyToClipboard(id);
|
||||
Popups.openWarningPopup("Under construction",
|
||||
"The trader ID was copied to the clipboard. " +
|
||||
"Use that to identify your trading peer in the IRC chat room \n\n" +
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
package io.bitsquare.gui.main.portfolio.pendingtrades;
|
||||
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.gui.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.gui.util.validation.BtcAddressValidator;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
|
|
|
@ -36,7 +36,7 @@ public class CompletedView extends TradeStepDetailsView {
|
|||
private static final Logger log = LoggerFactory.getLogger(WaitTxInBlockchainView.class);
|
||||
|
||||
private final ChangeListener<Boolean> focusedPropertyListener;
|
||||
|
||||
|
||||
private Label btcTradeAmountLabel;
|
||||
private TextField btcTradeAmountTextField;
|
||||
private Label fiatTradeAmountLabel;
|
||||
|
|
|
@ -36,7 +36,7 @@ public class ConfirmFiatReceivedView extends TradeStepDetailsView {
|
|||
private static final Logger log = LoggerFactory.getLogger(ConfirmFiatReceivedView.class);
|
||||
|
||||
private final ChangeListener<String> txIdChangeListener;
|
||||
|
||||
|
||||
private TxIdTextField txIdTextField;
|
||||
private Label infoLabel;
|
||||
private InfoDisplay infoDisplay;
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
|
||||
package io.bitsquare.gui.main.settings;
|
||||
|
||||
import io.bitsquare.common.model.Activatable;
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.CachingViewLoader;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.common.model.Activatable;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.CachingViewLoader;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.View;
|
||||
import io.bitsquare.gui.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.main.MainView;
|
||||
import io.bitsquare.gui.main.settings.application.PreferencesView;
|
||||
import io.bitsquare.gui.main.settings.network.NetworkSettingsView;
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package io.bitsquare.gui.main.settings.application;
|
||||
|
||||
import io.bitsquare.common.model.Activatable;
|
||||
import io.bitsquare.common.model.DataModel;
|
||||
import io.bitsquare.gui.common.model.Activatable;
|
||||
import io.bitsquare.gui.common.model.DataModel;
|
||||
import io.bitsquare.user.Preferences;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package io.bitsquare.gui.main.settings.application;
|
||||
|
||||
import io.bitsquare.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package io.bitsquare.gui.main.settings.application;
|
||||
|
||||
import io.bitsquare.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.common.model.ViewModel;
|
||||
import io.bitsquare.gui.common.model.ActivatableWithDataModel;
|
||||
import io.bitsquare.gui.common.model.ViewModel;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
package io.bitsquare.gui.main.settings.network;
|
||||
|
||||
import io.bitsquare.btc.BitcoinNetwork;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.InitializableView;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.InitializableView;
|
||||
import io.bitsquare.p2p.ClientNode;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
|
72
gui/src/main/java/io/bitsquare/gui/util/GUIUtil.java
Normal file
72
gui/src/main/java/io/bitsquare/gui/util/GUIUtil.java
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.util;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
import javafx.animation.AnimationTimer;
|
||||
import javafx.application.Platform;
|
||||
import javafx.scene.input.*;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class GUIUtil {
|
||||
private static final Logger log = LoggerFactory.getLogger(GUIUtil.class);
|
||||
|
||||
public static void copyToClipboard(String content) {
|
||||
if (content != null && content.length() > 0) {
|
||||
Clipboard clipboard = Clipboard.getSystemClipboard();
|
||||
ClipboardContent clipboardContent = new ClipboardContent();
|
||||
clipboardContent.putString(content);
|
||||
clipboard.setContent(clipboardContent);
|
||||
}
|
||||
}
|
||||
|
||||
public static AnimationTimer setTimeout(int delay, Function<AnimationTimer, Void> callback) {
|
||||
AnimationTimer animationTimer = new AnimationTimer() {
|
||||
final long lastTimeStamp = System.currentTimeMillis();
|
||||
|
||||
@Override
|
||||
public void handle(long arg0) {
|
||||
if (System.currentTimeMillis() > delay + lastTimeStamp) {
|
||||
Platform.runLater(() -> callback.apply(this));
|
||||
this.stop();
|
||||
}
|
||||
}
|
||||
};
|
||||
animationTimer.start();
|
||||
return animationTimer;
|
||||
}
|
||||
|
||||
public static AnimationTimer setInterval(int delay, Function<AnimationTimer, Void> callback) {
|
||||
AnimationTimer animationTimer = new AnimationTimer() {
|
||||
long lastTimeStamp = System.currentTimeMillis();
|
||||
|
||||
@Override
|
||||
public void handle(long arg0) {
|
||||
if (System.currentTimeMillis() > delay + lastTimeStamp) {
|
||||
lastTimeStamp = System.currentTimeMillis();
|
||||
callback.apply(this);
|
||||
}
|
||||
}
|
||||
};
|
||||
animationTimer.start();
|
||||
return animationTimer;
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
<logger name="io.bitsquare" level="TRACE"/>
|
||||
<logger name="io.bitsquare.btc.AddressBasedCoinSelector" level="OFF"/>
|
||||
|
||||
|
||||
<logger name="io.bitsquare.gui.util.Profiler" level="ERROR"/>
|
||||
<logger name="io.bitsquare.locale.BSResources" level="ERROR"/>
|
||||
|
||||
|
|
|
@ -17,12 +17,13 @@
|
|||
|
||||
package io.bitsquare.common.fxml;
|
||||
|
||||
import io.bitsquare.common.ViewfxException;
|
||||
import io.bitsquare.common.view.AbstractView;
|
||||
import io.bitsquare.common.view.FxmlView;
|
||||
import io.bitsquare.common.view.View;
|
||||
import io.bitsquare.common.view.ViewFactory;
|
||||
import io.bitsquare.common.view.ViewLoader;
|
||||
import io.bitsquare.gui.common.ViewfxException;
|
||||
import io.bitsquare.gui.common.fxml.FxmlViewLoader;
|
||||
import io.bitsquare.gui.common.view.AbstractView;
|
||||
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;
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue