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


Ignore:
Timestamp:
10/23/2017 08:58:34 AM (9 years ago)
Author:
bmcguffin
Message:

Changed implementation of save function for event editor panels. Instead of updating their model objects whenever the enter key is pressed, panels are now notified when the window is closed and update their information then.

File:
1 edited

Legend:

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

    r92 r130  
    3636        event = (CHPRadioEvent) sei; 
    3737        audioText.setText(event.radioFile); 
    38         audioText.addKeyListener(new KeyListener() 
    39         { 
    40  
    41             public void keyTyped(KeyEvent e) 
    42             { 
    43             } 
    44  
    45             public void keyPressed(KeyEvent e) 
    46             { 
    47                 if (e.getKeyCode() == KeyEvent.VK_ENTER) 
    48                 { 
    49                     event.radioFile = audioText.getText(); 
    50                 } 
    51             } 
    52  
    53             public void keyReleased(KeyEvent e) 
    54             { 
    55             } 
    56         }); 
     38         
    5739        for (int i = 0; i < event.lines.size(); i++) 
    5840        { 
     
    10890        event = null; 
    10991        return true; 
     92    } 
     93 
     94    @Override 
     95    public void uponClose() 
     96    { 
     97        event.radioFile = audioText.getText(); 
    11098    } 
    11199 
Note: See TracChangeset for help on using the changeset viewer.