diff --git a/bin/model/FinancialStatement.class b/bin/model/FinancialStatement.class index dfb60c0..3594fa4 100644 Binary files a/bin/model/FinancialStatement.class and b/bin/model/FinancialStatement.class differ diff --git a/bin/view/CharityWindow$2.class b/bin/view/CharityWindow$2.class index bbc9c4f..e7767b9 100644 Binary files a/bin/view/CharityWindow$2.class and b/bin/view/CharityWindow$2.class differ diff --git a/bin/view/CharityWindow$3.class b/bin/view/CharityWindow$3.class index 275ba13..ee0ab41 100644 Binary files a/bin/view/CharityWindow$3.class and b/bin/view/CharityWindow$3.class differ diff --git a/bin/view/CharityWindow.class b/bin/view/CharityWindow.class index b5cac5e..2000558 100644 Binary files a/bin/view/CharityWindow.class and b/bin/view/CharityWindow.class differ diff --git a/bin/view/FSWindow.class b/bin/view/FSWindow.class index 701d99f..a99b9ee 100644 Binary files a/bin/view/FSWindow.class and b/bin/view/FSWindow.class differ diff --git a/src/model/FinancialStatement.java b/src/model/FinancialStatement.java index d0f805e..c3f2d1d 100644 --- a/src/model/FinancialStatement.java +++ b/src/model/FinancialStatement.java @@ -205,7 +205,118 @@ public class FinancialStatement return _totalIncome; } +<<<<<<< HEAD +======= + //income getters + public int getIncome() + { + return _income; + } + public int getSalary() + { + return _salary; + } + public int getREcashFlow() + { + return _REcashFlow; + } + + //expense getters + public int getExpenses() + { + return _expenses; + } + public int getTaxes() + { + return _taxes; + } + public int getHomeMortgagePayment() + { + return _homeMortgagePayment; + } + public int getSchoolLoanPayment() + { + return _schoolLoanPayment; + } + public int getCarLoanPayment() + { + return _carLoanPayment; + } + public int getCreditCardPayment() + { + return _creditCardPayment; + } + public int getOtherExpenses() + { + return _otherExpenses; + } + public int getPerChildExpense() + { + return _perChildExpense; + } + public int getNumChildren() + { + return _numChildren; + } + + //assets getters + public int getAssets() + { + return _assets; + } + public int getSavings() + { + return _savings; + } + + public int getStock() + { + return _stock.getNumShares() * _stock.getSharePrice(); + } + //for realestate,maybe +// public int get() +// { +// return _; +// } + + //liabilities getters + public int getLiabilities() + { + return _liabilities; + } + public int getHomeMortgage() + { + return _homeMortgage; + } + public int getSchoolLoans() + { + return _schoolLoans; + } + public int getCarLoans() + { + return _carLoans; + } + public int getCreditCardDebt() + { + return _creditCardDebt; + } + + //additonal cash flow getters + public int getMonthlySalary() + { + return _monthlySalary; + } + + public int getTotalExpenses() + { + return _totalExpenses; + } + + public int getMonthlyCashflow() { + // TODO Auto-generated method stub + return _monthlyCashFlow; + } } diff --git a/src/view/CharityWindow.java b/src/view/CharityWindow.java index dc5f5e5..39595e0 100644 --- a/src/view/CharityWindow.java +++ b/src/view/CharityWindow.java @@ -59,17 +59,13 @@ public class CharityWindow { Donate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - //put message that they donated xx dollars after 10 seconds, close window + //update cashbalance for player try { Thread.sleep(1); } catch (InterruptedException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } - - statusLabel.setText("Good Job! You donated all your savings!"); - - System.exit(0); } }); diff --git a/src/view/FSWindow.java b/src/view/FSWindow.java index 9585627..c40270d 100644 --- a/src/view/FSWindow.java +++ b/src/view/FSWindow.java @@ -3,7 +3,6 @@ import java.awt.*; import java.awt.Window; import java.awt.event.*; import javax.swing.*; - import model.*; import controller.*; @@ -18,11 +17,11 @@ public class FSWindow { public FSWindow(){ } - public static void main(String[] args){ - FSWindow FSWindow = new FSWindow(); - FSWindow.prepareGUI(); - FSWindow.showButtonDemo(); - } +// public static void main(String[] args){ +// FSWindow FSWindow = new FSWindow(); +// FSWindow.prepareGUI(); +// FSWindow.showButtonDemo(); +// } private void prepareGUI(Player p) { FinancialStatement currentFS = p.getFinancialStatement(); @@ -38,7 +37,8 @@ public class FSWindow { mainTab.setLayout(new BoxLayout(mainTab, BoxLayout.Y_AXIS)); JLabel salary = new JLabel(); - //set salary to salary variable here + JTextField salarynum = new JTextField(currentFS.getSalary()); + salary.add(salarynum); mainTab.add(salary); JLabel plusSymbol = new JLabel("+"); @@ -47,7 +47,8 @@ public class FSWindow { mainTab.add(plusSymbol); JLabel passiveincome = new JLabel(); - //set passiveincome to passiveincome variable here + JTextField pIncome = new JTextField(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)); passiveincome.setAlignmentX(Component.CENTER_ALIGNMENT); @@ -62,7 +63,8 @@ public class FSWindow { mainTab.add(equalSymbol); JLabel totalincome = new JLabel(); - //set totalincome to totalincome variable here + JTextField tincomenum = new JTextField(currentFS.getTotalIncome()); + totalincome.add(tincomenum); totalincome.setFont(new Font("Verdana",1,35)); totalincome.setAlignmentX(Component.CENTER_ALIGNMENT); mainTab.add(totalincome); @@ -73,7 +75,8 @@ public class FSWindow { mainTab.add(minusSymbol); JLabel totalexpense = new JLabel(); - //set totalexpense to totalexpense variable here + JTextField texpensenum = new JTextField(currentFS.getTotalExpenses()); + totalincome.add(texpensenum); totalincome.setFont(new Font("Verdana",1,35)); totalincome.setAlignmentX(Component.CENTER_ALIGNMENT); mainTab.add(totalexpense); @@ -84,7 +87,8 @@ public class FSWindow { mainTab.add(equalSymbol2); JLabel cashflow = new JLabel(); - //set cashflow to cashflow variable here + JTextField cashflownum = new JTextField(currentFS.getMonthlyCashflow()); + cashflow.add(cashflownum); totalincome.setFont(new Font("Verdana",1,35)); totalincome.setAlignmentX(Component.CENTER_ALIGNMENT); mainTab.add(cashflow); @@ -95,12 +99,14 @@ public class FSWindow { String[] incomeColumns = {"Description", "CashFlow"}; Object[][] income = { {"Description", "CashFlow"}, - {"Salary","" currentFS.getSalary()}, - {"Interest/dividends", ""/**call interest 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*/}, + {"Salary",currentFS.getMonthlySalary()}, + {"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*/}, }; JTable incomeTable = new JTable(income, incomeColumns); @@ -111,15 +117,13 @@ public class FSWindow { String[] expenseColumns = {"Description", "CashFlow"}; Object[][] expense = { {"Description", "CashFlow"}, - {"Taxes",""/**user variable*/}, - {"Home Mortgage Payment", ""/**user variable**/}, - {"School Loan Payment",""/**user variable**/}, - {"Car Loan Payment",""/**user variable**/}, - {"Credit Card Payment",""/**user variable**/}, - {"Other Expenses",""/**user variable**/}, - {"Bank Loan Payment",""/**user variable**/}, - {"Per Child Expense",""/**user variable**/}, - + {"Taxes", currentFS.getTaxes()}, + {"Home Mortgage Payment", currentFS.getHomeMortgagePayment()}, + {"School Loan Payment",currentFS.getSchoolLoanPayment()}, + {"Car Loan Payment",currentFS.getCarLoanPayment()}, + {"Credit Card Payment",currentFS.getCreditCardPayment()}, + {"Other Expenses", currentFS.getOtherExpenses()}, + {"Per Child Expense",currentFS.getPerChildExpense()*currentFS.getNumChildren()}, }; JTable expenseTable = new JTable(expense, expenseColumns); @@ -127,12 +131,14 @@ public class FSWindow { tabbedPane.addTab("Expenses", expenseTable); tabbedPane.setMnemonicAt(2, KeyEvent.VK_3); +// private ArrayList _realEstate; + //find how to keep adding rows from array String[] assetColumns = {"Description", "CashFlow"}; Object[][] asset = { {"Description", "CashFlow"}, - {"Savings",""/**user variable*/}, - {"Precious Metals", ""/**user variable**/}, - {"Stocks",""/**user variable**/}, //total stocks number and total money + {"Savings",currentFS.getSavings()}, + {"Precious Metals", "0"}, + {"Stocks",currentFS.getStockValue()}, //total stocks number and total money }; JTable assetTable = new JTable(asset, assetColumns ); @@ -158,11 +164,10 @@ public class FSWindow { String[] liabiltiesColumns = {"Description", "Liabilities"}; Object[][] liabilties = { {"Description", "Liabilities"}, - {"Home Mortgage",""/**user variable*/}, - {"School Loans", ""/**user variable**/}, - {"Car Loans",""/**user variable**/, ""/**user variable**/}, - {"Credit Card Debt", ""/**user variable**/}, - {"Bank Loans", ""/**user variable**/}, + {"Home Mortgage",currentFS.getHomeMortgage()}, + {"School Loans", currentFS.getSchoolLoans()}, + {"Car Loans",currentFS.getCarLoans()}, + {"Credit Card Debt", currentFS.getCreditCardDebt()}, }; JTable liabiltiesTable = new JTable(liabilties, liabiltiesColumns );