From 4d9cd05088e99ad7a5c20c6ded2ab0c558e8ac78 Mon Sep 17 00:00:00 2001 From: Jacklyn J Videira Date: Sun, 23 Apr 2017 16:23:19 -0400 Subject: [PATCH 1/4] Update GameboardWindow.java --- src/view/GameboardWindow.java | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/view/GameboardWindow.java b/src/view/GameboardWindow.java index d6d8c45..efec53c 100644 --- a/src/view/GameboardWindow.java +++ b/src/view/GameboardWindow.java @@ -4,26 +4,38 @@ import controller.*; import java.awt.*; import java.util.ArrayList; -import javax.swing.ImageIcon; -import javax.swing.JPanel; +import javax.swing.*; + import controller.Cashflow; public class GameboardWindow extends JPanel { + + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + GameboardWindow window = new GameboardWindow(board); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + private static final long serialVersionUID = 1L; - private Image img = new ImageIcon(this.getClass().getResource( - "gameboard.png")).getImage(); + private Image img = new ImageIcon(this.getClass().getResource("gameboard.png")).getImage(); - private GameBoard board; + private static GameBoard board; private Point[] points = new Point[24]; private ArrayList Positioners; public GameboardWindow(GameBoard board) { - this.board = board; + GameboardWindow.board = board; Dimension size = new Dimension(img.getWidth(null), img.getHeight(null)); setPreferredSize(size); setMinimumSize(size); @@ -186,7 +198,7 @@ public class GameboardWindow extends JPanel { 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 + int y = (int) points[Player[i].getLocation()].getY(); // Positioners.get(i).setX(x); Positioners.get(i).setY(y); From c928038ac89890e5d280045a0e3ca60ac4b3ff97 Mon Sep 17 00:00:00 2001 From: Jacklyn J Videira Date: Sun, 23 Apr 2017 16:24:43 -0400 Subject: [PATCH 2/4] Update Cashflow.java --- src/controller/Cashflow.java | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/controller/Cashflow.java b/src/controller/Cashflow.java index d47f0ce..2cbd148 100644 --- a/src/controller/Cashflow.java +++ b/src/controller/Cashflow.java @@ -13,6 +13,9 @@ public class Cashflow //private CardStack[] _cards; public GameboardWindow gameboard; public static int numPlayers; + private JFrame frame; + private JWindow sidewindow; + private GameboardWindow window; @@ -122,6 +125,31 @@ public class Cashflow } + } + public void setUpScreen() { + frame = new JFrame("Cashflow"); + frame.setLayout(new FlowLayout()); + window = new GameboardWindow(_board); + + sidewindow = new JWindow(); + sidewindow.setLayout(new GridLayout(5, 5)); + + frame.add(window); + + + frame.pack(); + + frame.setVisible(true); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + } + public static void main(String[] args) { + new Cashflow(4); + + } + public Cashflow(int numPlayers) + { + //this.setUpScreen(); // just did this to test the screen + } } From d317043d89b78834d20da9369e17985fd24e7418 Mon Sep 17 00:00:00 2001 From: Jacklyn J Videira Date: Sun, 23 Apr 2017 16:25:18 -0400 Subject: [PATCH 3/4] egit hates me --- src/view/TileButton.java | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/view/TileButton.java b/src/view/TileButton.java index 3aafc82..413d2cc 100644 --- a/src/view/TileButton.java +++ b/src/view/TileButton.java @@ -11,13 +11,14 @@ public class TileButton extends JButton { private static final long serialVersionUID = 1L; private Tile tile; + private int tileNumber; public TileButton(String name, int TileOnBoard, GameBoard board) { super(name); - tile = board.getTile(TileOnBoard); - // this.setOpaque(false); + this.setContentAreaFilled(false); + setTileNumber(TileOnBoard); // this.setBorderPainted(false); this.setVisible(true); @@ -28,5 +29,30 @@ public class TileButton extends JButton { public void paint(Graphics g) { // Do nothing here } } + + + + + public Tile getTile() { + return tile; + } + + + + public void setTile(Tile tile) { + this.tile = tile; + } + + + + public int getTileNumber() { + return tileNumber; + } + + + + public void setTileNumber(int tileNumber) { + this.tileNumber = tileNumber; + } } From d43683f2731b5212e5a6fe90c1aec37618da1c4d Mon Sep 17 00:00:00 2001 From: Jacklyn J Videira Date: Sun, 23 Apr 2017 16:29:51 -0400 Subject: [PATCH 4/4] egit hates me --- src/controller/Cashflow.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/controller/Cashflow.java b/src/controller/Cashflow.java index 2cbd148..85af874 100644 --- a/src/controller/Cashflow.java +++ b/src/controller/Cashflow.java @@ -3,6 +3,8 @@ package controller; import view.*; import java.util.ArrayList; +import java.awt.*; +import java.swing.*; import model.*;