Changeset 134 in tmcsimulator-scriptbuilder for trunk/src/event/editor/frame/PropertyModel.java


Ignore:
Timestamp:
10/23/2017 05:27:01 PM (9 years ago)
Author:
bmcguffin
Message:

The event-add dropdown menus in the event editor window now function correctly. Clicking on an event in the dropdown list adds it to that timeslice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/event/editor/frame/PropertyModel.java

    r130 r134  
    2323import java.util.TreeMap; 
    2424import javax.swing.JPanel; 
     25import scriptbuilder.structures.ScriptIncident; 
     26import scriptbuilder.structures.TimeSlice; 
    2527import scriptbuilder.structures.events.I_ScriptEvent; 
    2628 
     
    8284        } 
    8385    } 
     86     
     87    public void addEventFromDropdown(Properties property, ScriptIncident inc, TimeSlice ts) 
     88    { 
     89        try 
     90        { 
     91            I_ScriptEvent se = property.getEvent(); 
     92             
     93            inc.addNewEvent(se, ts.getTime()); 
     94             
     95            JPanel panel = (JPanel) classMap.get(property).newInstance(); 
     96 
     97            final PropertyPanel propertyPanel = properties.addPropertyPanel(property, panel); 
     98            if (panel instanceof I_ScriptEventEditorPanel) 
     99            { 
     100                eventMap.put(panel, se); 
     101                ((I_ScriptEventEditorPanel) panel).getEventObject(se); 
     102            } 
     103        } 
     104        catch (Exception e) 
     105        { 
     106            System.err.println("Could not create panel of type \"" + property + "\""); 
     107        } 
     108    } 
    84109 
    85110    public void removeProperty(Properties property) 
Note: See TracChangeset for help on using the changeset viewer.