| 1 | package tmcsim.simulationmanager; |
|---|
| 2 | |
|---|
| 3 | import java.awt.BorderLayout; |
|---|
| 4 | import java.util.Vector; |
|---|
| 5 | import javax.swing.JFrame; |
|---|
| 6 | import tmcsim.cadmodels.*; |
|---|
| 7 | import tmcsim.client.cadclientgui.data.IncidentEvent; |
|---|
| 8 | |
|---|
| 9 | /** |
|---|
| 10 | * |
|---|
| 11 | * @author jdalbey |
|---|
| 12 | */ |
|---|
| 13 | public class IncidentHistoryPanelDriver |
|---|
| 14 | { |
|---|
| 15 | |
|---|
| 16 | public static void main(String[] args) |
|---|
| 17 | { |
|---|
| 18 | // Create an IncidentEvent |
|---|
| 19 | Vector dummy = new Vector(); |
|---|
| 20 | IncidentInquiryHeader hdr = new IncidentInquiryHeader(); |
|---|
| 21 | // The incident type is a 4-digit string (Use MMYY for month and year of your birth) |
|---|
| 22 | hdr.type = "1179"; |
|---|
| 23 | // The incident location is the name of your home town |
|---|
| 24 | hdr.fullLocation = "San Luis Obispo"; |
|---|
| 25 | IncidentInquiryModel_obj mo = new IncidentInquiryModel_obj(); |
|---|
| 26 | mo.setHeader(hdr); |
|---|
| 27 | // The incident details is a parade on the main street (provide street name for your home town) |
|---|
| 28 | IncidentInquiryDetails det = new IncidentInquiryDetails("1", "Parade on Higuera", false); |
|---|
| 29 | mo.addDetail(det); |
|---|
| 30 | IncidentEvent event = new IncidentEvent(10, mo, "", 4, dummy, dummy); |
|---|
| 31 | // Create an IncidentHistoryPanel |
|---|
| 32 | IncidentHistoryPanel ihPanel = new IncidentHistoryPanel(); |
|---|
| 33 | // Add the event to the panel |
|---|
| 34 | ihPanel.updateIncidentHistory(event); |
|---|
| 35 | |
|---|
| 36 | // Create the frame. |
|---|
| 37 | JFrame frame = new JFrame("Incident Panel Demo"); |
|---|
| 38 | // Specify closing behavior |
|---|
| 39 | frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|---|
| 40 | // Add component to the frame. |
|---|
| 41 | frame.getContentPane().add(ihPanel, BorderLayout.CENTER); |
|---|
| 42 | // Size the frame. |
|---|
| 43 | frame.pack(); |
|---|
| 44 | // Show it. |
|---|
| 45 | frame.setVisible(true); |
|---|
| 46 | } |
|---|
| 47 | } |
|---|