| 1 | package event.editor; |
|---|
| 2 | |
|---|
| 3 | import java.awt.event.*; |
|---|
| 4 | import java.util.Observable; |
|---|
| 5 | import scriptbuilder.structures.events.*; |
|---|
| 6 | |
|---|
| 7 | /** |
|---|
| 8 | * |
|---|
| 9 | * @author nathaniellehrer |
|---|
| 10 | */ |
|---|
| 11 | public class MaintenanceRadioPanel extends javax.swing.JPanel implements ScriptEventEditorPanel |
|---|
| 12 | { |
|---|
| 13 | |
|---|
| 14 | private ActionListener removeListener; |
|---|
| 15 | private MaintenanceRadioEvent event; |
|---|
| 16 | |
|---|
| 17 | /** |
|---|
| 18 | * Creates new form MaintenanceRadio |
|---|
| 19 | */ |
|---|
| 20 | public MaintenanceRadioPanel() |
|---|
| 21 | { |
|---|
| 22 | initComponents(); |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | public void getEventObject(I_ScriptEvent sei) |
|---|
| 26 | { |
|---|
| 27 | event = (MaintenanceRadioEvent) sei; |
|---|
| 28 | jTextArea1.setText(event.message); |
|---|
| 29 | jTextArea1.addKeyListener(new KeyListener() |
|---|
| 30 | { |
|---|
| 31 | |
|---|
| 32 | public void keyTyped(KeyEvent e) |
|---|
| 33 | { |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | public void keyPressed(KeyEvent e) |
|---|
| 37 | { |
|---|
| 38 | if (e.getKeyCode() == KeyEvent.VK_ENTER) |
|---|
| 39 | { |
|---|
| 40 | event.message = jTextArea1.getText(); |
|---|
| 41 | } |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | public void keyReleased(KeyEvent e) |
|---|
| 45 | { |
|---|
| 46 | } |
|---|
| 47 | }); |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | public void update(Observable o, Object arg) |
|---|
| 51 | { |
|---|
| 52 | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | /** |
|---|
| 56 | * This method is called from within the constructor to initialize the form. |
|---|
| 57 | * WARNING: Do NOT modify this code. The content of this method is always |
|---|
| 58 | * regenerated by the Form Editor. |
|---|
| 59 | */ |
|---|
| 60 | @SuppressWarnings("unchecked") |
|---|
| 61 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
|---|
| 62 | private void initComponents() { |
|---|
| 63 | |
|---|
| 64 | jScrollPane1 = new javax.swing.JScrollPane(); |
|---|
| 65 | jTextArea1 = new javax.swing.JTextArea(); |
|---|
| 66 | jLabel1 = new javax.swing.JLabel(); |
|---|
| 67 | |
|---|
| 68 | jTextArea1.setColumns(20); |
|---|
| 69 | jTextArea1.setRows(5); |
|---|
| 70 | jTextArea1.setToolTipText("The radio transmission"); |
|---|
| 71 | jScrollPane1.setViewportView(jTextArea1); |
|---|
| 72 | |
|---|
| 73 | jLabel1.setText("Transmission:"); |
|---|
| 74 | |
|---|
| 75 | org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); |
|---|
| 76 | this.setLayout(layout); |
|---|
| 77 | layout.setHorizontalGroup( |
|---|
| 78 | layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|---|
| 79 | .add(layout.createSequentialGroup() |
|---|
| 80 | .addContainerGap() |
|---|
| 81 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|---|
| 82 | .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 583, Short.MAX_VALUE) |
|---|
| 83 | .add(jLabel1)) |
|---|
| 84 | .addContainerGap()) |
|---|
| 85 | ); |
|---|
| 86 | layout.setVerticalGroup( |
|---|
| 87 | layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|---|
| 88 | .add(layout.createSequentialGroup() |
|---|
| 89 | .addContainerGap() |
|---|
| 90 | .add(jLabel1) |
|---|
| 91 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
|---|
| 92 | .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE) |
|---|
| 93 | .addContainerGap()) |
|---|
| 94 | ); |
|---|
| 95 | }// </editor-fold>//GEN-END:initComponents |
|---|
| 96 | |
|---|
| 97 | |
|---|
| 98 | // Variables declaration - do not modify//GEN-BEGIN:variables |
|---|
| 99 | private javax.swing.JLabel jLabel1; |
|---|
| 100 | private javax.swing.JScrollPane jScrollPane1; |
|---|
| 101 | private javax.swing.JTextArea jTextArea1; |
|---|
| 102 | // End of variables declaration//GEN-END:variables |
|---|
| 103 | |
|---|
| 104 | } |
|---|