diff --git a/bin/.gitignore b/bin/.gitignore index 4a6964c..1b12d5f 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,10 +1,15 @@ <<<<<<< HEAD -/view/ -/controller/ -/model/ +<<<<<<< HEAD +======= ======= +>>>>>>> branch 'master' of https://github.uconn.edu/joh13010/2102-Group-Project-Spring-2017.git /.DS_Store /controller/ /model/ +<<<<<<< HEAD +>>>>>>> branch 'master' of https://github.uconn.edu/joh13010/2102-Group-Project-Spring-2017.git +/view/ +/Instructions.class +======= /view/ >>>>>>> branch 'master' of https://github.uconn.edu/joh13010/2102-Group-Project-Spring-2017.git diff --git a/bin/controller/Cashflow.class b/bin/controller/Cashflow.class index 17ef4fc..9534ad5 100644 Binary files a/bin/controller/Cashflow.class and b/bin/controller/Cashflow.class differ diff --git a/bin/model/BigDealStack.class b/bin/model/BigDealStack.class index a820dd7..5a27ad0 100644 Binary files a/bin/model/BigDealStack.class and b/bin/model/BigDealStack.class differ diff --git a/bin/model/Card.class b/bin/model/Card.class index fb749aa..282d93b 100644 Binary files a/bin/model/Card.class and b/bin/model/Card.class differ diff --git a/bin/model/CardStack.class b/bin/model/CardStack.class index d9e4bf9..1a7713a 100644 Binary files a/bin/model/CardStack.class and b/bin/model/CardStack.class differ diff --git a/bin/model/CharityTile.class b/bin/model/CharityTile.class index 80cfd97..f8d159f 100644 Binary files a/bin/model/CharityTile.class and b/bin/model/CharityTile.class differ diff --git a/bin/model/ChildTile.class b/bin/model/ChildTile.class index 54da5e4..e2fc4d2 100644 Binary files a/bin/model/ChildTile.class and b/bin/model/ChildTile.class differ diff --git a/bin/model/DealCard.class b/bin/model/DealCard.class index adc8ef1..9a51abb 100644 Binary files a/bin/model/DealCard.class and b/bin/model/DealCard.class differ diff --git a/bin/model/DealTile.class b/bin/model/DealTile.class index 7d9238f..a1678a6 100644 Binary files a/bin/model/DealTile.class and b/bin/model/DealTile.class differ diff --git a/bin/model/Die.class b/bin/model/Die.class index 3884acd..e319493 100644 Binary files a/bin/model/Die.class and b/bin/model/Die.class differ diff --git a/bin/model/DoodadCard.class b/bin/model/DoodadCard.class index 8e23482..538f415 100644 Binary files a/bin/model/DoodadCard.class and b/bin/model/DoodadCard.class differ diff --git a/bin/model/DoodadStack.class b/bin/model/DoodadStack.class index b3885f0..f68cac1 100644 Binary files a/bin/model/DoodadStack.class and b/bin/model/DoodadStack.class differ diff --git a/bin/model/DoodadTile.class b/bin/model/DoodadTile.class index d47f229..096bde6 100644 Binary files a/bin/model/DoodadTile.class and b/bin/model/DoodadTile.class differ diff --git a/bin/model/FinancialStatement.class b/bin/model/FinancialStatement.class index 959a191..b4715fd 100644 Binary files a/bin/model/FinancialStatement.class and b/bin/model/FinancialStatement.class differ diff --git a/bin/model/Handler.class b/bin/model/Handler.class deleted file mode 100644 index 168fca9..0000000 Binary files a/bin/model/Handler.class and /dev/null differ diff --git a/bin/model/MarketCard.class b/bin/model/MarketCard.class index 10982d5..62aad7c 100644 Binary files a/bin/model/MarketCard.class and b/bin/model/MarketCard.class differ diff --git a/bin/model/MarketStack.class b/bin/model/MarketStack.class index 6c75bff..cf1b145 100644 Binary files a/bin/model/MarketStack.class and b/bin/model/MarketStack.class differ diff --git a/bin/model/OwnedRealEstate.class b/bin/model/OwnedRealEstate.class index b9ca4f6..500d944 100644 Binary files a/bin/model/OwnedRealEstate.class and b/bin/model/OwnedRealEstate.class differ diff --git a/bin/model/PaydayTile.class b/bin/model/PaydayTile.class index fde1634..631fb20 100644 Binary files a/bin/model/PaydayTile.class and b/bin/model/PaydayTile.class differ diff --git a/bin/model/Player.class b/bin/model/Player.class index 980dae0..f6c8e85 100644 Binary files a/bin/model/Player.class and b/bin/model/Player.class differ diff --git a/bin/model/Profession.class b/bin/model/Profession.class index 8fdeb61..8206775 100644 Binary files a/bin/model/Profession.class and b/bin/model/Profession.class differ diff --git a/bin/model/Professions.class b/bin/model/Professions.class index 41ab535..491de07 100644 Binary files a/bin/model/Professions.class and b/bin/model/Professions.class differ diff --git a/bin/model/SmallDealStack.class b/bin/model/SmallDealStack.class index 143fd12..8b79e20 100644 Binary files a/bin/model/SmallDealStack.class and b/bin/model/SmallDealStack.class differ diff --git a/bin/model/Stock.class b/bin/model/Stock.class index 605e025..b348dae 100644 Binary files a/bin/model/Stock.class and b/bin/model/Stock.class differ diff --git a/bin/model/TileCircularLinkedList$Node.class b/bin/model/TileCircularLinkedList$Node.class index 64dfb0f..06495c6 100644 Binary files a/bin/model/TileCircularLinkedList$Node.class and b/bin/model/TileCircularLinkedList$Node.class differ diff --git a/bin/model/TileCircularLinkedList.class b/bin/model/TileCircularLinkedList.class index 1d7bd34..51b60d5 100644 Binary files a/bin/model/TileCircularLinkedList.class and b/bin/model/TileCircularLinkedList.class differ diff --git a/bin/view/CharityWindow$1.class b/bin/view/CharityWindow$1.class index e815cf8..f38a143 100644 Binary files a/bin/view/CharityWindow$1.class and b/bin/view/CharityWindow$1.class differ diff --git a/bin/view/CharityWindow$2.class b/bin/view/CharityWindow$2.class index e7767b9..9816afb 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 ee0ab41..9da374b 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 2000558..d954bf3 100644 Binary files a/bin/view/CharityWindow.class and b/bin/view/CharityWindow.class differ diff --git a/bin/view/ChildWindow$1.class b/bin/view/ChildWindow$1.class index a63c280..efd900f 100644 Binary files a/bin/view/ChildWindow$1.class and b/bin/view/ChildWindow$1.class differ diff --git a/bin/view/ChildWindow$2.class b/bin/view/ChildWindow$2.class index 35fa16f..0120329 100644 Binary files a/bin/view/ChildWindow$2.class and b/bin/view/ChildWindow$2.class differ diff --git a/bin/view/ChildWindow.class b/bin/view/ChildWindow.class index 00056a1..6f698fb 100644 Binary files a/bin/view/ChildWindow.class and b/bin/view/ChildWindow.class differ diff --git a/bin/view/DoodadCardWindow$1.class b/bin/view/DoodadCardWindow$1.class index 2dba6e0..bdc151b 100644 Binary files a/bin/view/DoodadCardWindow$1.class and b/bin/view/DoodadCardWindow$1.class differ diff --git a/bin/view/DoodadCardWindow$2.class b/bin/view/DoodadCardWindow$2.class new file mode 100644 index 0000000..a37a3bc Binary files /dev/null and b/bin/view/DoodadCardWindow$2.class differ diff --git a/bin/view/DoodadCardWindow.class b/bin/view/DoodadCardWindow.class index 7f68037..0be9d16 100644 Binary files a/bin/view/DoodadCardWindow.class and b/bin/view/DoodadCardWindow.class differ diff --git a/bin/view/DownSizeWindow$1.class b/bin/view/DownSizeWindow$1.class index f33d97e..52f3a74 100644 Binary files a/bin/view/DownSizeWindow$1.class and b/bin/view/DownSizeWindow$1.class differ diff --git a/bin/view/DownSizeWindow.class b/bin/view/DownSizeWindow.class index 2f1231e..241aa27 100644 Binary files a/bin/view/DownSizeWindow.class and b/bin/view/DownSizeWindow.class differ diff --git a/bin/view/FSWindow.class b/bin/view/FSWindow.class index 99b261e..a624dfc 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 06f8a0b..dceacd1 100644 Binary files a/bin/view/GameboardWindow.class and b/bin/view/GameboardWindow.class differ diff --git a/bin/view/MainWindow$1.class b/bin/view/MainWindow$1.class index 5c3d145..cd197be 100644 Binary files a/bin/view/MainWindow$1.class and b/bin/view/MainWindow$1.class differ diff --git a/bin/view/MainWindow.class b/bin/view/MainWindow.class index 2f9e5fe..48940ab 100644 Binary files a/bin/view/MainWindow.class and b/bin/view/MainWindow.class differ diff --git a/bin/view/MainWindow1$1.class b/bin/view/MainWindow1$1.class index 0300272..0720031 100644 Binary files a/bin/view/MainWindow1$1.class and b/bin/view/MainWindow1$1.class differ diff --git a/bin/view/MainWindow1.class b/bin/view/MainWindow1.class index edc924e..9d49cf6 100644 Binary files a/bin/view/MainWindow1.class and b/bin/view/MainWindow1.class differ diff --git a/bin/view/Positioner.class b/bin/view/Positioner.class index 32ebf82..588f16b 100644 Binary files a/bin/view/Positioner.class and b/bin/view/Positioner.class differ diff --git a/bin/view/SDStockCardWindow$1.class b/bin/view/SDStockCardWindow$1.class index c11d678..09d4e6f 100644 Binary files a/bin/view/SDStockCardWindow$1.class and b/bin/view/SDStockCardWindow$1.class differ diff --git a/bin/view/SDStockCardWindow$2.class b/bin/view/SDStockCardWindow$2.class index aab4f8a..02dbdb4 100644 Binary files a/bin/view/SDStockCardWindow$2.class and b/bin/view/SDStockCardWindow$2.class differ diff --git a/bin/view/SDStockCardWindow$3.class b/bin/view/SDStockCardWindow$3.class index 2921fb3..e2d8af2 100644 Binary files a/bin/view/SDStockCardWindow$3.class and b/bin/view/SDStockCardWindow$3.class differ diff --git a/bin/view/SDStockCardWindow.class b/bin/view/SDStockCardWindow.class index 43b9ea3..c2b2d14 100644 Binary files a/bin/view/SDStockCardWindow.class and b/bin/view/SDStockCardWindow.class differ diff --git a/bin/view/TileButton.class b/bin/view/TileButton.class index 2c088ec..56055d0 100644 Binary files a/bin/view/TileButton.class and b/bin/view/TileButton.class differ diff --git a/bin/view/Window.class b/bin/view/Window.class index c68be93..fe71bb5 100644 Binary files a/bin/view/Window.class and b/bin/view/Window.class differ diff --git a/gameboard.png b/gameboard.png new file mode 100644 index 0000000..50aaab3 Binary files /dev/null and b/gameboard.png differ diff --git a/src/controller/Cashflow.java b/src/controller/Cashflow.java index 631612b..d7d2c96 100644 --- a/src/controller/Cashflow.java +++ b/src/controller/Cashflow.java @@ -1,27 +1,24 @@ package controller; import view.*; + +import java.util.ArrayList; + import model.*; public class Cashflow { - - private GameBoard _board; - private Player[] _players; + public Player[] players; //private CardStack[] _cards; + public GameboardWindow gameboard; + public static int numPlayers; + - public static void main(String[] args) - { - /* - * Just testing stuff in here for now. Main method will call the go() method when game is built - */ - testGamePlay(); - - } - public void go() + public static void go() { + System.out.println("Start game"); // Joe // Initialize game board // Initialize GUI @@ -59,7 +56,7 @@ public class Cashflow public boolean isWinner() { boolean isWinner = false; - for(Player p : _players) + for(Player p : players) { if(p.hasWon()) { diff --git a/src/model/Handler.java b/src/model/Handler.java deleted file mode 100644 index 8515231..0000000 --- a/src/model/Handler.java +++ /dev/null @@ -1,25 +0,0 @@ -package model; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - - -public class Handler implements ActionListener { - private int rent, price, locationOnBoard; - private Tile tile; - - public Handler(int price, int rent, Tile tile, int locationOnBoard, - GameBoard board) { - this.price = price; - this.rent = rent; - this.tile = tile; - this.locationOnBoard = locationOnBoard; - - } - - public void actionPerformed(ActionEvent event) { - // refer to getLandedOn? Or one of the decision/card windows? How do i do this i am tired - - } - -} diff --git a/src/model/Instructions.java b/src/model/Instructions.java new file mode 100644 index 0000000..665cdb8 --- /dev/null +++ b/src/model/Instructions.java @@ -0,0 +1,10 @@ +package model; + +public class Instructions +{ + public static void getClicked() + { + System.out.println("You thought we were just going to GIVE you the instructions?"); + System.out.println("HAHAHAHAH"); + } +} diff --git a/src/model/Player.java b/src/model/Player.java index 5d2fbcb..5afc969 100644 --- a/src/model/Player.java +++ b/src/model/Player.java @@ -6,7 +6,7 @@ public class Player private boolean _donate; private int _charityCount; //charity counter private int _downsizeCount; //down size counter - private int _location; + private int _location;//refers to a tile number private boolean _hasWon; public Player() diff --git a/src/view/.DS_Store b/src/view/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/src/view/.DS_Store differ diff --git a/src/view/DealCardWindow.java b/src/view/DealCardWindow.java index e4f9b87..0dcf33d 100644 --- a/src/view/DealCardWindow.java +++ b/src/view/DealCardWindow.java @@ -88,8 +88,8 @@ public class DealCardWindow { JButton BigDeal = new JButton("BigDeal"); JButton SmallDeal = new JButton("SmallDeal"); SmallDeal.setHorizontalTextPosition(SwingConstants.LEFT); - JButton AcceptDeal = new JButton("Accept Deal"); - JButton DeclineDeal = new JButton("Decline Deal"); + final JButton AcceptDeal = new JButton("Accept Deal"); + final JButton DeclineDeal = new JButton("Decline Deal"); DeclineDeal.setHorizontalTextPosition(SwingConstants.LEFT); BigDeal.addActionListener(new ActionListener() { @@ -143,5 +143,5 @@ public class DealCardWindow { controlPanel.add(SmallDeal); mainFrame.setVisible(true); return response; - } + } } diff --git a/src/view/DoodadCardWindow.java b/src/view/DoodadCardWindow.java index d93e80d..a27ce9c 100644 --- a/src/view/DoodadCardWindow.java +++ b/src/view/DoodadCardWindow.java @@ -16,6 +16,8 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingConstants; +import model.DoodadCard; + public class DoodadCardWindow { private JFrame mainFrame; private JLabel headerLabel; @@ -23,7 +25,7 @@ public class DoodadCardWindow { private JPanel controlPanel; public DoodadCardWindow(){ - prepareGUI(); + prepareGUI(null); } public static void main(String[] args){ DoodadCardWindow DoodadCardWindow = new DoodadCardWindow(); diff --git a/src/view/FSWindow.java b/src/view/FSWindow.java index 054490d..6c7c633 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 { @@ -17,11 +18,20 @@ public class FSWindow { public FSWindow(){ } +/* + public static void main(String[] args){ + FSWindow FSWindow = new FSWindow(); + FSWindow.prepareGUI(); + FSWindow.showButtonDemo(); + }*/ + //private void prepareGUI() + // public static void main(String[] args){ // FSWindow FSWindow = new FSWindow(); // FSWindow.prepareGUI(); // FSWindow.showButtonDemo(); // } + public void prepareGUI(Player p) { FinancialStatement currentFS = p.getFinancialStatement(); @@ -99,14 +109,30 @@ 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 +<<<<<<< HEAD {"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*/}, + +>>>>>>> branch 'master' of https://github.uconn.edu/joh13010/2102-Group-Project-Spring-2017.git }; JTable incomeTable = new JTable(income, incomeColumns); diff --git a/src/view/GameboardWindow.java b/src/view/GameboardWindow.java index 29b0969..d6d8c45 100644 --- a/src/view/GameboardWindow.java +++ b/src/view/GameboardWindow.java @@ -1,27 +1,27 @@ package view; import model.*; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Image; - -import java.awt.Point; -import java.awt.geom.Path2D; +import controller.*; +import java.awt.*; import java.util.ArrayList; import javax.swing.ImageIcon; import javax.swing.JPanel; +import controller.Cashflow; + public class GameboardWindow extends JPanel { + private static final long serialVersionUID = 1L; private Image img = new ImageIcon(this.getClass().getResource( "gameboard.png")).getImage(); - private GameBoard board; // + private GameBoard board; private Point[] points = new Point[24]; private ArrayList Positioners; + public GameboardWindow(GameBoard board) { this.board = board; Dimension size = new Dimension(img.getWidth(null), img.getHeight(null)); @@ -45,6 +45,7 @@ public class GameboardWindow extends JPanel { public void setUpTiles() { // implement the tiles into the graphical boardspace // the buttons are going to be a little off as i couldnt figure out how to rotate jbuttons +// i guess it doesnt really matter what tile is which but the position matters - 0 is starting TileButton t1 = new TileButton("Deal", 0, board); this.add(t1); t1.setBounds(125,532,95,20); //xstart,ystart,width,height @@ -182,11 +183,10 @@ public class GameboardWindow extends JPanel { } - public void update(ArrayList locP) { - for (int i = 0; i < locP.size(); i++) { - int x = (int) points[locP.get(i)].getX(); - int y = (int) points[locP.get(i)].getY(); - + public void update() { //updates the location of the player on the board + for (int i = 0; i < Cashflow.numPlayers; i++) { + int x = (int) points[Player[i].getLocation()].getX(); // i will fix this later + int y = (int) points[Player[i].getLocation()].getY(); // hopefully lol Positioners.get(i).setX(x); Positioners.get(i).setY(y); @@ -197,4 +197,5 @@ public class GameboardWindow extends JPanel { + } diff --git a/src/view/MainMenu.java b/src/view/MainMenu.java new file mode 100644 index 0000000..bbda534 --- /dev/null +++ b/src/view/MainMenu.java @@ -0,0 +1,285 @@ +package view; + +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.image.BufferedImage; +import java.io.*; + +import javax.imageio.ImageIO; +import javax.swing.*; + +import controller.Cashflow; +import model.Instructions; + +public class MainMenu +{ + public static void main (String[] args) + { + final JFrame frame = new JFrame("CashFlow"); + + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setSize(650,530); + Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); + int x = (int) ((dimension.getWidth() - frame.getWidth()) / 2); + int y = (int) ((dimension.getHeight() - frame.getHeight()) / 2) -100; + frame.setLocation(x, y); + + final JPanel panel1 = new JPanel(); + panel1.setSize(140, 45); + panel1.setLocation(255, 125); + panel1.setOpaque(false); + //Font font = new Font ("Times New Roman", Font.BOLD, 30); + //panel1.setFont(font); + + final JPanel panel2 = new JPanel(); + panel2.setSize(140, 45); + panel2.setLocation(255, 160); + panel2.setOpaque(false); + + final JPanel panel3 = new JPanel(); + panel3.setSize(140, 45); + panel3.setLocation(255, 260); + panel3.setOpaque(false); + + final JPanel panel4 = new JPanel(); + panel4.setSize(140, 45); + panel4.setLocation(255, 295); + panel4.setOpaque(false); + + final JPanel panel5 = new JPanel(); + panel5.setSize(140, 45); + panel5.setLocation(255, 330); + panel5.setOpaque(false); + + final JPanel panel6 = new JPanel(); + panel6.setSize(140, 45); + panel6.setLocation(180, 158); + panel6.setOpaque(false); + + final JPanel panel7 = new JPanel(); + panel7.setSize(140, 45); + panel7.setLocation(260, 158); + panel7.setOpaque(false); + + final JPanel panel8 = new JPanel(); + panel8.setSize(140, 45); + panel8.setLocation(340, 158); + panel8.setOpaque(false); + + final JPanel panel9 = new JPanel(); + panel9.setSize(300, 45); + panel9.setLocation(185, 140); + panel9.setOpaque(false); + + final JPanel panel10 = new JPanel(); + panel10.setSize(300, 45); + panel10.setLocation(175, 120); + panel10.setOpaque(false); + + final JPanel panel11 = new JPanel(); + panel11.setSize(300, 50); + panel11.setLocation(175, 125); + panel11.setOpaque(false); + + final JPanel panel12 = new JPanel(); + panel12.setSize(300, 50); + panel12.setLocation(175, 160); + panel12.setOpaque(false); + + final JPanel panel13 = new JPanel(); + panel13.setSize(300, 50); + panel13.setLocation(125, 260); + panel13.setOpaque(false); + + final JPanel panel14 = new JPanel(); + panel14.setSize(300, 50); + panel14.setLocation(250, 260); + panel14.setOpaque(false); + + final JPanel panel15 = new JPanel(); + panel15.setSize(300, 50); + panel15.setLocation(175, 295); + panel15.setOpaque(false); + + JLabel choose = new JLabel("Choose"); + JLabel players = new JLabel("number of players"); + choose.setFont(new Font("Verdana", 1, 16)); + players.setFont(new Font("Verdana", 1, 16)); + + + JButton newGame = new JButton("New Game"); + JButton savedGame = new JButton("Saved Game"); + JButton rules = new JButton("Rules"); + JButton settings = new JButton("Settings"); + JButton exit = new JButton("Exit"); + JButton four = new JButton ("Four"); + JButton five = new JButton ("Five"); + JButton six = new JButton ("Six"); + JTextField player1 = new JTextField("Player 1"); + JTextField player2 = new JTextField("Player 2"); + JTextField player3 = new JTextField("Player 3"); + JTextField player4 = new JTextField("Player 4"); + JButton start = new JButton("Start"); + + newGame.setPreferredSize(new Dimension(140,40)); + newGame.setForeground(Color.MAGENTA); + + savedGame.setPreferredSize(new Dimension(130,40)); + savedGame.setForeground(Color.MAGENTA); + + rules.setPreferredSize(new Dimension(80,40)); + rules.setForeground(Color.MAGENTA); + + settings.setPreferredSize(new Dimension(120,40)); + settings.setForeground(Color.MAGENTA); + + exit.setPreferredSize(new Dimension(100,40)); + exit.setForeground(Color.MAGENTA); + + four.setPreferredSize(new Dimension(80,40)); + four.setForeground(Color.MAGENTA); + + five.setPreferredSize(new Dimension(80,40)); + five.setForeground(Color.MAGENTA); + + six.setPreferredSize(new Dimension(80,40)); + six.setForeground(Color.MAGENTA); + + start.setPreferredSize(new Dimension(100,40)); + start.setForeground(Color.MAGENTA); + + player1.setPreferredSize(new Dimension(125,40)); + player2.setPreferredSize(new Dimension(125,40)); + player3.setPreferredSize(new Dimension(125,40)); + player4.setPreferredSize(new Dimension(125,40)); + + + + BufferedImage img = null; + try { + img = ImageIO.read(new File("gameboard.png")); + } catch (IOException e) { + e.printStackTrace(); + } + Image dimg = img.getScaledInstance(800, 508, Image.SCALE_SMOOTH); + ImageIcon imageIcon = new ImageIcon(dimg); + frame.setContentPane(new JLabel(imageIcon)); + frame.getContentPane().add(new JLabel(imageIcon)); + + + panel1.add(newGame); + panel2.add(savedGame); + panel3.add(rules); + panel4.add(settings); + panel5.add(exit); + panel6.add(four); + panel7.add(five); + panel8.add(six); + panel9.add(players); + panel10.add(choose); + panel11.add(player1); + panel12.add(player2); + panel13.add(player3); + panel14.add(player4); + panel15.add(start); + + frame.add(panel1); + frame.add(panel2); + frame.add(panel3); + frame.add(panel4); + frame.add(panel5); + frame.setVisible(true); + + newGame.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + frame.setVisible(false); + frame.remove(panel1); + frame.remove(panel2); + + frame.add(panel6); + frame.add(panel7); + frame.add(panel8); + frame.add(panel9); + frame.add(panel10); + frame.setVisible(true); + } + }); + + rules.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + frame.dispose(); + Instructions.getClicked(); + } + }); + + four.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + frame.setVisible(false); + frame.remove(panel3); + frame.remove(panel4); + frame.remove(panel6); + frame.remove(panel7); + frame.remove(panel8); + frame.remove(panel9); + frame.remove(panel10); + + frame.add(panel11); + frame.add(panel12); + frame.add(panel13); + frame.add(panel14); + frame.add(panel15); + frame.setVisible(true); + } + }); + + exit.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + System.exit(0); + } +}); + + player1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + + System.exit(0); + } +}); + + player2.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + + System.exit(0); + } +}); + player3.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + + System.exit(0); + } +}); + + player4.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + + System.exit(0); + } +}); + + start.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + frame.dispose(); + Cashflow.go(); + System.exit(0); + } +}); + + + } + +} + diff --git a/src/view/MainWindow.java b/src/view/MainWindow.java index ea95c70..156df7d 100644 --- a/src/view/MainWindow.java +++ b/src/view/MainWindow.java @@ -2,6 +2,7 @@ package view; import java.awt.*; + import javax.swing.JFrame; import javax.swing.JPanel; diff --git a/src/view/TileButton.java b/src/view/TileButton.java index c3c06c8..3aafc82 100644 --- a/src/view/TileButton.java +++ b/src/view/TileButton.java @@ -11,7 +11,6 @@ public class TileButton extends JButton { private static final long serialVersionUID = 1L; private Tile tile; - private int rent, price; public TileButton(String name, int TileOnBoard, GameBoard board) { super(name); @@ -20,27 +19,11 @@ public class TileButton extends JButton { // this.setOpaque(false); this.setContentAreaFilled(false); // this.setBorderPainted(false); - - this.setInts(); this.setVisible(true); - Handler hand = new Handler(price, rent, tile, TileOnBoard, - board); - this.addActionListener(hand); } - public void setInts() { - - if (this.tile instanceof Tile) { - /* - * i dont actually really like this method - * but i think it should be like that iterator in cash flow - * that determines moving over the tiles and if it's landed on - * the gui should be brought up already in the handler method - */ - } - } public void paint(Graphics g) { // Do nothing here }