diff --git a/bin/controller/Cashflow.class b/bin/controller/Cashflow.class index ab0b18e..837f82d 100644 Binary files a/bin/controller/Cashflow.class and b/bin/controller/Cashflow.class differ diff --git a/bin/model/CardStack.class b/bin/model/CardStack.class index 1a7713a..ce4fd7a 100644 Binary files a/bin/model/CardStack.class and b/bin/model/CardStack.class differ diff --git a/bin/view/FSWindow.class b/bin/view/FSWindow.class index c7b6db6..d12c04d 100644 Binary files a/bin/view/FSWindow.class and b/bin/view/FSWindow.class differ diff --git a/bin/view/GameboardWindow.class b/bin/view/GameboardWindow.class index 95f2eea..1f82c95 100644 Binary files a/bin/view/GameboardWindow.class and b/bin/view/GameboardWindow.class differ diff --git a/bin/view/TileButton.class b/bin/view/TileButton.class index b802234..4cdaa25 100644 Binary files a/bin/view/TileButton.class and b/bin/view/TileButton.class differ diff --git a/src/controller/Cashflow.java b/src/controller/Cashflow.java index b24804f..d47f0ce 100644 --- a/src/controller/Cashflow.java +++ b/src/controller/Cashflow.java @@ -41,6 +41,7 @@ public class Cashflow { while(!isWinner()) { + // TODO Play method // Get player whose turn it is // Display their financial statement @@ -51,6 +52,7 @@ public class Cashflow // Call tile's getLandedOn method // Update current/all players' financials // Increment player array (Also needs to wrap like tiles array) + } } @@ -76,6 +78,22 @@ public class Cashflow g.movePlayer(p1, 5); System.out.println(p1.getLocation()); + + FSWindow FSWindow = new FSWindow(); + FSWindow.prepareGUI(p1); + FSWindow.showButtonDemo(); + + + // Delay to check how the financial statement updates + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + FSWindow.prepareGUI(p2); + } diff --git a/src/view/FSWindow.java b/src/view/FSWindow.java index 66a5cfd..35e57cf 100644 --- a/src/view/FSWindow.java +++ b/src/view/FSWindow.java @@ -3,8 +3,9 @@ import java.awt.*; import java.awt.Window; import java.awt.event.*; import javax.swing.*; -import model.*; + import controller.*; +import model.*; public class FSWindow { @@ -30,11 +31,12 @@ public class FSWindow { // FSWindow.prepareGUI(); // FSWindow.showButtonDemo(); // } - private void prepareGUI(Player p) - + + public void prepareGUI(Player p) { FinancialStatement currentFS = p.getFinancialStatement(); + JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); splitPane.setOneTouchExpandable(true); splitPane.setDividerLocation(150); @@ -44,6 +46,11 @@ public class FSWindow { JPanel mainTab = new JPanel(); mainTab.setLayout(new BoxLayout(mainTab, BoxLayout.Y_AXIS)); + +// JLabel name = new JLabel(); +// JTextField playername = new JTextField(p.getNameI|()); +// name.add(playername); +// mainTab.add(name); JLabel salary = new JLabel(); JTextField salarynum = new JTextField(currentFS.getSalary()); @@ -56,7 +63,7 @@ public class FSWindow { mainTab.add(plusSymbol); JLabel passiveincome = new JLabel(); - JTextField pIncome = new JTextField(currentFS.getREcashFlow()); + JTextField pIncome = new JTextField(Integer.toString(currentFS.getREcashFlow())); passiveincome.add(pIncome); JLabel passiveMes = new JLabel("Cash Flow from Interest/Dividends and Real Estate/Business"); passiveincome.setFont(new Font("Verdana",1,35)); @@ -72,7 +79,7 @@ public class FSWindow { mainTab.add(equalSymbol); JLabel totalincome = new JLabel(); - JTextField tincomenum = new JTextField(currentFS.getTotalIncome()); + JTextField tincomenum = new JTextField(Integer.toString(currentFS.getTotalIncome())); totalincome.add(tincomenum); totalincome.setFont(new Font("Verdana",1,35)); totalincome.setAlignmentX(Component.CENTER_ALIGNMENT); @@ -84,10 +91,10 @@ public class FSWindow { mainTab.add(minusSymbol); JLabel totalexpense = new JLabel(); - JTextField texpensenum = new JTextField(currentFS.getTotalExpenses()); - totalincome.add(texpensenum); - totalincome.setFont(new Font("Verdana",1,35)); - totalincome.setAlignmentX(Component.CENTER_ALIGNMENT); + JTextField texpensenum = new JTextField(Integer.toString(currentFS.getTotalExpenses())); + totalexpense.add(texpensenum); + totalexpense.setFont(new Font("Verdana",1,35)); + totalexpense.setAlignmentX(Component.CENTER_ALIGNMENT); mainTab.add(totalexpense); JLabel equalSymbol2 = new JLabel("="); @@ -96,12 +103,24 @@ public class FSWindow { mainTab.add(equalSymbol2); JLabel cashflow = new JLabel(); - JTextField cashflownum = new JTextField(currentFS.getMonthlyCashflow()); + JTextField cashflownum = new JTextField(Integer.toString(currentFS.getMonthlyCashflow())); cashflow.add(cashflownum); totalincome.setFont(new Font("Verdana",1,35)); totalincome.setAlignmentX(Component.CENTER_ALIGNMENT); mainTab.add(cashflow); + //switchplayers button here + JButton endTurn = new JButton("End Turn"); + endTurn.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + tabbedPane.setVisible(false); + //switch to next player update method here + tabbedPane.setVisible(true); + } + }); + + mainTab.add(endTurn); + tabbedPane.addTab("Total CashFlow", mainTab); tabbedPane.setMnemonicAt(0, KeyEvent.VK_1); @@ -120,10 +139,10 @@ public class FSWindow { {"Interest/dividends", "0"}, //another table for real estate - {"Real Estate/Business",/**business of user*/}, - {"Real Estate/Business",/**business of user*/}, - {"Real Estate/Business",/**business of user*/}, - {"Real Estate/Business",/**business of user*/}, + {"Real Estate/Business",""/**business of user*/}, + {"Real Estate/Business",""/**business of user*/}, + {"Real Estate/Business",""/**business of user*/}, + {"Real Estate/Business",""/**business of user*/}, }; @@ -256,7 +275,8 @@ public class FSWindow { panel.add(filler); return panel; } - private void showButtonDemo(){ + + public void showButtonDemo(){ mainFrame.setVisible(true); } }