~tapaal-contributor/tapaal/disappearing-tokens-1940098

« back to all changes in this revision

Viewing changes to src/pipe/gui/CreateGui.java

  • Committer: Kenneth Yrke Jørgensen
  • Date: 2011-04-12 09:50:16 UTC
  • mfrom: (329.1.188 tapaal-1.5)
  • Revision ID: mail@yrke.dk-20110412095016-e4hqdgab5596ja09
Merged with branch addning support for new 1.5 features

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package pipe.gui;
2
2
 
3
 
import java.awt.Color;
4
 
import java.awt.Dimension;
5
3
import java.io.File;
6
4
import java.util.ArrayList;
7
 
import java.util.HashMap;
8
5
 
9
 
import javax.swing.BorderFactory;
10
6
import javax.swing.JOptionPane;
11
 
import javax.swing.JScrollPane;
12
 
import javax.swing.JSplitPane;
13
7
import javax.swing.JTabbedPane;
14
 
import javax.swing.border.EmptyBorder;
15
 
import javax.swing.border.LineBorder;
16
 
import javax.swing.text.BadLocationException;
17
8
 
18
 
import pipe.dataLayer.Arc;
19
9
import pipe.dataLayer.DataLayer;
20
 
import pipe.dataLayer.NetType;
21
 
import pipe.dataLayer.PetriNetObject;
22
 
import pipe.dataLayer.Place;
23
 
import pipe.dataLayer.TAPNQuery;
24
 
import pipe.dataLayer.TimedArc;
25
 
import pipe.dataLayer.TimedPlace;
26
 
import pipe.dataLayer.TransportArc;
27
 
import pipe.dataLayer.colors.ColoredInhibitorArc;
28
 
import pipe.dataLayer.colors.ColoredInputArc;
29
 
import pipe.dataLayer.colors.ColoredOutputArc;
30
 
import pipe.dataLayer.colors.ColoredTimedPlace;
31
 
import pipe.dataLayer.colors.ColoredTransportArc;
32
 
import pipe.gui.widgets.JSplitPaneFix;
33
 
import pipe.gui.widgets.LeftConstantsPane;
34
 
import pipe.gui.widgets.LeftQueryPane;
 
10
import dk.aau.cs.gui.TabContent;
35
11
import dk.aau.cs.verification.UPPAAL.Verifyta;
36
12
 
37
 
 
38
13
public class CreateGui {
39
14
 
40
 
        private static final double DIVIDER_LOCATION = 0.5;
41
15
        public static GuiFrame appGui;
42
16
        private static Animator animator;
43
17
        private static JTabbedPane appTab;
44
 
        private static ArrayList<TabData> tabs = new ArrayList<TabData>();
 
18
        private static ArrayList<TabContent> tabs = new ArrayList<TabContent>();
 
19
        
 
20
        private static boolean usingGTKFileBrowser = true;
45
21
 
46
22
        public static String imgPath, userPath; // useful for stuff
47
23
 
48
 
        public static class TabData { // a structure for holding a tab's data
49
 
                public DataLayer appModel;
50
 
                public HashMap<PetriNetObject, String> oldGuards;
51
 
                public GuiView appView;
52
 
                public File appFile;
53
 
        }
54
 
 
55
 
        /** The Module will go in the top pane, the animation window in the bottom pane */
56
 
        private static JSplitPane leftPane;
57
 
        private static AnimationHistory animBox;
58
 
        static AnimationController animControlerBox;
59
 
        private static JScrollPane scroller;
60
 
        private static JScrollPane scroller2;
61
 
        private static LeftQueryPane queries;
62
 
        private static LeftConstantsPane leftBottomPanel;
63
 
        private static JSplitPane pane;
64
 
        private static AnimationHistory abstractAnimationPane=null;
65
 
        
66
24
        public static void init() {
67
25
                imgPath = "resources/Images" + System.getProperty("file.separator");
68
26
 
69
 
                // make the initial dir for browsing be My Documents (win), ~ (*nix), etc
70
 
                userPath = null; 
71
 
 
 
27
                // make the initial dir for browsing be My Documents (win), ~ (*nix),
 
28
                // etc
 
29
                userPath = null;
72
30
 
73
31
                appGui = new GuiFrame(Pipe.TOOL + " " + Pipe.VERSION);
74
32
 
75
 
 
76
 
 
77
33
                Grid.enableGrid();
78
34
 
79
35
                appTab = new JTabbedPane();
80
36
 
81
37
                animator = new Animator();
82
 
                appGui.setTab();   // sets Tab properties
83
 
 
84
 
 
85
 
                queries = new LeftQueryPane(new ArrayList<TAPNQuery>());
86
 
                leftPane = new JSplitPaneFix(JSplitPane.VERTICAL_SPLIT);
87
 
                leftPane.setPreferredSize(new Dimension(262, 100)); // height is ignored because the component is stretched
88
 
                leftPane.setMinimumSize(new Dimension(175,100));
89
 
                
90
 
                createLeftPane();
91
 
                pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,leftPane,appTab);
92
 
                                
93
 
                pane.setContinuousLayout(true);
94
 
                pane.setOneTouchExpandable(true);
95
 
                pane.setBorder(null); // avoid multiple borders
96
 
 
97
 
                pane.setDividerSize(8);
98
 
 
99
 
 
100
 
                appGui.getContentPane().add(pane);
101
 
 
102
 
                //appGui.createNewTabFromFile(null);
 
38
 
 
39
                appGui.setTab(); // sets Tab properties
 
40
 
 
41
                appGui.getContentPane().add(appTab);
 
42
 
 
43
                // appGui.createNewTabFromFile(null);
103
44
 
104
45
                appGui.setVisible(true);
105
 
                appGui.init();
106
 
                emptyLeftPane();
 
46
                appGui.activateSelectAction();
107
47
                Verifyta.trySetupFromEnvironmentVariable();
108
48
 
109
49
                VersionChecker versionChecker = new VersionChecker();
110
 
                if(versionChecker.checkForNewVersion()){
111
 
                        StringBuffer message = new StringBuffer(
112
 
                        "There is a new version of TAPAAL available at www.tapaal.net.");
 
50
                if (versionChecker.checkForNewVersion()) {
 
51
                        StringBuffer message = new StringBuffer("There is a new version of TAPAAL available at www.tapaal.net.");
113
52
                        message.append("\n\nCurrent version: ");
114
53
                        message.append(Pipe.VERSION);
115
54
                        message.append("\nNew version: ");
116
 
                        message.append(versionChecker.getNewVersionNumber());                   
 
55
                        message.append(versionChecker.getNewVersionNumber());
117
56
 
118
 
                        JOptionPane.showMessageDialog(appGui, 
119
 
                                        message .toString(),
120
 
                                        "New version available!",
121
 
                                        JOptionPane.INFORMATION_MESSAGE);                       
 
57
                        JOptionPane.showMessageDialog(appGui, message.toString(),
 
58
                                        "New version available!", JOptionPane.INFORMATION_MESSAGE);
122
59
                }
123
60
        }
124
61
 
125
 
 
126
 
        public static GuiFrame getApp() {  //returns a reference to the application
 
62
        public static GuiFrame getApp() { // returns a reference to the application
127
63
                return appGui;
128
64
        }
129
65
 
130
 
 
131
66
        public static DataLayer getModel() {
132
67
                return getModel(appTab.getSelectedIndex());
133
68
        }
137
72
                        return null;
138
73
                }
139
74
 
140
 
                TabData tab = (getTabDataForTab(index));
141
 
                if (tab.appModel == null) {
142
 
                        tab.appModel = new DataLayer();
143
 
                }
144
 
                return tab.appModel;
145
 
        }
146
 
 
147
 
 
148
 
        static TabData getTabDataForTab(int index) {
149
 
                return tabs.get(index);
150
 
        }
151
 
 
152
 
 
153
 
        public static GuiView getView(int index) {
 
75
                TabContent tab = (tabs.get(index));
 
76
                return tab.getModel();
 
77
        }
 
78
 
 
79
        public static DrawingSurfaceImpl getDrawingSurface() {
 
80
                return getDrawingSurface(appTab.getSelectedIndex());
 
81
        }
 
82
 
 
83
        public static DrawingSurfaceImpl getDrawingSurface(int index) {
 
84
 
154
85
                if (index < 0) {
155
86
                        return null;
156
87
                }
157
88
 
158
 
                TabData tab = (getTabDataForTab(index));
159
 
                while (tab.appView == null) {
 
89
                TabContent tab = (tabs.get(index));
 
90
                while (tab.drawingSurface() == null) {
 
91
 
160
92
                        try {
161
 
                                tab.appView = new GuiView(tab.appModel);
162
 
                        } catch (Exception e){
 
93
                                tab.setDrawingSurface(new DrawingSurfaceImpl(tab.getModel(),
 
94
                                                tab));
 
95
                        } catch (Exception e) {
163
96
                                e.printStackTrace();
164
97
                        }
165
98
                }
166
 
                return tab.appView;
167
 
        }
168
 
 
169
 
 
170
 
        public static GuiView getView() {
171
 
                return getView(appTab.getSelectedIndex());
172
 
        }
173
 
 
 
99
                return tab.drawingSurface();
 
100
        }
 
101
 
 
102
        public static DrawingSurfaceImpl getView() {
 
103
                return getDrawingSurface(appTab.getSelectedIndex());
 
104
        }
174
105
 
175
106
        public static File getFile() {
176
 
                TabData tab = (tabs.get(appTab.getSelectedIndex()));
177
 
                return tab.appFile;
 
107
                return getFile(appTab.getSelectedIndex());
178
108
        }
179
109
 
180
 
 
181
110
        public static void setFile(File modelfile, int fileNo) {
182
111
                if (fileNo >= tabs.size()) {
183
112
                        return;
184
113
                }
185
 
                TabData tab = (getTabDataForTab(fileNo));
186
 
                tab.appFile = modelfile;
 
114
 
 
115
                TabContent tab = (tabs.get(fileNo));
 
116
                tab.setFile(modelfile);
 
117
 
187
118
        }
188
119
 
189
 
 
190
120
        public static int getFreeSpace() {
191
 
                tabs.add(new TabData());
 
121
                tabs.add(new TabContent());
192
122
                return tabs.size() - 1;
193
123
        }
194
124
 
195
 
 
196
125
        public static void removeTab(int index) {
197
126
                tabs.remove(index);
198
 
                if(tabs.isEmpty()){
199
 
                        emptyLeftPane();
200
 
                }
201
127
        }
202
128
 
203
 
 
204
129
        public static JTabbedPane getTab() {
205
130
                return appTab;
206
131
        }
207
132
 
 
133
        public static TabContent getTab(int index) {
 
134
                return tabs.get(index);
 
135
        }
 
136
 
 
137
        public static TabContent getCurrentTab() {
 
138
                return tabs.get(appTab.getSelectedIndex());
 
139
        }
 
140
 
208
141
        public static Animator getAnimator() {
209
142
                return animator;
210
143
        }
211
144
 
212
 
        /** returns the current dataLayer object - 
213
 
         *  used to get a reference to pass to the modules */
 
145
        /**
 
146
         * returns the current dataLayer object - used to get a reference to pass to
 
147
         * the modules
 
148
         */
214
149
        public static DataLayer currentPNMLData() {
215
150
                if (appTab.getSelectedIndex() < 0) {
216
151
                        return null;
217
152
                }
218
 
                TabData tab = (tabs.get(appTab.getSelectedIndex()));
219
 
                return tab.appModel;
220
 
        }
221
 
 
222
 
        public static void setupModelForSimulation(){
223
 
                if (appTab.getSelectedIndex() >= 0) {
224
 
                        TabData tab = (tabs.get(appTab.getSelectedIndex()));
225
 
                        //DataLayer model = tab.appModel.clone();
226
 
                        if(!tab.appModel.isUsingColors()){
227
 
                                HashMap<PetriNetObject, String> oldGuards = transformToModelWithoutConstants(tab.appModel);
228
 
                                tab.oldGuards = oldGuards;
229
 
                        }else{
230
 
                                configureNetToShowValues(tab.appModel, true);
231
 
                        }
232
 
                }
233
 
        }
234
 
 
235
 
        private static void configureNetToShowValues(DataLayer model, boolean showValues) {
236
 
                for(Place tp : model.getPlaces()){
237
 
                        ColoredTimedPlace place = (ColoredTimedPlace)tp;
238
 
                        place.displayValues(showValues);
239
 
                }               
240
 
 
241
 
                for(Arc arc : model.getArcs()){
242
 
                        if(arc instanceof ColoredTransportArc){
243
 
                                ((ColoredTransportArc)arc).displayValues(showValues);
244
 
                        }else if(arc instanceof ColoredInputArc){
245
 
                                ((ColoredInputArc)arc).displayValues(showValues);
246
 
                        }else if(arc instanceof ColoredInhibitorArc){
247
 
                                ((ColoredInhibitorArc)arc).displayValues(showValues);
248
 
                        }else if(arc instanceof ColoredOutputArc){
249
 
                                ((ColoredOutputArc)arc).displayValues(showValues);
250
 
                        }
251
 
                }
252
 
        }
253
 
 
254
 
 
255
 
        public static void restoreModelForEditing(){
256
 
                if (appTab.getSelectedIndex() >= 0) {
257
 
                        TabData tab = (tabs.get(appTab.getSelectedIndex()));
258
 
                        if(tab.appModel.isUsingColors()){
259
 
                                configureNetToShowValues(tab.appModel, false);
260
 
                        }else{
261
 
                                if(tab.oldGuards != null){
262
 
                                        setupModelWithOldGuards(tab.appModel, tab.oldGuards);
263
 
                                        tab.oldGuards = null;
264
 
                                }
265
 
                        }
266
 
                }
267
 
        }
268
 
 
269
 
        static void setupModelWithOldGuards(DataLayer model,
270
 
                        HashMap<PetriNetObject, String> oldGuards) {
271
 
                for(Place p : model.getPlaces()){
272
 
                        if(p instanceof TimedPlace){
273
 
                                String inv = oldGuards.get(p);
274
 
                                ((TimedPlace)p).setInvariant(inv);
275
 
                        }
276
 
                }
277
 
 
278
 
                for(Arc arc : model.getArcs()){
279
 
                        if(arc instanceof TimedArc || arc instanceof TransportArc){
280
 
                                TimedArc tarc = (TimedArc)arc;
281
 
                                String guard = oldGuards.get(arc);
282
 
                                tarc.setGuard(guard);
283
 
                        }
284
 
                }
285
 
        }
286
 
 
287
 
 
288
 
        public static HashMap<PetriNetObject, String> transformToModelWithoutConstants(DataLayer model) {
289
 
                HashMap<PetriNetObject, String> oldGuards = new HashMap<PetriNetObject, String>();
290
 
 
291
 
                for(Place p : model.getPlaces()){
292
 
                        if(p instanceof TimedPlace){
293
 
                                oldGuards.put(p, ((TimedPlace) p).getInvariant());
294
 
                                String inv = getInvariant(p, model);
295
 
                                ((TimedPlace)p).setInvariant(inv);
296
 
                        }
297
 
                }
298
 
 
299
 
                for(Arc arc : model.getArcs()){
300
 
                        if(arc instanceof TimedArc || arc instanceof TransportArc){
301
 
                                oldGuards.put(arc, ((TimedArc) arc).getGuard());
302
 
                                TimedArc tarc = (TimedArc)arc;
303
 
                                String guard = getGuard(tarc, model);
304
 
                                tarc.setGuard(guard);
305
 
                        }
306
 
                }
307
 
 
308
 
                return oldGuards;
309
 
        }
310
 
 
311
 
        private static String getGuard(TimedArc arc, DataLayer model) {
312
 
                String guard = arc.getGuard();
313
 
                String leftDelim = guard.substring(0,1);
314
 
                String rightDelim = guard.substring(guard.length()-1, guard.length());
315
 
                String first = guard.substring(1, guard.indexOf(","));
316
 
                String second = guard.substring(guard.indexOf(",")+1, guard.length()-1);
317
 
 
318
 
                boolean isFirstConstant = false;
319
 
                boolean isSecondConstant = false;
320
 
 
321
 
                try{
322
 
                        Integer.parseInt(first);
323
 
                }catch(NumberFormatException e){
324
 
                        isFirstConstant = true;
325
 
                }
326
 
 
327
 
                try{
328
 
                        Integer.parseInt(second);
329
 
                }catch(NumberFormatException e){
330
 
                        if(!second.equals("inf")) isSecondConstant = true;
331
 
                }
332
 
 
333
 
                if(isFirstConstant){
334
 
                        first = String.valueOf(model.getConstantValue(first));
335
 
                }
336
 
 
337
 
                if(isSecondConstant){
338
 
                        second = String.valueOf(model.getConstantValue(second));
339
 
                }
340
 
 
341
 
                return leftDelim + first + "," + second + rightDelim;
342
 
        }
343
 
 
344
 
        private static String getInvariant(Place place, DataLayer model) {
345
 
                String inv = ((TimedPlace)place).getInvariant();
346
 
                String operator = inv.contains("<=") ? "<=" : "<";
347
 
 
348
 
                String bound = inv.substring(operator.length());
349
 
 
350
 
                boolean isConstant = false;
351
 
                try{
352
 
                        Integer.parseInt(bound);
353
 
                }catch(NumberFormatException e){
354
 
                        if(!bound.equals("inf")) isConstant = true;
355
 
                }
356
 
 
357
 
                if(isConstant)
358
 
                        bound = String.valueOf(model.getConstantValue(bound));
359
 
 
360
 
                return operator + bound;
361
 
        }
362
 
 
363
 
 
364
 
        /** Creates a new animationHistory text area, and returns a reference to it*/
365
 
        public static void addAnimationHistory() {
366
 
                try {
367
 
                        animBox = new AnimationHistory();
368
 
                        //animBox.setEditable(false);
369
 
 
370
 
                        scroller = new JScrollPane(animBox);
371
 
                        scroller.setBorder(BorderFactory.createCompoundBorder(
372
 
                                        BorderFactory.createTitledBorder("Simulation History"),
373
 
                                        BorderFactory.createEmptyBorder(3,3,3,3)));
374
 
                        leftPane.setBottomComponent(scroller);
375
 
                        //animBox.setScroller(scroller);
376
 
                        //         leftPane.setDividerLocation(0.5);
377
 
                        leftPane.setResizeWeight(0.05f);
378
 
 
379
 
                        leftPane.setDividerSize(8);             
380
 
                } catch (javax.swing.text.BadLocationException be) {
381
 
                        be.printStackTrace();
382
 
                }
383
 
                
384
 
        }
385
 
 
386
 
        public static AnimationHistory getAbstractAnimationPane(){
387
 
                return abstractAnimationPane;
 
153
 
 
154
                TabContent tab = (tabs.get(appTab.getSelectedIndex()));
 
155
                return tab.getModel();
 
156
        }
 
157
 
 
158
        /** Creates a new animationHistory text area, and returns a reference to it */
 
159
        public static void switchToAnimationComponents() {
 
160
                TabContent tab = (tabs.get(appTab.getSelectedIndex()));
 
161
                tab.switchToAnimationComponents();
 
162
        }
 
163
 
 
164
        public static void switchToEditorComponents() {
 
165
                TabContent tab = (tabs.get(appTab.getSelectedIndex()));
 
166
                tab.switchToEditorComponents();
 
167
        }
 
168
 
 
169
        public static AnimationHistoryComponent getAbstractAnimationPane() {
 
170
                TabContent tab = (tabs.get(appTab.getSelectedIndex()));
 
171
                return tab.getUntimedAnimationHistory();
 
172
 
388
173
        }
389
174
 
390
175
        public static void addAbstractAnimationPane() {
391
 
                
392
 
 
393
 
                try {
394
 
                        abstractAnimationPane=new AnimationHistory();
395
 
                } catch (BadLocationException e) {
396
 
                        // TODO Auto-generated catch block
397
 
                        e.printStackTrace();
398
 
                }
399
 
                //abstractAnimationPane.setVerticalAlignment(SwingConstants.TOP);
400
 
 
401
 
                //Create a new empty animBox
402
 
                try {
403
 
                        animBox = new AnimationHistory();
404
 
                        //animBox.setEditable(false);
405
 
                } catch (BadLocationException e) {
406
 
                        // TODO Auto-generated catch block
407
 
                        e.printStackTrace();
408
 
                }
409
 
 
410
 
 
411
 
                JSplitPane pane2 = 
412
 
                        new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,animBox,abstractAnimationPane);
413
 
 
414
 
                pane2.setContinuousLayout(true);
415
 
                pane2.setOneTouchExpandable(true);
416
 
                pane2.setBorder(null); // avoid multiple borders
417
 
 
418
 
                pane2.setDividerSize(8);
419
 
 
420
 
                leftPane.setBottomComponent(pane2);
421
 
                abstractAnimationPane.setBorder(new LineBorder(Color.black));
 
176
                TabContent tab = (tabs.get(appTab.getSelectedIndex()));
 
177
                tab.addAbstractAnimationPane();
 
178
        }
 
179
 
 
180
        public static AnimationController getAnimationController() {
 
181
                TabContent tab = (tabs.get(appTab.getSelectedIndex()));
 
182
                return tab.getAnimationController();
422
183
 
423
184
        }
424
185
 
425
186
        public static void removeAbstractAnimationPane() {
426
 
                abstractAnimationPane=null;
427
 
                scroller = new JScrollPane(animBox);
428
 
                scroller.setBorder(new EmptyBorder(0,0,0,0)); // make it less bad on XP
429
 
                leftPane.setBottomComponent(scroller);
430
 
        }
431
 
 
432
 
        public static void addAnimationControler() {
433
 
                try {
434
 
                        animControlerBox = new AnimationController("Simulation Controler\n");
435
 
 
436
 
                        scroller2 = new JScrollPane(animControlerBox);
437
 
                        scroller2.setBorder(new EmptyBorder(0,0,0,0)); // make it less bad on XP
438
 
                        scroller2.setMinimumSize(new Dimension(200,95));
439
 
                        scroller2.setPreferredSize(new Dimension(200,95));
440
 
                        leftPane.setTopComponent(scroller2);
441
 
 
442
 
                        //         leftPane.setDividerLocation(0.5);
443
 
                        leftPane.setDividerSize(8);
444
 
                        leftPane.resetToPreferredSizes();
445
 
                        //shortcutBottons should be usable from start of
446
 
                        animControlerBox.requestFocus(true);
447
 
                } catch (javax.swing.text.BadLocationException be) {
448
 
                        be.printStackTrace();
449
 
                        System.out.println("There where an error in creating the AnimationControler");
450
 
                }
451
 
        }
452
 
 
453
 
        public static void removeAnimationHistory() {
454
 
                if (scroller != null) {
455
 
                        leftPane.remove(scroller);
456
 
                        leftPane.setDividerLocation(DIVIDER_LOCATION);
457
 
                        leftPane.setDividerSize(0);
458
 
                }
459
 
        }
460
 
        public static void removeAnimationControler() {
461
 
                if (scroller != null) {
462
 
                        leftPane.remove(scroller2);
463
 
                        leftPane.setDividerLocation(DIVIDER_LOCATION);
464
 
                        leftPane.setDividerSize(0);
465
 
                }
466
 
        }
467
 
 
468
 
 
469
 
        public static AnimationHistory getAnimationHistory() {
470
 
                return animBox;
471
 
        }
472
 
 
473
 
        public static void createLeftPane(){
474
 
                DataLayer model = CreateGui.getModel();
475
 
                boolean enableAddButton = model == null ? true : !model.netType().equals(NetType.UNTIMED);
476
 
                leftBottomPanel = new LeftConstantsPane(enableAddButton);
477
 
                queries = new LeftQueryPane(
478
 
                                getModel() == null ? new ArrayList<TAPNQuery>() : getModel().getQueries()
479
 
                );
480
 
                leftPane.setDividerLocation(DIVIDER_LOCATION);
481
 
                leftPane.setResizeWeight(0.5);
482
 
                leftPane.setTopComponent(queries);
483
 
                leftPane.setBottomComponent(leftBottomPanel);
484
 
                leftPane.setContinuousLayout(true);
485
 
                leftPane.setDividerSize(0);
486
 
                leftPane.setPreferredSize(new Dimension(290,400));
487
 
                updateLeftPanel();
488
 
        }
489
 
 
490
 
        public static void emptyLeftPane(){
491
 
                leftPane.setTopComponent(null);
492
 
                leftPane.setBottomComponent(null);
493
 
        }
494
 
 
495
 
        public static void updateConstantsList(){
496
 
                leftBottomPanel.showConstants();
497
 
        }
498
 
 
499
 
        public static void updateLeftPanel() {
500
 
                leftPane.validate();
501
 
        }
502
 
 
 
187
                TabContent tab = (tabs.get(appTab.getSelectedIndex()));
 
188
                tab.removeAbstractAnimationPane();
 
189
        }
 
190
 
 
191
        // public static void addAnimationController() {
 
192
        // TabContent tab = (tabs.get(appTab.getSelectedIndex()));
 
193
        // //tab.addAnimationController();
 
194
        // }
 
195
 
 
196
        // public static void removeAnimationHistory() {
 
197
        // TabContent tab = (tabs.get(appTab.getSelectedIndex()));
 
198
        // tab.removeAnimationHistory();
 
199
        // }
 
200
        //      
 
201
        // public static void removeAnimationController() {
 
202
        // TabContent tab = (tabs.get(appTab.getSelectedIndex()));
 
203
        // tab.removeAnimationController();
 
204
        // }
 
205
 
 
206
        public static AnimationHistoryComponent getAnimationHistory() {
 
207
                TabContent tab = (tabs.get(appTab.getSelectedIndex()));
 
208
                return tab.getAnimationHistory();
 
209
        }
 
210
 
 
211
        public static void updateConstantsList() {
 
212
                TabContent tab = (tabs.get(appTab.getSelectedIndex()));
 
213
                tab.updateConstantsList();
 
214
        }
503
215
 
504
216
        public static void undoGetFreeSpace() {
505
 
                tabs.remove(tabs.size()-1);
 
217
                tabs.remove(tabs.size() - 1);
 
218
        }
 
219
 
 
220
        public static File getFile(int index) {
 
221
                TabContent tab = tabs.get(index);
 
222
                return tab.getFile();
 
223
        }
 
224
 
 
225
        public static void setUsingGTKFileBrowser(boolean useGTKFileBrowser) {
 
226
                usingGTKFileBrowser = useGTKFileBrowser;
 
227
        }
 
228
        
 
229
        public static boolean usingGTKFileBrowser() {
 
230
                return usingGTKFileBrowser;
506
231
        }
507
232
}