Introduce top-level viewfx package

Move general-purpose ui infrastructure to this new package, leaving
what's in io.bitsquare.gui truly specific to Bitsquare.
This commit is contained in:
Chris Beams 2014-11-23 17:16:35 +01:00
parent 1390ce21a8
commit b890f37216
No known key found for this signature in database
GPG key ID: 3D214F8F5BC5ED73
73 changed files with 179 additions and 161 deletions

View file

@ -48,6 +48,8 @@
<emptyLine />
<package name="javax.swing" withSubpackages="true" static="false" />
<emptyLine />
<package name="viewfx" withSubpackages="true" static="false" />
<emptyLine />
<package name="javafx" withSubpackages="true" static="false" />
<emptyLine />
<package name="com.sun.javafx" withSubpackages="true" static="false" />
@ -86,5 +88,4 @@
</option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</component>
</project>
</project>

View file

@ -19,7 +19,6 @@ package io.bitsquare.gui.main;
import io.bitsquare.BitsquareException;
import io.bitsquare.bank.BankAccount;
import io.bitsquare.gui.ActivatableView;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.OverlayManager;
import io.bitsquare.gui.ViewLoader;
@ -30,6 +29,8 @@ import io.bitsquare.gui.util.Transitions;
import javax.inject.Inject;
import javax.inject.Named;
import viewfx.ActivatableView;
import javafx.application.Platform;
import javafx.geometry.Insets;
import javafx.geometry.Pos;

View file

@ -20,7 +20,6 @@ package io.bitsquare.gui.main;
import io.bitsquare.bank.BankAccount;
import io.bitsquare.btc.BitcoinNetwork;
import io.bitsquare.btc.WalletService;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.msg.MessageService;
import io.bitsquare.network.BootstrapState;
@ -31,6 +30,8 @@ import io.bitsquare.user.User;
import com.google.inject.Inject;
import viewfx.ViewModel;
import javafx.application.Platform;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.DoubleProperty;

View file

@ -17,13 +17,13 @@
package io.bitsquare.gui.main.account;
import io.bitsquare.gui.ActivatableView;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.View;
import io.bitsquare.gui.ViewLoader;
import javax.inject.Inject;
import viewfx.ActivatableView;
import javafx.beans.value.ChangeListener;
import javafx.fxml.FXML;
import javafx.scene.control.*;
@ -94,8 +94,7 @@ public class AccountView extends ActivatableView<TabPane, AccountViewModel> {
}
@Override
protected View loadView(Navigation.Item navigationItem) {
private void loadView(Navigation.Item navigationItem) {
ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl());
final Tab tab;
switch (navigationItem) {
@ -121,6 +120,5 @@ public class AccountView extends ActivatableView<TabPane, AccountViewModel> {
tab.setContent(loaded.view);
root.getSelectionModel().select(tab);
return (View) loaded.controller;
}
}

View file

@ -17,11 +17,12 @@
package io.bitsquare.gui.main.account;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.user.User;
import com.google.inject.Inject;
import viewfx.ViewModel;
class AccountViewModel implements ViewModel {
private final User user;

View file

@ -17,14 +17,14 @@
package io.bitsquare.gui.main.account.arbitrator;
import io.bitsquare.gui.AbstractView;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.View;
import io.bitsquare.gui.ViewLoader;
import io.bitsquare.gui.main.account.arbitrator.registration.ArbitratorRegistrationView;
import javax.inject.Inject;
import viewfx.AbstractView;
import javafx.fxml.FXML;
import javafx.scene.*;
import javafx.stage.Modality;
@ -46,8 +46,7 @@ class ArbitratorSettingsView extends AbstractView {
this.primaryStage = primaryStage;
}
@Override
protected View loadView(Navigation.Item navigationItem) {
private void loadView(Navigation.Item navigationItem) {
ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl(), false);
arbitratorRegistrationView = (ArbitratorRegistrationView) loaded.controller;
@ -64,8 +63,6 @@ class ArbitratorSettingsView extends AbstractView {
Scene scene = new Scene((Parent) loaded.view, 800, 600);
stage.setScene(scene);
stage.show();
return arbitratorRegistrationView;
}
@FXML

View file

@ -19,9 +19,7 @@ package io.bitsquare.gui.main.account.arbitrator.browser;
import io.bitsquare.account.AccountSettings;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.gui.ActivatableView;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.View;
import io.bitsquare.gui.ViewLoader;
import io.bitsquare.gui.main.account.arbitrator.profile.ArbitratorProfileView;
import io.bitsquare.locale.LanguageUtil;
@ -34,6 +32,8 @@ import java.util.List;
import javax.inject.Inject;
import viewfx.ActivatableView;
import javafx.fxml.FXML;
import javafx.scene.control.*;
import javafx.scene.layout.*;
@ -90,11 +90,10 @@ class ArbitratorBrowserView extends ActivatableView<Pane, Void> implements Arbit
}*/
@Override
protected View loadView(Navigation.Item navigationItem) {
private void loadView(Navigation.Item navigationItem) {
ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl());
root.getChildren().set(0, loaded.view);
return arbitratorProfileView = (ArbitratorProfileView) loaded.controller;
arbitratorProfileView = (ArbitratorProfileView) loaded.controller;
}
@Override

View file

@ -18,13 +18,14 @@
package io.bitsquare.gui.main.account.arbitrator.profile;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.gui.AbstractView;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.settings.Preferences;
import javax.inject.Inject;
import viewfx.AbstractView;
import javafx.fxml.FXML;
import javafx.scene.control.*;

View file

@ -20,7 +20,6 @@ package io.bitsquare.gui.main.account.arbitrator.registration;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.arbitrator.Reputation;
import io.bitsquare.btc.WalletService;
import io.bitsquare.gui.ActivatableView;
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.locale.BSResources;
@ -45,6 +44,8 @@ import java.util.Locale;
import javax.inject.Inject;
import viewfx.ActivatableView;
import javafx.collections.FXCollections;
import javafx.fxml.FXML;
import javafx.scene.control.*;

View file

@ -17,13 +17,14 @@
package io.bitsquare.gui.main.account.content.changepassword;
import io.bitsquare.gui.InitializableView;
import io.bitsquare.gui.Wizard;
import io.bitsquare.gui.main.help.Help;
import io.bitsquare.gui.main.help.HelpId;
import javax.inject.Inject;
import viewfx.InitializableView;
import viewfx.Wizard;
import javafx.fxml.FXML;
import javafx.scene.control.*;
import javafx.scene.layout.*;

View file

@ -17,12 +17,13 @@
package io.bitsquare.gui.main.account.content.changepassword;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.gui.util.validation.PasswordValidator;
import com.google.inject.Inject;
import viewfx.ViewModel;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleStringProperty;

View file

@ -20,8 +20,6 @@ package io.bitsquare.gui.main.account.content.fiat;
import io.bitsquare.account.AccountSettings;
import io.bitsquare.bank.BankAccount;
import io.bitsquare.bank.BankAccountType;
import io.bitsquare.gui.Activatable;
import io.bitsquare.gui.DataModel;
import io.bitsquare.locale.Country;
import io.bitsquare.locale.CountryUtil;
import io.bitsquare.locale.CurrencyUtil;
@ -33,6 +31,9 @@ import com.google.inject.Inject;
import java.util.Currency;
import viewfx.Activatable;
import viewfx.DataModel;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;

View file

@ -19,9 +19,7 @@ package io.bitsquare.gui.main.account.content.fiat;
import io.bitsquare.bank.BankAccount;
import io.bitsquare.bank.BankAccountType;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.OverlayManager;
import io.bitsquare.gui.Wizard;
import io.bitsquare.gui.components.InputTextField;
import io.bitsquare.gui.components.Popups;
import io.bitsquare.gui.main.help.Help;
@ -37,6 +35,9 @@ import java.util.List;
import javax.inject.Inject;
import viewfx.ActivatableViewAndModel;
import viewfx.Wizard;
import javafx.collections.ListChangeListener;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;

View file

@ -19,8 +19,6 @@ package io.bitsquare.gui.main.account.content.fiat;
import io.bitsquare.bank.BankAccount;
import io.bitsquare.bank.BankAccountType;
import io.bitsquare.gui.ActivatableWithDelegate;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.gui.util.validation.BankAccountNumberValidator;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.locale.BSResources;
@ -31,6 +29,9 @@ import com.google.inject.Inject;
import java.util.Currency;
import viewfx.ActivatableWithDelegate;
import viewfx.ViewModel;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;

View file

@ -22,8 +22,6 @@ import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.arbitrator.Reputation;
import io.bitsquare.bank.BankAccount;
import io.bitsquare.bank.BankAccountType;
import io.bitsquare.gui.Activatable;
import io.bitsquare.gui.DataModel;
import io.bitsquare.locale.Country;
import io.bitsquare.locale.CountryUtil;
import io.bitsquare.locale.CurrencyUtil;
@ -45,6 +43,9 @@ import java.util.Currency;
import java.util.List;
import java.util.Locale;
import viewfx.Activatable;
import viewfx.DataModel;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;

View file

@ -18,8 +18,6 @@
package io.bitsquare.gui.main.account.content.irc;
import io.bitsquare.bank.BankAccountType;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.Wizard;
import io.bitsquare.gui.components.InputTextField;
import io.bitsquare.gui.components.Popups;
import io.bitsquare.gui.main.help.Help;
@ -30,6 +28,9 @@ import java.util.Currency;
import javax.inject.Inject;
import viewfx.ActivatableViewAndModel;
import viewfx.Wizard;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.scene.control.*;

View file

@ -19,8 +19,6 @@ package io.bitsquare.gui.main.account.content.irc;
import io.bitsquare.bank.BankAccount;
import io.bitsquare.bank.BankAccountType;
import io.bitsquare.gui.ActivatableWithDelegate;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.gui.util.validation.BankAccountNumberValidator;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.locale.BSResources;
@ -29,6 +27,9 @@ import com.google.inject.Inject;
import java.util.Currency;
import viewfx.ActivatableWithDelegate;
import viewfx.ViewModel;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;

View file

@ -17,13 +17,14 @@
package io.bitsquare.gui.main.account.content.password;
import io.bitsquare.gui.InitializableView;
import io.bitsquare.gui.Wizard;
import io.bitsquare.gui.main.help.Help;
import io.bitsquare.gui.main.help.HelpId;
import javax.inject.Inject;
import viewfx.InitializableView;
import viewfx.Wizard;
import javafx.fxml.FXML;
import javafx.scene.control.*;
import javafx.scene.layout.*;

View file

@ -17,12 +17,13 @@
package io.bitsquare.gui.main.account.content.password;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.gui.util.validation.PasswordValidator;
import com.google.inject.Inject;
import viewfx.ViewModel;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleStringProperty;

View file

@ -21,7 +21,6 @@ import io.bitsquare.btc.AddressEntry;
import io.bitsquare.btc.FeePolicy;
import io.bitsquare.btc.WalletService;
import io.bitsquare.btc.listeners.BalanceListener;
import io.bitsquare.gui.DataModel;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.user.User;
@ -35,6 +34,8 @@ import com.google.inject.Inject;
import javax.annotation.Nullable;
import viewfx.DataModel;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleStringProperty;

View file

@ -17,9 +17,7 @@
package io.bitsquare.gui.main.account.content.registration;
import io.bitsquare.gui.InitializableView;
import io.bitsquare.gui.OverlayManager;
import io.bitsquare.gui.Wizard;
import io.bitsquare.gui.components.AddressTextField;
import io.bitsquare.gui.components.BalanceTextField;
import io.bitsquare.gui.components.Popups;
@ -32,6 +30,9 @@ import java.util.List;
import javax.inject.Inject;
import viewfx.InitializableView;
import viewfx.Wizard;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.*;

View file

@ -18,8 +18,6 @@
package io.bitsquare.gui.main.account.content.registration;
import io.bitsquare.btc.WalletService;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.gui.WithDelegate;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.locale.BSResources;
@ -28,6 +26,9 @@ import org.bitcoinj.core.Coin;
import com.google.inject.Inject;
import viewfx.ViewModel;
import viewfx.WithDelegate;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;

View file

@ -20,8 +20,6 @@ package io.bitsquare.gui.main.account.content.restrictions;
import io.bitsquare.account.AccountSettings;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.arbitrator.Reputation;
import io.bitsquare.gui.Activatable;
import io.bitsquare.gui.DataModel;
import io.bitsquare.locale.Country;
import io.bitsquare.locale.CountryUtil;
import io.bitsquare.locale.LanguageUtil;
@ -41,6 +39,9 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import viewfx.Activatable;
import viewfx.DataModel;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;

View file

@ -18,11 +18,8 @@
package io.bitsquare.gui.main.account.content.restrictions;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.View;
import io.bitsquare.gui.ViewLoader;
import io.bitsquare.gui.Wizard;
import io.bitsquare.gui.main.help.Help;
import io.bitsquare.gui.main.help.HelpId;
import io.bitsquare.gui.util.ImageUtil;
@ -33,6 +30,10 @@ import java.util.Locale;
import javax.inject.Inject;
import viewfx.ActivatableViewAndModel;
import viewfx.View;
import viewfx.Wizard;
import javafx.fxml.FXML;
import javafx.scene.*;
import javafx.scene.control.*;
@ -144,8 +145,7 @@ public class RestrictionsView extends ActivatableViewAndModel<GridPane, Restrict
Help.openWindow(HelpId.SETUP_RESTRICTION_ARBITRATORS);
}
@Override
protected View loadView(Navigation.Item navigationItem) {
private void loadView(Navigation.Item navigationItem) {
ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl(), false);
final Stage stage = new Stage();
@ -165,8 +165,6 @@ public class RestrictionsView extends ActivatableViewAndModel<GridPane, Restrict
updateArbitratorList();
});
stage.show();
return (View) loaded.controller;
}
void updateArbitratorList() {

View file

@ -18,8 +18,6 @@
package io.bitsquare.gui.main.account.content.restrictions;
import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.gui.ActivatableWithDelegate;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.locale.Country;
import io.bitsquare.locale.Region;
@ -27,6 +25,9 @@ import com.google.inject.Inject;
import java.util.Locale;
import viewfx.ActivatableWithDelegate;
import viewfx.ViewModel;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.collections.ObservableList;

View file

@ -17,13 +17,14 @@
package io.bitsquare.gui.main.account.content.seedwords;
import io.bitsquare.gui.InitializableView;
import io.bitsquare.gui.Wizard;
import io.bitsquare.gui.main.help.Help;
import io.bitsquare.gui.main.help.HelpId;
import javax.inject.Inject;
import viewfx.InitializableView;
import viewfx.Wizard;
import javafx.fxml.FXML;
import javafx.scene.control.*;
import javafx.scene.layout.*;

View file

@ -18,13 +18,14 @@
package io.bitsquare.gui.main.account.content.seedwords;
import io.bitsquare.btc.WalletService;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.gui.util.BSFormatter;
import com.google.inject.Inject;
import java.util.List;
import viewfx.ViewModel;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

View file

@ -17,15 +17,16 @@
package io.bitsquare.gui.main.account.settings;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.View;
import io.bitsquare.gui.ViewLoader;
import io.bitsquare.gui.Wizard;
import io.bitsquare.gui.util.Colors;
import javax.inject.Inject;
import viewfx.ActivatableViewAndModel;
import viewfx.View;
import viewfx.Wizard;
import javafx.fxml.FXML;
import javafx.geometry.Pos;
import javafx.scene.control.*;
@ -107,14 +108,12 @@ class AccountSettingsView extends ActivatableViewAndModel {
navigation.removeListener(listener);
}
@Override
protected View loadView(Navigation.Item navigationItem) {
private void loadView(Navigation.Item navigationItem) {
ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl());
content.getChildren().setAll(loaded.view);
View child = (View) loaded.controller;
if (child instanceof Wizard.Step)
((Wizard.Step) child).hideWizardNavigation();
return child;
}
private void selectMainMenuButton(Navigation.Item item) {

View file

@ -17,11 +17,8 @@
package io.bitsquare.gui.main.account.setup;
import io.bitsquare.gui.ActivatableView;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.View;
import io.bitsquare.gui.ViewLoader;
import io.bitsquare.gui.Wizard;
import io.bitsquare.gui.main.account.content.irc.IrcAccountView;
import io.bitsquare.gui.main.account.content.password.PasswordView;
import io.bitsquare.gui.main.account.content.registration.RegistrationView;
@ -30,6 +27,10 @@ import io.bitsquare.gui.main.account.content.seedwords.SeedWordsView;
import javax.inject.Inject;
import viewfx.ActivatableView;
import viewfx.View;
import viewfx.Wizard;
import javafx.fxml.FXML;
import javafx.geometry.Insets;
import javafx.scene.control.*;
@ -151,14 +152,12 @@ class AccountSetupWizard extends ActivatableView implements Wizard {
}
}
@Override
protected View loadView(Navigation.Item navigationItem) {
protected void loadView(Navigation.Item navigationItem) {
ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl());
content.getChildren().setAll(loaded.view);
View child = (View) loaded.controller;
if (child instanceof Wizard.Step)
((Step) child).setParent(this);
return child;
}
}

View file

@ -17,14 +17,14 @@
package io.bitsquare.gui.main.funds;
import io.bitsquare.gui.Activatable;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.View;
import io.bitsquare.gui.ViewLoader;
import javax.inject.Inject;
import viewfx.Activatable;
import viewfx.ActivatableViewAndModel;
import javafx.beans.value.ChangeListener;
import javafx.fxml.FXML;
import javafx.scene.control.*;
@ -79,8 +79,7 @@ class FundsView extends ActivatableViewAndModel<TabPane, Activatable> {
navigation.removeListener(navigationListener);
}
@Override
protected View loadView(Navigation.Item navigationItem) {
private void loadView(Navigation.Item navigationItem) {
// we want to get activate/deactivate called, so we remove the old view on tab change
if (currentTab != null)
currentTab.setContent(null);
@ -96,7 +95,6 @@ class FundsView extends ActivatableViewAndModel<TabPane, Activatable> {
}
currentTab.setContent(loaded.view);
root.getSelectionModel().select(currentTab);
return (View) loaded.controller;
}
}

View file

@ -18,7 +18,6 @@
package io.bitsquare.gui.main.funds.transactions;
import io.bitsquare.btc.WalletService;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.components.Popups;
import io.bitsquare.gui.util.BSFormatter;
@ -29,6 +28,8 @@ import java.util.stream.Collectors;
import javax.inject.Inject;
import viewfx.ActivatableViewAndModel;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;

View file

@ -22,7 +22,6 @@ import io.bitsquare.btc.FeePolicy;
import io.bitsquare.btc.Restrictions;
import io.bitsquare.btc.WalletService;
import io.bitsquare.btc.listeners.BalanceListener;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.components.Popups;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.util.Utilities;
@ -39,6 +38,8 @@ import java.util.stream.Collectors;
import javax.inject.Inject;
import viewfx.ActivatableViewAndModel;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;

View file

@ -17,7 +17,7 @@
package io.bitsquare.gui.main.home;
import io.bitsquare.gui.AbstractView;
import viewfx.AbstractView;
// 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

View file

@ -17,9 +17,7 @@
package io.bitsquare.gui.main.msg;
import io.bitsquare.gui.AbstractView;
import javax.inject.Inject;
import viewfx.AbstractView;
// will be probably only used for arbitration communication, will be renamed and the icon changed
class MsgView extends AbstractView {

View file

@ -17,15 +17,15 @@
package io.bitsquare.gui.main.portfolio;
import io.bitsquare.gui.Activatable;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.View;
import io.bitsquare.gui.ViewLoader;
import io.bitsquare.trade.TradeManager;
import javax.inject.Inject;
import viewfx.Activatable;
import viewfx.ActivatableViewAndModel;
import javafx.beans.value.ChangeListener;
import javafx.fxml.FXML;
import javafx.scene.control.*;
@ -86,8 +86,7 @@ class PortfolioView extends ActivatableViewAndModel<TabPane, Activatable> {
currentTab = null;
}
@Override
protected View loadView(Navigation.Item navigationItem) {
private void loadView(Navigation.Item navigationItem) {
// we want to get activate/deactivate called, so we remove the old view on tab change
if (currentTab != null)
@ -107,7 +106,6 @@ class PortfolioView extends ActivatableViewAndModel<TabPane, Activatable> {
}
currentTab.setContent(loaded.view);
root.getSelectionModel().select(currentTab);
return (View) loaded.controller;
}
}

View file

@ -17,8 +17,6 @@
package io.bitsquare.gui.main.portfolio.closed;
import io.bitsquare.gui.Activatable;
import io.bitsquare.gui.DataModel;
import io.bitsquare.offer.Direction;
import io.bitsquare.offer.Offer;
import io.bitsquare.trade.Trade;
@ -27,6 +25,9 @@ import io.bitsquare.user.User;
import com.google.inject.Inject;
import viewfx.Activatable;
import viewfx.DataModel;
import javafx.collections.FXCollections;
import javafx.collections.MapChangeListener;
import javafx.collections.ObservableList;

View file

@ -17,11 +17,12 @@
package io.bitsquare.gui.main.portfolio.closed;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.components.Popups;
import javax.inject.Inject;
import viewfx.ActivatableViewAndModel;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.fxml.FXML;
import javafx.scene.control.*;

View file

@ -17,12 +17,13 @@
package io.bitsquare.gui.main.portfolio.closed;
import io.bitsquare.gui.ActivatableWithDelegate;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.gui.util.BSFormatter;
import com.google.inject.Inject;
import viewfx.ActivatableWithDelegate;
import viewfx.ViewModel;
import javafx.collections.ObservableList;
class ClosedTradesViewModel extends ActivatableWithDelegate<ClosedTradesDataModel> implements ViewModel {

View file

@ -17,8 +17,6 @@
package io.bitsquare.gui.main.portfolio.offer;
import io.bitsquare.gui.Activatable;
import io.bitsquare.gui.DataModel;
import io.bitsquare.offer.Direction;
import io.bitsquare.offer.Offer;
import io.bitsquare.trade.TradeManager;
@ -28,6 +26,9 @@ import com.google.inject.Inject;
import java.util.stream.Collectors;
import viewfx.Activatable;
import viewfx.DataModel;
import javafx.collections.FXCollections;
import javafx.collections.MapChangeListener;
import javafx.collections.ObservableList;

View file

@ -17,12 +17,13 @@
package io.bitsquare.gui.main.portfolio.offer;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.components.Popups;
import io.bitsquare.util.Utilities;
import javax.inject.Inject;
import viewfx.ActivatableViewAndModel;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.fxml.FXML;
import javafx.scene.control.*;

View file

@ -17,12 +17,13 @@
package io.bitsquare.gui.main.portfolio.offer;
import io.bitsquare.gui.ActivatableWithDelegate;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.gui.util.BSFormatter;
import com.google.inject.Inject;
import viewfx.ActivatableWithDelegate;
import viewfx.ViewModel;
import javafx.collections.ObservableList;
class OffersViewModel extends ActivatableWithDelegate<OffersDataModel> implements ViewModel {

View file

@ -21,8 +21,6 @@ import io.bitsquare.btc.AddressEntry;
import io.bitsquare.btc.FeePolicy;
import io.bitsquare.btc.WalletService;
import io.bitsquare.btc.listeners.TxConfidenceListener;
import io.bitsquare.gui.Activatable;
import io.bitsquare.gui.DataModel;
import io.bitsquare.offer.Direction;
import io.bitsquare.offer.Offer;
import io.bitsquare.trade.Trade;
@ -41,6 +39,9 @@ import com.google.inject.Inject;
import java.util.Optional;
import viewfx.Activatable;
import viewfx.DataModel;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;

View file

@ -17,7 +17,6 @@
package io.bitsquare.gui.main.portfolio.pending;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.components.InfoDisplay;
import io.bitsquare.gui.components.InputTextField;
@ -41,6 +40,8 @@ import java.util.List;
import javax.inject.Inject;
import viewfx.ActivatableViewAndModel;
import javafx.application.Platform;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.beans.value.ChangeListener;

View file

@ -18,8 +18,6 @@
package io.bitsquare.gui.main.portfolio.pending;
import io.bitsquare.btc.WalletService;
import io.bitsquare.gui.ActivatableWithDelegate;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.validation.BtcAddressValidator;
import io.bitsquare.locale.BSResources;
@ -32,6 +30,9 @@ import com.google.inject.Inject;
import java.util.Date;
import viewfx.ActivatableWithDelegate;
import viewfx.ViewModel;
import javafx.beans.InvalidationListener;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ObjectProperty;

View file

@ -17,15 +17,15 @@
package io.bitsquare.gui.main.settings;
import io.bitsquare.gui.Activatable;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.View;
import io.bitsquare.gui.ViewLoader;
import io.bitsquare.settings.Preferences;
import javax.inject.Inject;
import viewfx.Activatable;
import viewfx.ActivatableViewAndModel;
import javafx.beans.value.ChangeListener;
import javafx.fxml.FXML;
import javafx.scene.control.*;
@ -87,8 +87,7 @@ class SettingsView extends ActivatableViewAndModel<TabPane, Activatable> {
navigation.removeListener(navigationListener);
}
@Override
protected View loadView(Navigation.Item navigationItem) {
private void loadView(Navigation.Item navigationItem) {
ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl());
final Tab tab;
switch (navigationItem) {
@ -103,7 +102,6 @@ class SettingsView extends ActivatableViewAndModel<TabPane, Activatable> {
}
tab.setContent(loaded.view);
root.getSelectionModel().select(tab);
return (View) loaded.controller;
}
}

View file

@ -17,12 +17,13 @@
package io.bitsquare.gui.main.settings.application;
import io.bitsquare.gui.Activatable;
import io.bitsquare.gui.DataModel;
import io.bitsquare.settings.Preferences;
import com.google.inject.Inject;
import viewfx.Activatable;
import viewfx.DataModel;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleStringProperty;

View file

@ -17,10 +17,10 @@
package io.bitsquare.gui.main.settings.application;
import io.bitsquare.gui.ActivatableViewAndModel;
import javax.inject.Inject;
import viewfx.ActivatableViewAndModel;
import javafx.fxml.FXML;
import javafx.scene.control.*;
import javafx.scene.layout.*;

View file

@ -17,11 +17,11 @@
package io.bitsquare.gui.main.settings.application;
import io.bitsquare.gui.ActivatableWithDelegate;
import io.bitsquare.gui.ViewModel;
import com.google.inject.Inject;
import viewfx.ActivatableWithDelegate;
import viewfx.ViewModel;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.StringProperty;
import javafx.collections.ObservableList;

View file

@ -18,11 +18,12 @@
package io.bitsquare.gui.main.settings.network;
import io.bitsquare.btc.BitcoinNetwork;
import io.bitsquare.gui.InitializableView;
import io.bitsquare.network.ClientNode;
import javax.inject.Inject;
import viewfx.InitializableView;
import javafx.fxml.FXML;
import javafx.scene.control.*;

View file

@ -17,9 +17,7 @@
package io.bitsquare.gui.main.trade;
import io.bitsquare.gui.ActivatableView;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.View;
import io.bitsquare.gui.ViewLoader;
import io.bitsquare.gui.components.InputTextField;
import io.bitsquare.gui.main.trade.createoffer.CreateOfferView;
@ -33,6 +31,9 @@ import org.bitcoinj.utils.Fiat;
import java.util.List;
import viewfx.ActivatableView;
import viewfx.View;
import javafx.application.Platform;
import javafx.collections.ListChangeListener;
import javafx.scene.*;
@ -117,8 +118,7 @@ public class TradeView extends ActivatableView<TabPane, Void> {
navigation.navigationTo(Navigation.Item.MAIN, navigationItem, Navigation.Item.TAKE_OFFER);
}
@Override
protected View loadView(Navigation.Item navigationItem) {
private View loadView(Navigation.Item navigationItem) {
TabPane tabPane = root;
if (navigationItem == Navigation.Item.OFFER_BOOK && offerBookView == null) {
// Offerbook must not be cached by ViewLoader as we use 2 instances for sell and buy screens.

View file

@ -24,8 +24,6 @@ import io.bitsquare.btc.AddressEntry;
import io.bitsquare.btc.FeePolicy;
import io.bitsquare.btc.WalletService;
import io.bitsquare.btc.listeners.BalanceListener;
import io.bitsquare.gui.Activatable;
import io.bitsquare.gui.DataModel;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.locale.Country;
import io.bitsquare.offer.Direction;
@ -43,6 +41,9 @@ import com.google.inject.Inject;
import java.util.Locale;
import java.util.UUID;
import viewfx.Activatable;
import viewfx.DataModel;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;

View file

@ -17,7 +17,6 @@
package io.bitsquare.gui.main.trade.createoffer;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.OverlayManager;
import io.bitsquare.gui.components.AddressTextField;
@ -40,6 +39,8 @@ import java.util.List;
import javax.inject.Inject;
import viewfx.ActivatableViewAndModel;
import javafx.beans.property.BooleanProperty;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;

View file

@ -18,8 +18,6 @@
package io.bitsquare.gui.main.trade.createoffer;
import io.bitsquare.btc.WalletService;
import io.bitsquare.gui.ActivatableWithDelegate;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.validation.BtcValidator;
import io.bitsquare.gui.util.validation.FiatValidator;
@ -33,6 +31,9 @@ import org.bitcoinj.utils.Fiat;
import javax.inject.Inject;
import viewfx.ActivatableWithDelegate;
import viewfx.ViewModel;
import javafx.beans.Observable;
import javafx.beans.binding.Bindings;
import javafx.beans.property.BooleanProperty;

View file

@ -18,8 +18,6 @@
package io.bitsquare.gui.main.trade.offerbook;
import io.bitsquare.bank.BankAccount;
import io.bitsquare.gui.Activatable;
import io.bitsquare.gui.DataModel;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.locale.Country;
import io.bitsquare.locale.CurrencyUtil;
@ -37,6 +35,9 @@ import com.google.inject.Inject;
import java.util.Comparator;
import viewfx.Activatable;
import viewfx.DataModel;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;

View file

@ -17,8 +17,6 @@
package io.bitsquare.gui.main.trade.offerbook;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.ChildView;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.OverlayManager;
import io.bitsquare.gui.components.InputTextField;
@ -37,6 +35,9 @@ import java.util.List;
import javax.inject.Inject;
import viewfx.ActivatableViewAndModel;
import viewfx.ChildView;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.collections.transformation.SortedList;
import javafx.event.ActionEvent;

View file

@ -17,8 +17,6 @@
package io.bitsquare.gui.main.trade.offerbook;
import io.bitsquare.gui.ActivatableWithDelegate;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.gui.util.validation.OptionalBtcValidator;
@ -32,6 +30,9 @@ import org.bitcoinj.utils.Fiat;
import com.google.inject.Inject;
import viewfx.ActivatableWithDelegate;
import viewfx.ViewModel;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.collections.transformation.SortedList;

View file

@ -21,8 +21,6 @@ import io.bitsquare.btc.AddressEntry;
import io.bitsquare.btc.FeePolicy;
import io.bitsquare.btc.WalletService;
import io.bitsquare.btc.listeners.BalanceListener;
import io.bitsquare.gui.Activatable;
import io.bitsquare.gui.DataModel;
import io.bitsquare.offer.Offer;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.settings.Preferences;
@ -35,6 +33,9 @@ import org.bitcoinj.utils.Fiat;
import com.google.inject.Inject;
import viewfx.Activatable;
import viewfx.DataModel;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;

View file

@ -18,7 +18,6 @@
package io.bitsquare.gui.main.trade.takeoffer;
import io.bitsquare.gui.ActivatableViewAndModel;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.OverlayManager;
import io.bitsquare.gui.components.AddressTextField;
@ -41,6 +40,8 @@ import java.util.List;
import javax.inject.Inject;
import viewfx.ActivatableViewAndModel;
import javafx.beans.property.BooleanProperty;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;

View file

@ -18,8 +18,6 @@
package io.bitsquare.gui.main.trade.takeoffer;
import io.bitsquare.btc.WalletService;
import io.bitsquare.gui.ActivatableWithDelegate;
import io.bitsquare.gui.ViewModel;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.validation.BtcValidator;
import io.bitsquare.gui.util.validation.InputValidator;
@ -32,6 +30,9 @@ import org.bitcoinj.core.Coin;
import javax.inject.Inject;
import viewfx.ActivatableWithDelegate;
import viewfx.ViewModel;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;

View file

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui;
package viewfx;
import javafx.fxml.FXML;
import javafx.scene.*;
@ -37,8 +37,4 @@ public abstract class AbstractView<R extends Node, M> implements View {
public AbstractView() {
this(null);
}
protected View loadView(Navigation.Item navigationItem) {
throw new UnsupportedOperationException("loadView not implemented");
}
}

View file

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui;
package viewfx;
public interface Activatable {
void activate();

View file

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui;
package viewfx;
import javafx.scene.*;

View file

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui;
package viewfx;
import javafx.scene.*;

View file

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui;
package viewfx;
public abstract class ActivatableWithDelegate<D extends Activatable> extends WithDelegate<D> implements Activatable {

View file

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui;
package viewfx;
public interface ChildView<Parent extends View> extends View {
void setParent(Parent parent);

View file

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui;
package viewfx;
public interface DataModel extends Model {
}

View file

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui;
package viewfx;
import java.net.URL;

View file

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui;
package viewfx;
public interface Model {
}

View file

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui;
package viewfx;
public interface View {
}

View file

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui;
package viewfx;
public interface ViewModel extends Model {
}

View file

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui;
package viewfx;
import static com.google.common.base.Preconditions.checkNotNull;

View file

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui;
package viewfx;
public interface Wizard extends View {
void nextStep(Step currentStep);

View file

@ -38,11 +38,6 @@
<logger name="io.netty.channel" level="WARN"/>
<logger name="io.netty.buffer" level="WARN"/>
<logger name="io.bitsquare.gui.DataModel" level="WARN"/>
<logger name="io.bitsquare.gui.ActivatableWithDelegate" level="WARN"/>
<logger name="io.bitsquare.gui.ViewController" level="WARN"/>
<logger name="io.bitsquare.gui.ActivatableView" level="WARN"/>
<logger name="io.bitsquare.gui.ActivatableViewAndModel" level="WARN"/>
<logger name="io.bitsquare.gui.util.Profiler" level="WARN"/>
<logger name="io.bitsquare.persistence.Persistence" level="WARN"/>
<logger name="io.bitsquare.locale.BSResources" level="OFF"/>