Warning: Can't use blame annotator:
svn blame failed on trunk/src/tmcsim/client/ClockView.java: ("Can't find a temporary directory: Internal error", 20014)

source: tmcsimulator/trunk/src/tmcsim/client/ClockView.java @ 64

Revision 64, 1.8 KB checked in by jdalbey, 9 years ago (diff)

Renamed to ClockClient?, added build target for it.

RevLine 
1package tmcsim.client;
2
3import java.awt.Color;
4import java.awt.Dimension;
5import java.awt.Font;
6import java.util.logging.Logger;
7import javax.swing.BorderFactory;
8import javax.swing.Box;
9import javax.swing.BoxLayout;
10import javax.swing.JFrame;
11import javax.swing.JLabel;
12import javax.swing.JPanel;
13import javax.swing.WindowConstants;
14
15/**
16 * The CADClientView class is the view component to the CAD Client application.
17 *
18 * @author jdalbey
19 */
20@SuppressWarnings("serial")
21public class ClockView extends JFrame
22{
23    /**
24     * Error Logger.
25     */
26    private static Logger cadLogger = Logger.getLogger("tmcsim.client");
27    private JPanel mainPane;
28    private JLabel currentTime;
29    private final static Dimension SCREEN_SIZE = new Dimension(1100, 255);
30
31    /**
32     * Constructor. Build panes, add key listeners, and set up observer
33     * relationship between the footer and main panes. TODO: Consider having
34     * screen size and font size in properties file.
35     */
36    public ClockView()
37    {
38        super("Simulation Clock");
39        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
40        currentTime = new JLabel("00:00:00");
41        currentTime.setAlignmentX(Box.CENTER_ALIGNMENT);
42        currentTime.setFont(new Font("Geneva", Font.BOLD, 200));
43        mainPane = new JPanel();
44        setSize(SCREEN_SIZE);
45        setMaximumSize(SCREEN_SIZE);
46        setMinimumSize(SCREEN_SIZE);
47        mainPane.setLayout(new BoxLayout(mainPane, BoxLayout.Y_AXIS));
48        mainPane.setBorder(BorderFactory.createLineBorder(Color.black));
49        mainPane.setBackground(new Color(230, 230, 230));  // #E6E6E6
50        mainPane.add(currentTime);
51        add(mainPane);
52        pack();
53    }
54
55    public void updateTime(String msg)
56    {
57        currentTime.setText(msg);
58    }
59}
Note: See TracBrowser for help on using the repository browser.