Changeset 103 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures


Ignore:
Timestamp:
09/01/2017 12:13:01 PM (9 years ago)
Author:
bmcguffin
Message:

Individual incident editor window now shows the relevant incident as though it started at 00:00:00. When window is closed, the incident is re-inserted into the correct position.

Location:
trunk/src/scriptbuilder/structures
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/structures/ScriptIncident.java

    r76 r103  
    157157        int old = this.offset; 
    158158        this.offset = offset; 
     159        TreeMap<Integer, TimeSlice> newSlices = new TreeMap<Integer, TimeSlice>(); 
     160         
     161        for(Integer k : slices.keySet()) 
     162        { 
     163            newSlices.put(k + (offset - old), slices.get(k)); 
     164        } 
    159165 
    160166        for (TimeSlice ts : slices.values()) 
     
    162168            ts.shift(offset - old); 
    163169        } 
     170         
     171        slices = newSlices; 
    164172 
    165173        script.update(); 
  • trunk/src/scriptbuilder/structures/SimulationScript.java

    r83 r103  
    55import java.io.File; 
    66import java.io.FileWriter; 
    7 import java.io.OutputStream; 
    8 import java.io.OutputStreamWriter; 
    97import java.util.ArrayList; 
    108import java.util.List; 
    119import java.util.Observable; 
    12 import java.util.Random; 
    1310import java.util.Vector; 
    14 import java.util.logging.Level; 
    15 import java.util.logging.Logger; 
    16 import javax.xml.parsers.ParserConfigurationException; 
    1711import javax.xml.parsers.SAXParserFactory; 
    18 import scriptbuilder.structures.ScriptEvent.ScriptEventType; 
    1912import scriptbuilder.structures.ScriptIncident.IncidentFocusedEvent; 
    2013import scriptbuilder.structures.ScriptIncident.SliceChangedEvent; 
Note: See TracChangeset for help on using the changeset viewer.