diff --git a/src/main/java/fucoin/Main.java b/src/main/java/fucoin/Main.java index 4cdd54c3efbda61988d113411f1e1dad62a02859..892daeb04017a834dfa2bd5d9c2b2a053cf0571b 100644 --- a/src/main/java/fucoin/Main.java +++ b/src/main/java/fucoin/Main.java @@ -6,7 +6,6 @@ import akka.actor.Props; import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; import fucoin.actions.join.ActionJoinAnswer; -import fucoin.actions.join.ServerActionJoin; import fucoin.supervisor.SuperVisorImpl; import fucoin.wallet.WalletImpl; @@ -59,11 +58,12 @@ public class Main { private static void createWallets() { //Init Wallets for (int i = 0; i < numberOfWallets; i++) { + String nameOfTheWallet = "Wallet" + String.valueOf(i); - //chain the wallets. wallet2 knows wallet1, wallet3 knows wallet2 and so on. - String nameOfThePreviousWallet = ""; Props props; + if (i > 0) { + //chain the wallets. wallet2 knows wallet1, wallet3 knows wallet2 and so on. props = WalletImpl.props(cActiveActors.get(i - 1), nameOfTheWallet); } else { props = WalletImpl.props(null, nameOfTheWallet); diff --git a/src/main/java/fucoin/gui/WalletGuiControlImpl.java b/src/main/java/fucoin/gui/WalletGuiControlImpl.java index dbc86516cfc8dbdbbc6e75f83996a02d8c6bcc0c..0a001f06c7a5b41dd83bf89e55863ce7f4cd391a 100644 --- a/src/main/java/fucoin/gui/WalletGuiControlImpl.java +++ b/src/main/java/fucoin/gui/WalletGuiControlImpl.java @@ -16,9 +16,8 @@ public class WalletGuiControlImpl implements WalletGuiControl { private JPanel topPanel = new JPanel(); private JLabel lblMyAddress = new JLabel("My Address:"); private JTextField txtMyAddress = new JTextField("<MyAddress>"); - private JLabel lblEmpty = new JLabel(""); - private JLabel lblMyAmount = new JLabel("My FUCs:"); - private JTextField txtMyAmount = new JTextField("<MyFUCs>"); + private JLabel lblMyAmount = new JLabel("My FUCs: "); + private JLabel txtMyAmount = new JLabel(" <MyFUCs>"); private JPanel centerPanel = new JPanel(); private JLabel lblSendTo = new JLabel("Send to:"); private JComboBox<String> txtSendTo = new JComboBox<>(); @@ -45,11 +44,12 @@ public class WalletGuiControlImpl implements WalletGuiControl { row1.add(txtMyAddress); topPanel.add(row1); // Row 2 - JPanel row2 = new JPanel(); - row2.setLayout(new GridLayout(1, 3)); + JPanel row2 = new JPanel(new GridBagLayout()); + Font fucFont = txtMyAmount.getFont().deriveFont(20f).deriveFont(Font.BOLD); + lblMyAmount.setFont(fucFont); + txtMyAmount.setFont(fucFont); row2.add(lblMyAmount); row2.add(txtMyAmount); - row2.add(lblEmpty); topPanel.add(row2); window.add(topPanel); //<hr> @@ -69,8 +69,6 @@ public class WalletGuiControlImpl implements WalletGuiControl { addNewButton.addActionListener(e -> { ActorSelection selection = wallet.getContext().actorSelection(sendToNewEdt.getText()); System.out.println(selection); - //selection.tell("Hallo!", self()); - //txtSendTo.addItem(); }); centerup2.add(addNewButton, BorderLayout.EAST); centerPanel.add(centerup2); @@ -82,7 +80,7 @@ public class WalletGuiControlImpl implements WalletGuiControl { centerdown.add(txtSendAmount); centerdown.add(btnSend); centerPanel.add(centerdown); - //centerPanel.add(new JLabel("")); + // Row 3 JPanel centerdown2 = new JPanel(); centerdown2.setLayout(new GridLayout(1, 3)); @@ -91,7 +89,8 @@ public class WalletGuiControlImpl implements WalletGuiControl { centerdown2.add(btnExit); centerPanel.add(centerdown2); window.add(centerPanel); - //<hr> + + bottomPanel.setLayout(new BorderLayout()); showDebug = new JCheckBox("Show debug messages in transaction log"); diff --git a/src/main/java/fucoin/wallet/AbstractWallet.java b/src/main/java/fucoin/wallet/AbstractWallet.java index 13faa08516d20cc872b2bdaf48f0e8e9d6f35a57..100d47242ea011a5406e0aab7b19b3cfee57390b 100644 --- a/src/main/java/fucoin/wallet/AbstractWallet.java +++ b/src/main/java/fucoin/wallet/AbstractWallet.java @@ -3,10 +3,12 @@ package fucoin.wallet; import akka.actor.ActorRef; import fucoin.AbstractNode; +import java.io.Serializable; + /** * */ -public abstract class AbstractWallet extends AbstractNode { +public abstract class AbstractWallet extends AbstractNode implements Serializable{ /** * Currently amount of this wallet diff --git a/src/main/java/fucoin/wallet/WalletImpl.java b/src/main/java/fucoin/wallet/WalletImpl.java index a3eadeaf0cf10ac96c1d20c933bb17c703a77e13..c6945830f8a771aae365e68b7aba092175a00e7f 100644 --- a/src/main/java/fucoin/wallet/WalletImpl.java +++ b/src/main/java/fucoin/wallet/WalletImpl.java @@ -13,16 +13,12 @@ import fucoin.actions.persist.ActionInvokeRevive; import fucoin.actions.transaction.ActionGetAmountAnswer; import fucoin.actions.transaction.ActionInvokeSentMoney; import fucoin.gui.WalletGuiControl; -import scala.concurrent.Await; - -import javax.swing.*; -import java.util.concurrent.TimeUnit; public class WalletImpl extends AbstractWallet { private ActorRef preKnownNeighbour; private ActorRef remoteSuperVisorActor; - private WalletGuiControl gui; + private transient WalletGuiControl gui; private String preKnownNeighbourName; private boolean isActive;