summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view/impl/View.java
blob: 1c1ab2d2350b6fca28cbc96339bac97d372ec350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package jrummikub.view.impl;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JFrame;

import jrummikub.view.IPlayerPanel;
import jrummikub.view.ITable;
import jrummikub.view.IView;

@SuppressWarnings("serial")
public class View extends JFrame implements IView {
  private Table table;
  private PlayerPanel playerPanel;
  
  private final static int PLAYER_PANEL_HEIGHT = 150;
  
  
  public ITable getTable() {
    return table;
  }

  public IPlayerPanel getPlayerPanel() {
    return playerPanel;
  }

  
  public View() {
    super("JRummikub");
    
    setSize(1000, 700);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    
    setLayout(new BorderLayout());
    
    table = new Table();
    add(table, BorderLayout.CENTER);

    playerPanel = new PlayerPanel();
    playerPanel.setBorder(new CustomBorder(Color.BLACK, 1, 0, 0, 0));
    playerPanel.setPreferredSize(new Dimension(0, PLAYER_PANEL_HEIGHT+1));
    add(playerPanel, BorderLayout.SOUTH);
    
    setVisible(true);
  }
}