diff --git a/src/server/SwingClientGame.java b/src/server/SwingClientGame.java index 05c5c14..f82498a 100644 --- a/src/server/SwingClientGame.java +++ b/src/server/SwingClientGame.java @@ -13,8 +13,12 @@ import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; +import javax.swing.SwingConstants; import javax.swing.SwingUtilities; +import org.json.JSONArray; +import org.json.JSONObject; + import card.Card; import player.BasePlayer; @@ -24,25 +28,75 @@ JPanel gamePanel; JPanel hintPanel; JPanel flashPanel; - JPanel buttonPanel; JPanel deckPanel; JLabel[][] deckUI; - JButton hintButton; JLabel[] hintUI; JLabel[] flashUI; - JPanel[] playersUI; GridBagConstraints layoutConstr; - + // Hints + JFrame hintFrame; + JLabel[] hintTypes; + Font font; public static void main(String[] args){ new SwingClientGame(); } + private void createHintUi(){ + hintFrame = new JFrame("Hint UI"); + hintFrame.setSize(450, 150); + hintFrame.setLayout(new GridLayout(0, 5)); + hintFrame.getContentPane().setBackground(Color.black); + hintTypes = new JLabel[10]; + hintTypes[0] = new JLabel("1", SwingConstants.CENTER); + hintTypes[0].setForeground(Color.white); + hintTypes[0].addMouseListener(new HintMouseListener(new Card(-1, 0, -1))); + hintTypes[1] = new JLabel("2", SwingConstants.CENTER); + hintTypes[1].setForeground(Color.white); + hintTypes[1].addMouseListener(new HintMouseListener(new Card(-1, 1, -1))); + hintTypes[2] = new JLabel("3", SwingConstants.CENTER); + hintTypes[2].setForeground(Color.white); + hintTypes[2].addMouseListener(new HintMouseListener(new Card(-1, 2, -1))); + hintTypes[3] = new JLabel("4", SwingConstants.CENTER); + hintTypes[3].setForeground(Color.white); + hintTypes[3].addMouseListener(new HintMouseListener(new Card(-1, 3, -1))); + hintTypes[4] = new JLabel("5", SwingConstants.CENTER); + hintTypes[4].setForeground(Color.white); + hintTypes[4].addMouseListener(new HintMouseListener(new Card(-1, 4, -1))); + hintTypes[5] = new JLabel("G", SwingConstants.CENTER); + hintTypes[5].setForeground(Color.green); + hintTypes[5].addMouseListener(new HintMouseListener(new Card(GREEN, -1, -1))); + hintTypes[6] = new JLabel("R", SwingConstants.CENTER); + hintTypes[6].setForeground(Color.red); + hintTypes[6].addMouseListener(new HintMouseListener(new Card(RED, -1, -1))); + hintTypes[7] = new JLabel("Y", SwingConstants.CENTER); + hintTypes[7].setForeground(Color.yellow); + hintTypes[7].addMouseListener(new HintMouseListener(new Card(YELLOW, -1, -1))); + hintTypes[8] = new JLabel("W", SwingConstants.CENTER); + hintTypes[8].setForeground(Color.white); + hintTypes[8].addMouseListener(new HintMouseListener(new Card(WHITE, -1, -1))); + hintTypes[9] = new JLabel("B", SwingConstants.CENTER); + hintTypes[9].setForeground(Color.blue); + hintTypes[9].addMouseListener(new HintMouseListener(new Card(BLUE, -1, -1))); + for(int i=0; i