Skip to content
Snippets Groups Projects
Commit 9e677fd5 authored by Simon Könnecke's avatar Simon Könnecke
Browse files

#14: delete unused files like Wallet.java, move methods of WalletControl.java...

#14: delete unused files like Wallet.java, move methods of WalletControl.java interface to AbstractWallet.java and drop WalletControl.java
parent a56c4c9b
No related branches found
No related tags found
1 merge request!3Preliminary result of the software
package fucoin.gui;
public interface WalletControl {
void leave();
void send(String address, int amount);
}
package fucoin.gui;
import fucoin.wallet.WalletImpl;
public class WalletControlImpl implements WalletControl {
private WalletImpl wallet;
public WalletControlImpl(WalletImpl wallet) {
this.wallet = wallet;
}
@Override
public void leave() {
wallet.leave();
}
@Override
public void send(String name, int amount) {
wallet.send(name, amount);
}
}
package fucoin.gui;
import fucoin.wallet.AbstractWallet;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
......@@ -30,7 +32,7 @@ public class WalletGuiControlImpl implements WalletGuiControl {
private JScrollPane logPane = new JScrollPane(txtLog);
private JCheckBox showDebug;
public WalletGuiControlImpl(WalletControl walletControl) {
public WalletGuiControlImpl(AbstractWallet wallet) {
window.setSize(400, 600);
window.setLayout(new GridLayout(3, 1));
......@@ -102,7 +104,7 @@ public class WalletGuiControlImpl implements WalletGuiControl {
window.setVisible(true);
btnSend.addActionListener(e -> {
walletControl.send(txtSendTo.getSelectedItem().toString(),
wallet.send(txtSendTo.getSelectedItem().toString(),
Integer.parseInt(txtSendAmount.getText()));
});
......@@ -117,7 +119,7 @@ public class WalletGuiControlImpl implements WalletGuiControl {
@Override
public void windowClosing(WindowEvent e) {
System.out.println("window closing");
walletControl.leave();
wallet.leave();
super.windowClosing(e);
}
......@@ -125,7 +127,7 @@ public class WalletGuiControlImpl implements WalletGuiControl {
@Override
public void windowClosed(WindowEvent e) {
System.out.println("window closing");
walletControl.leave();
wallet.leave();
super.windowClosing(e);
}
});
......
......@@ -65,4 +65,6 @@ public abstract class AbstractWallet extends AbstractNode {
public abstract ActorRef getRemoteSuperVisorActor();
public abstract void logTransaction(String msg);
public abstract void send(String address, int amount);
}
package fucoin.wallet;
import fucoin.gui.WalletControl;
public interface Wallet extends WalletControl {
//Vector<WalletPointer> join();
void storeOrUpdate(WalletImpl w);
void invalidateWallet(WalletImpl w);
void receiveTransaction(int amount);
//Vector<WalletPointer> searchWallet(String adress);
}
......@@ -9,10 +9,9 @@ import fucoin.actions.persist.ActionInvokeLeave;
import fucoin.actions.persist.ActionInvokeRevive;
import fucoin.actions.transaction.ActionGetAmountAnswer;
import fucoin.actions.transaction.ActionInvokeSentMoney;
import fucoin.gui.WalletControl;
import fucoin.gui.WalletGuiControl;
public class WalletImpl extends AbstractWallet implements WalletControl {
public class WalletImpl extends AbstractWallet {
private ActorRef preKnownNeighbour;
private ActorRef remoteSuperVisorActor;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment