Changeset 140 in tmcsimulator-scriptbuilder for trunk/src/event/editor/CHPRadioPanel.java


Ignore:
Timestamp:
12/22/2017 02:05:13 PM (8 years ago)
Author:
bmcguffin
Message:

Fixed defect #67. Removing an event and then closing the event editor window no longer causes the program to hang; a null check for the event is encountered before taking action upon close of the window.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/event/editor/CHPRadioPanel.java

    r130 r140  
    3636        event = (CHPRadioEvent) sei; 
    3737        audioText.setText(event.radioFile); 
    38          
     38 
    3939        for (int i = 0; i < event.lines.size(); i++) 
    4040        { 
    4141            ((MyTableModel) dialogTable.getModel()).addRow(event.roles.get(i), event.lines.get(i)); 
    4242        } 
    43         addDispatchButton.addActionListener(new ActionListener() { 
     43        addDispatchButton.addActionListener(new ActionListener() 
     44        { 
    4445 
    4546            public void actionPerformed(ActionEvent e) 
     
    5051            } 
    5152        }); 
    52         addFieldButton.addActionListener(new ActionListener() { 
     53        addFieldButton.addActionListener(new ActionListener() 
     54        { 
    5355 
    5456            public void actionPerformed(ActionEvent e) 
     
    6971                    event.lines.set(e.getLastRow(), dialogTable.getModel().getValueAt(e.getLastRow(), 1).toString()); 
    7072                } 
    71                 if(e.getType() == TableModelEvent.DELETE) 
     73                if (e.getType() == TableModelEvent.DELETE) 
    7274                { 
    7375                    event.roles.remove(e.getLastRow()); 
     
    7678            } 
    7779        }); 
    78          
     80 
    7981    } 
    8082 
     
    8385        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 
    8486    } 
    85      
     87 
    8688    @Override 
    8789    public boolean removeAssociatedEvent() 
    8890    { 
    89         ((I_ScriptEvent)event).removeThis(); 
     91        ((I_ScriptEvent) event).removeThis(); 
    9092        event = null; 
    9193        return true; 
     
    9597    public void uponClose() 
    9698    { 
    97         event.radioFile = audioText.getText(); 
     99        if (event != null) 
     100        { 
     101            event.radioFile = audioText.getText(); 
     102        } 
    98103    } 
    99104 
Note: See TracChangeset for help on using the changeset viewer.