Changeset 155 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder


Ignore:
Timestamp:
11/20/2019 03:22:38 PM (6 years ago)
Author:
sdanthin
Message:

units.xml moved to Incidents folder

Location:
trunk/src/scriptbuilder
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/gui/IncidentEditorFrame.form

    r135 r155  
    579579              </Properties> 
    580580              <AuxValues> 
    581                 <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new scriptbuilder.gui.panels.IncidentTimelinePanel(false)"/> 
     581                <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new scriptbuilder.gui.panels.IncidentTimelinePanel(true)"/> 
    582582              </AuxValues> 
    583583 
  • trunk/src/scriptbuilder/gui/IncidentEditorFrame.java

    r145 r155  
    5454    private boolean addToEnd = true; 
    5555 
     56    private TimeSlice selectedSlice; 
     57     
     58    /** 
     59     * Boolean determining if selectmode for events is enabled. 
     60     */ 
     61     
     62    public boolean selectMode = false; 
    5663    /** 
    5764     * The current type of selected event. 
     
    209216                newButton = null; 
    210217            } 
    211  
     218            if(e.getKeyCode() == KeyEvent.VK_CONTROL) 
     219            { 
     220                selectMode =  true; 
     221                 
     222            } 
    212223            if (newButton != null) 
    213224            { 
     
    226237        public void keyReleased(KeyEvent e) 
    227238        { 
     239            if(e.getKeyCode() == KeyEvent.VK_CONTROL) 
     240            { 
     241                selectMode = false; 
     242                 
     243            } 
    228244        } 
    229245 
     
    261277 
    262278        incidentNumberPanel1.update(theIncident); 
     279         
    263280        cadButton.addKeyListener(new TimelineKeyListener()); 
    264281        cctvButton.addKeyListener(new TimelineKeyListener()); 
     
    341358    public void update(Observable o, Object arg) 
    342359    { 
    343         System.out.println("the type of update is: " + arg.getClass()); 
     360        //System.out.println("the type of update is: " + arg.getClass()); 
    344361        //Three possibilities: This is a general script update, or it's one of 
    345362        //two different focus updates 
     
    368385        else if (arg instanceof SliceChangedEvent) 
    369386        { 
     387            //this seems to be only called when the window is initialized again 
    370388            System.out.println("you got the hover over a timeslice"); 
    371389            TimeSlice slice = ((SliceChangedEvent) arg).slice; 
     
    409427    @SuppressWarnings("unchecked") 
    410428    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 
    411     private void initComponents() 
    412     { 
     429    private void initComponents() { 
    413430 
    414431        eventPopupMenu = new javax.swing.JPopupMenu(); 
     
    450467        timelinesScrollPane = new javax.swing.JScrollPane(); 
    451468        timelineTickPanel = new scriptbuilder.gui.panels.TimelineTickPanel(); 
    452         incidentTimelinePanel1 = new scriptbuilder.gui.panels.IncidentTimelinePanel(false); 
     469        incidentTimelinePanel1 = new scriptbuilder.gui.panels.IncidentTimelinePanel(true); 
    453470        incidentNumberPanel1 = new scriptbuilder.gui.panels.IncidentNumberPanel(); 
    454471        scriptEventsPanel = new javax.swing.JPanel(); 
     
    495512 
    496513        cadEvent.setText("CAD Event"); 
    497         cadEvent.addMouseListener(new java.awt.event.MouseAdapter() 
    498         { 
    499             public void mousePressed(java.awt.event.MouseEvent evt) 
    500             { 
     514        cadEvent.addMouseListener(new java.awt.event.MouseAdapter() { 
     515            public void mousePressed(java.awt.event.MouseEvent evt) { 
    501516                cadEventMousePressed(evt); 
    502517            } 
    503             public void mouseReleased(java.awt.event.MouseEvent evt) 
    504             { 
     518            public void mouseReleased(java.awt.event.MouseEvent evt) { 
    505519                cadEventMouseReleased(evt); 
    506520            } 
     
    512526 
    513527        radioEvent.setText("Radio Event"); 
    514         radioEvent.addMouseListener(new java.awt.event.MouseAdapter() 
    515         { 
    516             public void mousePressed(java.awt.event.MouseEvent evt) 
    517             { 
     528        radioEvent.addMouseListener(new java.awt.event.MouseAdapter() { 
     529            public void mousePressed(java.awt.event.MouseEvent evt) { 
    518530                radioEventMousePressed(evt); 
    519531            } 
     
    569581 
    570582        okButton.setText("OK"); 
    571         okButton.addActionListener(new java.awt.event.ActionListener() 
    572         { 
    573             public void actionPerformed(java.awt.event.ActionEvent evt) 
    574             { 
     583        okButton.addActionListener(new java.awt.event.ActionListener() { 
     584            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    575585                okButtonActionPerformed(evt); 
    576586            } 
     
    578588 
    579589        cancelButton.setText("Cancel"); 
    580         cancelButton.addActionListener(new java.awt.event.ActionListener() 
    581         { 
    582             public void actionPerformed(java.awt.event.ActionEvent evt) 
    583             { 
     590        cancelButton.addActionListener(new java.awt.event.ActionListener() { 
     591            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    584592                cancelButtonActionPerformed(evt); 
    585593            } 
     
    624632 
    625633        editEventList.setText("Edit..."); 
    626         editEventList.addActionListener(new java.awt.event.ActionListener() 
    627         { 
    628             public void actionPerformed(java.awt.event.ActionEvent evt) 
    629             { 
     634        editEventList.addActionListener(new java.awt.event.ActionListener() { 
     635            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    630636                editEventListActionPerformed(evt); 
    631637            } 
     
    669675 
    670676        btnCancelNoise.setText("Cancel"); 
    671         btnCancelNoise.addActionListener(new java.awt.event.ActionListener() 
    672         { 
    673             public void actionPerformed(java.awt.event.ActionEvent evt) 
    674             { 
     677        btnCancelNoise.addActionListener(new java.awt.event.ActionListener() { 
     678            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    675679                btnCancelNoiseActionPerformed(evt); 
    676680            } 
     
    678682 
    679683        btnGenerateNoise.setText("Generate"); 
    680         btnGenerateNoise.addActionListener(new java.awt.event.ActionListener() 
    681         { 
    682             public void actionPerformed(java.awt.event.ActionEvent evt) 
    683             { 
     684        btnGenerateNoise.addActionListener(new java.awt.event.ActionListener() { 
     685            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    684686                btnGenerateNoiseActionPerformed(evt); 
    685687            } 
     
    856858        zoomSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); 
    857859        zoomSlider.setFocusable(false); 
    858         zoomSlider.addChangeListener(new javax.swing.event.ChangeListener() 
    859         { 
    860             public void stateChanged(javax.swing.event.ChangeEvent evt) 
    861             { 
     860        zoomSlider.addChangeListener(new javax.swing.event.ChangeListener() { 
     861            public void stateChanged(javax.swing.event.ChangeEvent evt) { 
    862862                zoomSliderStateChanged(evt); 
    863863            } 
     
    938938        maintenanceRadioButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    939939        maintenanceRadioButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    940         maintenanceRadioButton.addActionListener(new java.awt.event.ActionListener() 
    941         { 
    942             public void actionPerformed(java.awt.event.ActionEvent evt) 
    943             { 
     940        maintenanceRadioButton.addActionListener(new java.awt.event.ActionListener() { 
     941            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    944942                maintenanceRadioButtonActionPerformed(evt); 
    945943            } 
     
    952950        tmtRadioButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    953951        tmtRadioButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    954         tmtRadioButton.addActionListener(new java.awt.event.ActionListener() 
    955         { 
    956             public void actionPerformed(java.awt.event.ActionEvent evt) 
    957             { 
     952        tmtRadioButton.addActionListener(new java.awt.event.ActionListener() { 
     953            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    958954                tmtRadioButtonActionPerformed(evt); 
    959955            } 
     
    966962        telephoneButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    967963        telephoneButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    968         telephoneButton.addActionListener(new java.awt.event.ActionListener() 
    969         { 
    970             public void actionPerformed(java.awt.event.ActionEvent evt) 
    971             { 
     964        telephoneButton.addActionListener(new java.awt.event.ActionListener() { 
     965            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    972966                telephoneButtonActionPerformed(evt); 
    973967            } 
     
    980974        unitButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    981975        unitButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    982         unitButton.addActionListener(new java.awt.event.ActionListener() 
    983         { 
    984             public void actionPerformed(java.awt.event.ActionEvent evt) 
    985             { 
     976        unitButton.addActionListener(new java.awt.event.ActionListener() { 
     977            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    986978                unitButtonActionPerformed(evt); 
    987979            } 
     
    994986        witnessButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    995987        witnessButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    996         witnessButton.addActionListener(new java.awt.event.ActionListener() 
    997         { 
    998             public void actionPerformed(java.awt.event.ActionEvent evt) 
    999             { 
     988        witnessButton.addActionListener(new java.awt.event.ActionListener() { 
     989            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    1000990                witnessButtonActionPerformed(evt); 
    1001991            } 
     
    1008998        paramicsButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    1009999        paramicsButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    1010         paramicsButton.addActionListener(new java.awt.event.ActionListener() 
    1011         { 
    1012             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1013             { 
     1000        paramicsButton.addActionListener(new java.awt.event.ActionListener() { 
     1001            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    10141002                paramicsButtonActionPerformed(evt); 
    10151003            } 
     
    10221010        towButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    10231011        towButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    1024         towButton.addActionListener(new java.awt.event.ActionListener() 
    1025         { 
    1026             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1027             { 
     1012        towButton.addActionListener(new java.awt.event.ActionListener() { 
     1013            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    10281014                towButtonActionPerformed(evt); 
    10291015            } 
     
    10361022        audioButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    10371023        audioButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    1038         audioButton.addActionListener(new java.awt.event.ActionListener() 
    1039         { 
    1040             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1041             { 
     1024        audioButton.addActionListener(new java.awt.event.ActionListener() { 
     1025            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    10421026                audioButtonActionPerformed(evt); 
    10431027            } 
     
    10501034        cctvButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    10511035        cctvButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    1052         cctvButton.addActionListener(new java.awt.event.ActionListener() 
    1053         { 
    1054             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1055             { 
     1036        cctvButton.addActionListener(new java.awt.event.ActionListener() { 
     1037            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    10561038                cctvButtonActionPerformed(evt); 
    10571039            } 
     
    10641046        cadButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    10651047        cadButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    1066         cadButton.addActionListener(new java.awt.event.ActionListener() 
    1067         { 
    1068             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1069             { 
     1048        cadButton.addActionListener(new java.awt.event.ActionListener() { 
     1049            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    10701050                cadButtonActionPerformed(evt); 
    10711051            } 
     
    10781058        chpRadioButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    10791059        chpRadioButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    1080         chpRadioButton.addActionListener(new java.awt.event.ActionListener() 
    1081         { 
    1082             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1083             { 
     1060        chpRadioButton.addActionListener(new java.awt.event.ActionListener() { 
     1061            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    10841062                chpRadioButtonActionPerformed(evt); 
    10851063            } 
     
    11501128        atmsEvalButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    11511129        atmsEvalButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    1152         atmsEvalButton.addActionListener(new java.awt.event.ActionListener() 
    1153         { 
    1154             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1155             { 
     1130        atmsEvalButton.addActionListener(new java.awt.event.ActionListener() { 
     1131            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    11561132                atmsEvalButtonActionPerformed(evt); 
    11571133            } 
     
    11641140        cmsEvalButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    11651141        cmsEvalButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    1166         cmsEvalButton.addActionListener(new java.awt.event.ActionListener() 
    1167         { 
    1168             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1169             { 
     1142        cmsEvalButton.addActionListener(new java.awt.event.ActionListener() { 
     1143            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    11701144                cmsEvalButtonActionPerformed(evt); 
    11711145            } 
     
    11781152        cadEvalButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    11791153        cadEvalButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    1180         cadEvalButton.addActionListener(new java.awt.event.ActionListener() 
    1181         { 
    1182             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1183             { 
     1154        cadEvalButton.addActionListener(new java.awt.event.ActionListener() { 
     1155            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    11841156                cadEvalButtonActionPerformed(evt); 
    11851157            } 
     
    11921164        facilitatorEvalButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    11931165        facilitatorEvalButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    1194         facilitatorEvalButton.addActionListener(new java.awt.event.ActionListener() 
    1195         { 
    1196             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1197             { 
     1166        facilitatorEvalButton.addActionListener(new java.awt.event.ActionListener() { 
     1167            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    11981168                facilitatorEvalButtonActionPerformed(evt); 
    11991169            } 
     
    12061176        activityLogEvalButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    12071177        activityLogEvalButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    1208         activityLogEvalButton.addActionListener(new java.awt.event.ActionListener() 
    1209         { 
    1210             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1211             { 
     1178        activityLogEvalButton.addActionListener(new java.awt.event.ActionListener() { 
     1179            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    12121180                activityLogEvalButtonActionPerformed(evt); 
    12131181            } 
     
    12201188        radioEvalButton.setMargin(new java.awt.Insets(2, 10, 2, 10)); 
    12211189        radioEvalButton.setPreferredSize(new java.awt.Dimension(30, 25)); 
    1222         radioEvalButton.addActionListener(new java.awt.event.ActionListener() 
    1223         { 
    1224             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1225             { 
     1190        radioEvalButton.addActionListener(new java.awt.event.ActionListener() { 
     1191            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    12261192                radioEvalButtonActionPerformed(evt); 
    12271193            } 
     
    12671233        zoomInIcon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ZoomIn.png"))); // NOI18N 
    12681234        zoomInIcon.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); 
    1269         zoomInIcon.addMouseListener(new java.awt.event.MouseAdapter() 
    1270         { 
    1271             public void mouseClicked(java.awt.event.MouseEvent evt) 
    1272             { 
     1235        zoomInIcon.addMouseListener(new java.awt.event.MouseAdapter() { 
     1236            public void mouseClicked(java.awt.event.MouseEvent evt) { 
    12731237                zoomInIconMouseClicked(evt); 
    12741238            } 
     
    12771241        zoomOutIcon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ZoomOut.png"))); // NOI18N 
    12781242        zoomOutIcon.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); 
    1279         zoomOutIcon.addMouseListener(new java.awt.event.MouseAdapter() 
    1280         { 
    1281             public void mouseClicked(java.awt.event.MouseEvent evt) 
    1282             { 
     1243        zoomOutIcon.addMouseListener(new java.awt.event.MouseAdapter() { 
     1244            public void mouseClicked(java.awt.event.MouseEvent evt) { 
    12831245                zoomOutIconMouseClicked(evt); 
    12841246            } 
     
    13201282 
    13211283        btnAddTime.setText("+15"); 
    1322         btnAddTime.addActionListener(new java.awt.event.ActionListener() 
    1323         { 
    1324             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1325             { 
     1284        btnAddTime.addActionListener(new java.awt.event.ActionListener() { 
     1285            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    13261286                btnAddTimeActionPerformed(evt); 
    13271287            } 
     
    13291289 
    13301290        btnToggleTimeStart.setText("to Start"); 
    1331         btnToggleTimeStart.addActionListener(new java.awt.event.ActionListener() 
    1332         { 
    1333             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1334             { 
     1291        btnToggleTimeStart.addActionListener(new java.awt.event.ActionListener() { 
     1292            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    13351293                btnToggleTimeStartActionPerformed(evt); 
    13361294            } 
     
    13391297        btnToggleTimeEnd.setSelected(true); 
    13401298        btnToggleTimeEnd.setText("to End"); 
    1341         btnToggleTimeEnd.addActionListener(new java.awt.event.ActionListener() 
    1342         { 
    1343             public void actionPerformed(java.awt.event.ActionEvent evt) 
    1344             { 
     1299        btnToggleTimeEnd.addActionListener(new java.awt.event.ActionListener() { 
     1300            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    13451301                btnToggleTimeEndActionPerformed(evt); 
    13461302            } 
  • trunk/src/scriptbuilder/gui/application.properties

    r145 r155  
    1 #Thu, 31 Oct 2019 16:04:24 -0700 
     1#Wed, 20 Nov 2019 16:03:11 -0800 
    22 
    3 Application.revision=144 
     3Application.revision=154 
    44 
    55Application.buildnumber=43 
  • trunk/src/scriptbuilder/gui/panels/IncidentTimelinePanel.java

    r150 r155  
    6363     * If true, right-clicking on this panel will produce the popup menu. 
    6464     */ 
    65     private boolean hasPopupAccess; 
     65    private boolean hasPopupAccessRightClick; 
     66    /** 
     67     * If true, left-clicking on this panel will produce the popup menu. 
     68     */ 
     69    private boolean hasPopupAccessLeftClick; 
    6670     
    6771    int cursorTime, lastSlice, x, y; 
     
    250254                         
    251255                        addTime = -(addTime-(addTime%20)); 
    252                          
     256                        //this if statement might be useless? 
    253257                        if(offset<=incident.offset+incident.length) 
    254258                        { 
     
    274278 
    275279            // Does user want a popup menu? 
    276             if (e.isPopupTrigger() && hasPopupAccess) 
     280            if (e.isPopupTrigger() && hasPopupAccessRightClick) 
     281            { 
     282                if(getTopLevelAncestor() instanceof IncidentEditorFrame) 
     283                { 
     284                    if (((IncidentEditorFrame)getTopLevelAncestor()).currentEventType == null){ 
     285                        JPopupMenu popup = createPopup(currentMouseX,currentMouseY); 
     286                        popup.show(e.getComponent(), currentMouseX, currentMouseY); 
     287                         
     288                    } 
     289                     
     290                }else 
     291                { 
     292                    JPopupMenu popup = createPopup(); 
     293                    popup.show(e.getComponent(), currentMouseX, currentMouseY); 
     294                } 
     295                 
     296                 
     297                 
     298            } 
     299        } 
     300        @Override 
     301        public void mouseReleased(MouseEvent e) 
     302        { 
     303            int currentMouseX = e.getX(); 
     304            int currentMouseY = e.getY(); 
     305 
     306            // Does user want a popup menu? 
     307            if (e.isPopupTrigger() && hasPopupAccessRightClick) 
    277308            { 
    278309                if(getTopLevelAncestor() instanceof IncidentEditorFrame) 
     
    285316                    popup.show(e.getComponent(), currentMouseX, currentMouseY); 
    286317                } 
    287                  
    288                  
    289                  
    290             } 
    291         } 
    292         @Override 
    293         public void mouseReleased(MouseEvent e) 
    294         { 
    295             int currentMouseX = e.getX(); 
    296             int currentMouseY = e.getY(); 
    297  
    298             // Does user want a popup menu? 
    299             if (e.isPopupTrigger() && hasPopupAccess) 
    300             { 
    301                 JPopupMenu popup = createPopup(); 
    302                 popup.show(e.getComponent(), currentMouseX, currentMouseY); 
    303318            } 
    304319        } 
     
    323338            else if (getTopLevelAncestor() instanceof IncidentEditorFrame) 
    324339            { 
     340                 
    325341                incidentEditFrameCurrent = (IncidentEditorFrame) getTopLevelAncestor(); 
    326342                editor = new Editor(incidentEditFrameCurrent); 
     
    485501        super(); 
    486502 
    487         hasPopupAccess = true; 
     503        hasPopupAccessRightClick = true; 
    488504 
    489505        requestedEditorFillerTime = 0; 
     
    525541        super(); 
    526542 
    527         hasPopupAccess = usesPopup; 
     543        hasPopupAccessRightClick = usesPopup; 
    528544 
    529545        requestedEditorFillerTime = 0; 
  • trunk/src/scriptbuilder/structures/SimulationScript.java

    r145 r155  
    55import java.io.File; 
    66import java.io.FileWriter; 
     7import java.io.IOException; 
    78import java.util.ArrayList; 
    89import java.util.List; 
     
    1213import scriptbuilder.structures.ScriptIncident.IncidentFocusedEvent; 
    1314import scriptbuilder.structures.ScriptIncident.SliceChangedEvent; 
     15import scriptbuilder.structures.events.*; 
    1416import scriptbuilder.structures.units.Unit; 
     17import java.nio.file.Path; 
     18import java.nio.file.Paths; 
     19import java.util.TreeMap; 
    1520 
    1621/** 
     
    256261            ex.printStackTrace(); 
    257262        } 
     263        try 
     264        { 
     265            createAudioDirectory(Paths.get(f.getCanonicalPath()).getParent()); 
     266        } 
     267        catch(IOException ex) 
     268        { 
     269            System.err.println("there was a problem creating the audio directories."); 
     270        } 
     271         
     272         
    258273        saved = true; 
    259274    } 
    260  
     275    private void createAudioDirectory(Path path){ 
     276        File f = new File(path.toString()+"/audio"); 
     277        if(!f.exists()) 
     278        { 
     279            f.mkdir(); 
     280            //scan through to see what is already there and then make changes accordingly. 
     281        } 
     282        for(ScriptIncident i : incidents) 
     283        { 
     284            if(i!=null) 
     285            { 
     286                String name = ((Integer) i.number).toString(); 
     287                File incidentFolder = new File(path.toString()+"/audio/"+name); 
     288                if(incidentFolder.exists()) 
     289                { 
     290                    //check to see if there are already files for the given incidents 
     291                    //not sure how the ordering of the files should be. 
     292                    //check to see if folder needs filling 
     293                }else 
     294                { 
     295 
     296                    //create an incidentfolder since one does not already exist 
     297                    incidentFolder.mkdir(); 
     298                    int fileCount = 1; 
     299                    for(TimeSlice slice : i.getSlices()) 
     300                    { 
     301                        for(I_ScriptEvent event : slice.events) 
     302                        { 
     303                            if(event.getScriptEventType().equals(ScriptEvent.ScriptEventType.CHP_RADIO_EVENT)) 
     304                            { 
     305                                //if the event is a chp radio event 
     306                                //then add the dummy file to the subdirectory created 
     307                                CHPRadioEvent radioEvent = (CHPRadioEvent) event; 
     308                                 
     309                                String output = radioEvent.toScriptFile(); 
     310                                 
     311                                File newAudioScript = new File(path.toString()+"/audio/"+name+"/"+name+fileCount+".txt"); 
     312                                 
     313                                fileCount++; 
     314                                try 
     315                                { 
     316                                    newAudioScript.createNewFile(); 
     317                                    BufferedWriter bw = new BufferedWriter(new FileWriter(newAudioScript)); 
     318                                    bw.write(output); 
     319                                    bw.flush(); 
     320                                    bw.close(); 
     321                                }catch(Exception e) 
     322                                { 
     323                                    System.err.println("there was a problem creating your text files"); 
     324                                } 
     325 
     326                            } 
     327                        } 
     328                    } 
     329 
     330                } 
     331            } 
     332 
     333             
     334        } 
     335         
     336         
     337    } 
    261338    @Override 
    262339    public String toXML() 
  • trunk/src/scriptbuilder/structures/events/CHPRadioEvent.java

    r76 r155  
    4545    public String radioFile = ""; 
    4646 
     47    /** 
     48     * Returns the contents of the CHPRadioEvent to make recording easier. 
     49     * @return a string with the script to be said  
     50     */ 
     51    public String toScriptFile() 
     52    { 
     53        String fileContents = ""; 
     54        for(int lineIndex=0;lineIndex<lines.size();lineIndex++) 
     55        { 
     56            fileContents += roles.get(lineIndex) + " " + lines.get(lineIndex) + "\n"; 
     57        } 
     58        return fileContents; 
     59    } 
     60     
    4761    @Override 
    4862    public String toXML() 
Note: See TracChangeset for help on using the changeset viewer.