Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of
https://github.uconn.edu/joh13010/2102-Group-Project-Spring-2017.git

Conflicts:
	bin/model/FinancialStatement.class
	bin/view/CharityWindow$2.class
	src/model/FinancialStatement.java
  • Loading branch information
Joe Hill committed Apr 21, 2017
2 parents 2c74087 + 5b732a0 commit 597b3db
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 39 deletions.
Binary file modified bin/model/FinancialStatement.class
Binary file not shown.
Binary file modified bin/view/CharityWindow$2.class
Binary file not shown.
Binary file modified bin/view/CharityWindow$3.class
Binary file not shown.
Binary file modified bin/view/CharityWindow.class
Binary file not shown.
Binary file modified bin/view/FSWindow.class
Binary file not shown.
111 changes: 111 additions & 0 deletions src/model/FinancialStatement.java
Expand Up @@ -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;
}

}

Expand Down
6 changes: 1 addition & 5 deletions src/view/CharityWindow.java
Expand Up @@ -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);
}
});
Expand Down
73 changes: 39 additions & 34 deletions src/view/FSWindow.java
Expand Up @@ -3,7 +3,6 @@ import java.awt.*;
import java.awt.Window;
import java.awt.event.*;
import javax.swing.*;

import model.*;
import controller.*;

Expand All @@ -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();
Expand All @@ -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("+");
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -111,28 +117,28 @@ 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);

tabbedPane.addTab("Expenses", expenseTable);
tabbedPane.setMnemonicAt(2, KeyEvent.VK_3);

// private ArrayList<OwnedRealEstate> _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 );
Expand All @@ -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 );
Expand Down

0 comments on commit 597b3db

Please sign in to comment.