Changeset 57 in tmcsimulator for trunk/src/tmcsim
- Timestamp:
- 03/14/2017 07:25:16 PM (9 years ago)
- Location:
- trunk/src/tmcsim
- Files:
-
- 3 edited
-
application.properties (modified) (1 diff)
-
client/CADClockDisplay.java (modified) (1 diff)
-
client/CADClockView.java (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/application.properties
r56 r57 1 #Tue, 14 Mar 2017 19:06:53-07001 #Tue, 14 Mar 2017 20:23:50 -0700 2 2 3 Application.revision=5 53 Application.revision=56 4 4 5 Application.buildnumber=3 15 Application.buildnumber=32 -
trunk/src/tmcsim/client/CADClockDisplay.java
r54 r57 156 156 // relationship. 157 157 theClientScreenView = new CADClockView(theClientScreenModel); 158 theClientScreenView.setVisible(false); 159 158 theClientScreenModel.addObserver(theClientScreenView); 159 theClientScreenView.setVisible(true); 160 // Create the CAD Client thread to run the CADClientModel Object. 161 Thread clientThread = new Thread(theClientScreenModel); 162 clientThread.start(); 163 160 164 // TODO: set up model-view relationship similar to ClientView and 161 165 // ScreenView -
trunk/src/tmcsim/client/CADClockView.java
r54 r57 1 1 package tmcsim.client; 2 2 3 import java.awt.BorderLayout; 3 4 import java.awt.Color; 4 5 import java.awt.Dimension; … … 15 16 import javax.swing.BoxLayout; 16 17 import javax.swing.JFrame; 18 import javax.swing.JLabel; 17 19 import javax.swing.JOptionPane; 18 20 import javax.swing.JPanel; 19 21 import javax.swing.JTextPane; 22 import javax.swing.WindowConstants; 20 23 import javax.xml.parsers.DocumentBuilderFactory; 21 24 … … 60 63 /** Current CAD Screen number. */ 61 64 private CADScreenNum currentScreenNum = null; 65 private JPanel mainPane; 66 private JLabel currentTime; 62 67 63 64 68 /** 65 69 * Constructor. Build panes, add key listeners, and set up observer … … 71 75 public CADClockView(CADClientModel mod) { 72 76 super("CAD Client"); 77 this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); 73 78 theModel = mod; 79 currentTime = new JLabel("00:00"); 74 80 81 mainPane = new JPanel(); 82 setSize(new Dimension(730, 455)); 83 setMaximumSize(new Dimension(730, 455)); 84 setMinimumSize(new Dimension(730, 455)); 85 mainPane.setLayout(new BorderLayout()); 86 mainPane.setBorder(BorderFactory.createLineBorder(Color.black)); 87 mainPane.setBackground(Color.LIGHT_GRAY); 88 mainPane.add(currentTime,BorderLayout.CENTER); 89 add(mainPane); 90 pack(); 75 91 } 76 92 … … 110 126 } 111 127 112 ObserverMessage oMessage = (ObserverMessage)arg; 113 128 ObserverMessage oMessage = (ObserverMessage)arg; 129 114 130 switch(oMessage.type) { 131 // Time updates occur once a minute 115 132 case TIME_UPDATE: 116 System.out.println("CAD time is now" + (String)oMessage.value);133 currentTime.setText("" + (String)oMessage.value); 117 134 break; 118 135 }
Note: See TracChangeset
for help on using the changeset viewer.
