resources/Editors/Editor.Roo.grid.Grid.bjs
[app.Builder.js] / src / Builder4 / WindowState.vala
1 /**
2  * as state management is a bit too complicated inside the builder
3  * it's better to seperate this into this class
4  * 
5  * This class has references to all the Class instances that make up the window..
6  * 
7  */
8 public class WindowState : Object 
9 {
10     public Xcls_MainWindow win;
11
12     public enum State {
13         NONE,
14         PREVIEW,
15         OBJECT,
16         PROP,
17         LISTENER,
18         CODE,
19         FILES,
20         PROJECT // project settings..
21     }
22
23     public State state = State.NONE;
24
25     public bool children_loaded = false;
26
27     
28     public Xcls_WindowLeftTree  left_tree;
29     public Xcls_WindowAddProp   add_props;
30     public Xcls_LeftProps       left_props;
31     public Xcls_ProjectSettings projectsettings;
32     public ValaProjectSettings  vala_projectsettings;
33     public Xcls_RightPalete     rightpalete;
34     public Editor               code_editor;    
35     public Xcls_WindowRooView   window_rooview;
36     public Xcls_GtkView         window_gladeview;
37     public Xcls_DialogNewComponent new_file_dialog;
38     public Xcls_ClutterFiles     clutterfiles;
39
40     public Xcls_WindowLeftProjects left_projects; // can not see where this is initialized.. 
41     
42     public DialogTemplateSelect template_select; 
43     
44     // dialogs??
45     public Xcls_DialogPluginWebkit webkit_plugin;
46     
47     // ctor 
48     public WindowState(Xcls_MainWindow win)
49     {
50                 this.win = win;
51                 // initialize
52
53                 // left elements..
54                 this.leftTreeInit();
55                 this.propsListInit();
56
57                 // on clutter space...
58                 this.projectEditInit();
59                 this.codeEditInit();
60                 this.projectListInit();
61                 this.fileViewInit();
62
63                 // adding stuff
64                 this.objectAddInit();
65                 this.propsAddInit();
66
67
68                 // previews...
69                 this.gtkViewInit();
70                 this.webkitViewInit();
71
72                 // dialogs
73
74                 this.fileNewInit();
75
76                 this.webkit_plugin = new Xcls_DialogPluginWebkit();
77                 this.template_select = new DialogTemplateSelect();
78                 this.children_loaded = true;
79     }
80
81
82     // left tree
83
84     public void leftTreeInit()
85     {
86      
87         this.left_tree = new Xcls_WindowLeftTree();
88         this.left_tree.ref();
89         this.left_tree.main_window = this.win;
90     
91         this.win.tree.el.pack_start(this.left_tree.el,true, true,0);
92         this.left_tree.el.show_all();
93            
94         this.left_tree.before_node_change.connect(() => {
95             return this.leftTreeBeforeChange();
96
97         });
98
99         this.left_tree.node_selected.connect((sel) => {
100             this.leftTreeNodeSelected(sel);
101         });
102      
103         this.left_tree.changed.connect(() => {
104             this.window_rooview.requestRedraw();
105             this.left_tree.model.file.save();
106         });
107          
108     }
109
110     public bool leftTreeBeforeChange()
111     {
112         if (this.state != State.CODE) {
113             this.left_props.finish_editing();
114             return true;
115         }
116         if (!this.code_editor.saveContents()) {
117             return false;
118         }
119         return false;
120     }
121     
122     public void leftTreeNodeSelected(JsRender.Node? sel)
123     {
124
125         print("node_selected called %s\n", (sel == null) ? "NULL" : "a value");
126
127         if (sel == null) {
128             this.left_props.el.hide();
129         } 
130         this.left_props.el.show();
131         this.left_props.load(this.left_tree.getActiveFile(), sel);
132         switch (this.state) {
133             
134             case State.OBJECT: 
135                   
136                  if (sel == null) {
137                     this.rightpalete.clear();
138                     break;
139                 }
140                 this.rightpalete.load(this.left_tree.getActiveFile().palete(), sel.fqn());
141                 break;
142                  
143         
144            case State.PROP:
145                 if (sel == null) {
146                     this.add_props.clear();
147                     break;
148                 }
149                 this.add_props.show(this.left_tree.getActiveFile().palete(), "props", sel.fqn());
150                 break;
151
152             case State.LISTENER:
153                
154                 if (sel == null) {
155                     this.add_props.clear();
156                     break;
157                 }
158                 this.add_props.show(this.left_tree.getActiveFile().palete(), "signals", sel.fqn());
159                 break;
160                 
161             case State.CODE:
162                  this.switchState(State.PREVIEW);
163              
164                 break;
165                
166                             
167         }
168          
169
170     }
171
172
173
174
175     public void propsListInit()
176     {
177     
178         this.left_props =new Xcls_LeftProps();
179         this.left_props.ref();
180         this.left_props.main_window = this.win;
181         this.win.props.el.pack_start(this.left_props.el,true, true,0);
182         this.left_props.el.show_all();
183     
184         this.left_props.show_editor.connect( (file, node, type,  key) => {
185             this.switchState(State.CODE);
186             this.code_editor.show(
187                 file,
188                 node,
189                 type,
190                 key
191             );
192             
193             
194         });
195
196    
197         this.left_props.stop_editor.connect( () => {
198             if (this.state != State.CODE) {
199                 return true;
200             }
201     
202             var ret =  this.code_editor.saveContents();
203             if (!ret) {
204                 return false;
205             }
206             this.switchState(State.PREVIEW);
207             return ret;
208         });
209     
210         this.left_props.changed.connect(() => {
211               if (this.left_tree.getActiveFile().xtype == "Roo" ) {
212                    this.window_rooview.requestRedraw();
213                    
214                } else {
215                   this.window_gladeview.loadFile(this.left_tree.getActiveFile());
216               }
217               this.left_tree.model.updateSelected();
218               this.left_tree.model.file.save();
219         });
220     
221
222
223     }
224
225     //-------------  projects edit
226
227     public void projectEditInit()
228     {
229         this.projectsettings  =new Xcls_ProjectSettings();
230         this.projectsettings.ref();  /// really?
231     
232         this.vala_projectsettings  =new ValaProjectSettings();
233         this.vala_projectsettings.ref();
234         this.vala_projectsettings.window = this.win;
235     
236         ((Gtk.Container)(this.win.projecteditview.el.get_widget())).add(this.projectsettings.el);
237         //this.projectsettings.el.show_all();
238
239         var stage = this.win.projecteditview.el.get_stage();
240         stage.set_background_color(  Clutter.Color.from_string("#000"));
241     
242         this.projectsettings.buttonPressed.connect((btn) => {
243              if (this.left_tree.getActiveFile().xtype == "Roo" ) {
244                 if (btn == "save") {
245                     this.window_rooview.view.renderJS(true);
246                 }
247                 if (btn == "apply") {
248                     this.window_rooview.view.renderJS(true);
249                     return;
250                 }
251             } else {
252                 // do nothing for gtk..
253             }
254             if (btn == "save" || btn == "apply") {
255                 this.win.project.save();
256          
257             }
258             this.switchState (State.PREVIEW); 
259              
260          });
261
262     }
263     // ----------- object adding
264     public void objectAddInit()
265     {
266
267         this.rightpalete  = new Xcls_RightPalete();
268         this.rightpalete.ref();  /// really?
269         ((Gtk.Container)(this.win.objectview.el.get_widget())).add(this.rightpalete.el);
270         //this.projectsettings.el.show_all();
271
272         var stage = this.win.objectview.el.get_stage();
273         stage.set_background_color(  Clutter.Color.from_string("#000"));
274            
275     }
276     
277     // -----------  properties adding list...
278     // listener uses the properties 
279     public void propsAddInit()
280     {
281     // Add properties
282         this.add_props  = new Xcls_WindowAddProp();
283         this.add_props.ref();  /// really?
284         ((Gtk.Container)(this.win.addpropsview.el.get_widget())).add(this.add_props.el);
285         //this.projectsettings.el.show_all();
286
287         var  stage = this.win.addpropsview.el.get_stage();
288         stage.set_background_color(  Clutter.Color.from_string("#000"));
289
290
291         this.add_props.select.connect( (key,type,skel, etype) => {
292             this.left_props.addProp(etype, key, skel, type);
293         });
294
295     }
296     public void propsAddShow()
297     {
298
299     }
300     public void propsAddHide()
301     {
302     
303     }
304
305
306
307     
308     // ----------- Add / Edit listener
309     // listener uses the properties 
310     //public void listenerInit()     { }
311     public void listenerShow()
312     {
313
314     }
315     public void listenerHide()
316     {
317     
318     }
319
320     // -------------- codeEditor
321
322     public void codeEditInit()
323     {
324         this.code_editor  = new  Editor();
325         this.code_editor.ref();  /// really?
326         ((Gtk.Container)(this.win.codeeditview.el.get_widget())).add(this.code_editor.el);
327         //this.projectsettings.el.show_all();
328
329         var stage = this.win.codeeditview.el.get_stage();
330         stage.set_background_color(  Clutter.Color.from_string("#000"));
331         // editor.save...
332
333         this.code_editor.save.connect( () => {
334              this.left_tree.model.file.save();
335              this.left_tree.model.updateSelected();
336         });
337         
338     }
339
340     // ----------- list of projects on left
341     public void  projectListInit() 
342     {
343
344         this.left_projects = new Xcls_WindowLeftProjects();
345          this.left_projects.ref();
346          this.win.leftpane.el.pack_start(this.left_projects.el,true, true,0);
347          this.left_projects.el.show_all();
348          this.left_projects.project_selected.connect((proj) => {
349             proj.scanDirs();
350             this.clutterfiles.loadProject(proj);
351         
352          });
353
354     }
355     // ----------- file view
356
357     public void fileViewInit()
358     {
359         var stage = this.win.rooview.el.get_stage(); // seems odd... 
360         this.clutterfiles = new Xcls_ClutterFiles();
361         this.clutterfiles.ref();
362         stage.add_child(this.clutterfiles.el);
363         this.clutterfiles.el.show_all();
364
365
366         this.clutterfiles.open.connect((file) => { 
367             this.fileViewOpen(file);
368         });
369         this.clutterfiles.el.transitions_completed.connect(() => {
370             if (this.state == State.FILES) {
371                 this.win.rooview.el.hide();
372             } else {
373                 this.clutterfiles.el.hide();
374             }
375             
376             
377         });
378
379     }
380     public void fileNewInit()
381     {
382         this.new_file_dialog = new Xcls_DialogNewComponent();
383         // force it modal to the main window..
384         this.new_file_dialog.el.set_transient_for(this.win.el);
385         this.new_file_dialog.el.set_modal(true);
386     
387         this.new_file_dialog.success.connect((project,file) =>
388         {
389             this.fileViewOpen(file);
390         });
391
392     }
393
394     
395     public void fileViewOpen(JsRender.JsRender file)
396     {
397         this.win.project = file.project;
398         this.switchState (State.PREVIEW); 
399         
400         this.left_tree.model.loadFile(file);
401     
402         var ctr= ((Gtk.Container)(this.win.rooview.el.get_widget()));
403         var ctr_p= ((Gtk.Container)(this.win.projecteditview.el.get_widget()));
404     
405         if (file.xtype == "Roo" ) { 
406             ctr.foreach( (w) => { ctr.remove(w); });
407             ctr_p.foreach( (w) => { ctr_p.remove(w); });
408             ctr.add(this.window_rooview.el);
409             ctr_p.add(this.projectsettings.el);            
410             this.window_rooview.loadFile(file);
411             this.window_rooview.el.show_all();
412             this.projectsettings.el.show_all();            
413
414         } else {
415             ctr.foreach( (w) => { ctr.remove(w); });
416             ctr_p.foreach( (w) => { ctr_p.remove(w); });            
417             ctr.add(this.window_gladeview.el);
418             ctr_p.add(this.vala_projectsettings.el);
419             this.window_gladeview.loadFile(file);
420             this.window_gladeview.el.show_all();
421             this.vala_projectsettings.el.show_all();
422         }
423         print("OPEN : " + file.name);
424         this.win.editpane.el.set_position(this.win.editpane.el.max_position);
425         this.win.setTitle(file.project.name + " : " +file.name);
426              
427
428         }
429
430     
431     // ---------  webkit view
432     public void webkitViewInit()
433     {
434         this.window_rooview  =new Xcls_WindowRooView();
435         this.window_rooview.ref();
436         ((Gtk.Container)(this.win.rooview.el.get_widget())).add(this.window_rooview.el);
437         this.window_rooview.el.show_all();
438
439         var stage = this.win.rooview.el.get_stage();
440         stage.set_background_color(  Clutter.Color.from_string("#000"));
441     }
442
443     // ------ Gtk  - view
444
445     public void gtkViewInit()
446     {
447         this.window_gladeview  =new Xcls_GtkView();
448         this.window_gladeview.ref();
449     }
450     
451     public void easingSaveAll()
452     {
453         this.win.addpropsview.el.save_easing_state();
454         this.win.codeeditview.el.save_easing_state();
455         this.win.objectview.el.save_easing_state();
456         this.win.projecteditview.el.save_easing_state();
457         this.win.rooview.el.save_easing_state();
458         this.clutterfiles.el.save_easing_state();
459          
460     }
461     public void easingRestoreAll()
462     {
463         this.win.addpropsview.el.restore_easing_state();
464         this.win.codeeditview.el.restore_easing_state();
465         this.win.objectview.el.restore_easing_state();
466         this.win.projecteditview.el.restore_easing_state();
467         this.win.rooview.el.restore_easing_state();
468         this.clutterfiles.el.restore_easing_state();
469         
470     }
471     public void switchState(State new_state)
472     {
473         
474         // save the easing state of everything..
475         this.easingSaveAll();
476         
477         switch (this.state) {
478
479             case State.PREVIEW:
480                 if (this.left_tree.getActiveFile() != null) {
481                      if (this.left_tree.getActiveFile().xtype == "Roo" ) {
482                          this.window_rooview.createThumb();
483                      } else {
484                           this.window_gladeview.createThumb();
485                       }
486                 }
487                 // normally we are going from preview to another state.
488                 // and different windows hide the preview in differnt ways..
489                 
490                 break;
491             
492            case State.LISTENER:
493            case State.PROP:
494                 
495                 this.win.addpropsview.el.set_scale(0.0f,0.0f);
496                  break;
497                 
498             case State.CODE:
499
500
501                 this.code_editor.saveContents();
502               
503                 this.win.codeeditview.el.set_scale(0.0f,0.0f);
504                  break;
505
506
507              case State.OBJECT:
508                
509                 this.win.objectview.el.set_scale(0.0f,0.0f);
510                  break;
511
512            case State.PROJECT:
513                 if (this.win.project.xtype == "Gtk") {
514                     this.vala_projectsettings.save();
515                 } 
516                 
517                 this.win.projecteditview.el.set_scale(0.0f,0.0f);
518                  break;
519
520           case State.FILES:
521                 // hide files...
522                 
523                 this.win.rooview.el.show_all();
524                 this.win.rooview.el.set_easing_duration(1000);
525                 this.win.rooview.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
526                 this.win.rooview.el.set_scale(1.0f,1.0f);
527                 this.win.rooview.el.set_pivot_point(0.5f,0.5f);
528                 this.win.rooview.el.set_opacity(0xff);
529                
530                 
531                
532                  this.clutterfiles.el.set_easing_duration(1000);
533                 this.clutterfiles.el.set_pivot_point(0.5f,0.5f);
534                 this.clutterfiles.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, -180.0f);
535                 this.clutterfiles.el.set_opacity(0);
536  
537                 //this.clutterfiles.el.hide();
538                  
539
540                 break;
541
542                 
543         }
544        
545         var oldstate  =this.state;
546         this.state = new_state;
547         
548         
549                 
550         this.buttonsShowHide();
551         
552         
553         switch (this.state) {
554             
555             case State.PREVIEW:  // this is the default state when working...
556                  this.win.editpane.el.show(); // holder for tree and properties..
557                  
558              
559                  this.left_projects.el.hide(); 
560                  if (oldstate != State.FILES) {
561                     // it's handled above..
562                     print ("changing state to preview from NOT files..");
563                      
564  
565                     this.win.rooview.el.set_scale(1.0f,1.0f);
566                  }
567                
568                 break;
569
570
571             case State.LISTENER:
572                 // same as prop?
573             case State.PROP:
574                 var ae =      this.left_tree.getActiveElement();
575                 if (ae == null) {
576                     this.state = oldstate;
577                     this.buttonsShowHide();
578                     this.resizeCanvasElements();
579                     this.easingRestoreAll();
580                     return;
581                 }
582                 this.add_props.el.show_all();
583                 this.add_props.show(
584                     Palete.factory(this.win.project.xtype), 
585                     this.state == State.LISTENER ? "signals" : "props",
586                     ae.fqn()
587                 );
588  
589                     
590  
591                 
592                 // -- FIXME? this needs to be State aware?
593          
594                 this.win.rooview.el.set_pivot_point(1.0f,0.5f);
595                   
596                 this.win.addpropsview.el.set_scale(1.0f,1.0f);
597                  break;
598            
599             case State.OBJECT:
600                  var n = this.left_tree.getActiveElement();
601
602                 if (this.left_tree.model.file == null) {
603                     this.state =oldstate;
604                     this.buttonsShowHide();
605                     this.resizeCanvasElements();
606                     this.easingRestoreAll();
607                     return;
608                 }
609                 
610                 if (n == null && this.left_tree.model.file.tree != null) {
611                     this.state = oldstate;
612                     this.buttonsShowHide();
613                     this.resizeCanvasElements();
614                     this.easingRestoreAll();
615                     return;
616                 }
617
618                 this.rightpalete.el.show_all();
619                 this.rightpalete.load(this.left_tree.getActiveFile().palete(), n == null ? "*top" : n.fqn());
620
621                 
622               
623             
624                 this.win.objectview.el.set_scale(1.0f,1.0f);
625                  
626                 break;
627                
628                
629             case State.CODE:
630
631                 this.code_editor.el.show_all();
632                 
633                 // caller needs to call editor - show....
634                   
635  
636                  this.win.codeeditview.el.set_scale(1.0f,1.0f);
637                  break;
638
639
640
641            case State.PROJECT:
642
643                if (this.win.project.xtype == "Roo") {
644                     this.projectsettings.el.show_all();
645                     this.projectsettings.show(this.win.project);
646                 } else {
647                     this.vala_projectsettings.el.show_all();
648                     this.vala_projectsettings.show((Project.Gtk)this.win.project);
649                 }
650
651                 this.win.rooview.el.set_pivot_point(1.0f,1.0f); // bottom right..
652                 
653                 this.win.projecteditview.el.set_scale(1.0f,1.0f);
654                 
655                
656                 break;
657                 
658            case State.FILES:  // can only get here from PREVIEW state.. in theory..
659                 
660    
661                 this.win.editpane.el.hide(); // holder for tree and properties..
662              
663                 this.left_projects.el.show(); 
664             
665                  this.win.rooview.el.set_easing_duration(1000);
666                 this.win.rooview.el.set_pivot_point(0.5f,0.5f);
667                 this.win.rooview.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 180.0f);
668                 this.win.rooview.el.set_opacity(0);
669                 //el.set_scale(0.0f,0.0f);
670
671  
672                 if (this.win.project != null) {
673                     this.left_projects.selectProject(this.win.project);
674                 }
675              
676                 
677                 this.clutterfiles.el.show_all();
678                  
679                 this.clutterfiles.el.set_easing_duration(1000);
680                 this.clutterfiles.el.set_pivot_point(0.5f,0.5f);
681                 this.clutterfiles.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
682                 this.clutterfiles.el.set_opacity(0xff);
683                 
684                 
685                 
686                 break;
687
688
689         }
690         this.resizeCanvasElements();
691         this.easingRestoreAll();
692         
693             
694     }
695     
696     public int redraw_count = 0;
697     public void resizeCanvas() // called by window resize .. delays redraw
698     {
699         var rc = this.redraw_count;        
700         this.redraw_count = 2;
701         if (rc == 0) {
702             GLib.Timeout.add(100,  ()  =>{
703                  return this.resizeCanvasQueue();
704             });
705         }
706     }
707     public bool  resizeCanvasQueue()
708     {
709         //print("WindowState.resizeCanvasQueue %d\n", this.redraw_count);        
710
711         if (this.redraw_count < 1) {
712             return false; // should not really happen...
713         }
714
715
716         this.redraw_count--;
717
718         if (this.redraw_count > 0) {
719             return true; // do it again in 1 second...
720         }
721         // got down to 0 or -1....
722         this.redraw_count = 0;
723         this.resizeCanvasElements();
724         return false;
725
726     }
727     public void resizeCanvasElements()
728     {
729         Gtk.Allocation alloc;
730         this.win.clutterembed.el.get_allocation(out alloc);
731
732            // print("WindowState.resizeCanvasElements\n");
733             if (!this.children_loaded || this.win.clutterembed == null) {
734                 print("WindowState.resizeCanvasElements = ingnore not loaded or no clutterfiles\n");
735             return; 
736         }
737             
738         var avail = alloc.width < 50.0f ? 0 :  alloc.width - 50.0f;
739         var palsize = avail < 300.0f ? avail : 300.0f;
740            
741  
742         // -------- code edit min 600
743         
744         var codesize = avail < 800.0f ? avail : 800.0f;
745         
746         
747         //print("set code size %f\n", codesize);
748
749             
750         
751         switch ( this.state) {
752             case State.PREVIEW:
753                 this.win.rooview.el.set_size(alloc.width-50, alloc.height);
754                 break;
755     
756             case State.FILES: 
757                 this.clutterfiles.set_size(alloc.width-50, alloc.height);
758                 break;
759
760             case State.PROJECT:
761              
762                 this.win.projecteditview.el.set_size(alloc.width-50, alloc.height / 2.0f);
763                 
764                // this.win.rooview.el.save_easing_state();
765                 //this.win.rooview.el.set_size(alloc.width / 2.0f, alloc.height / 2.0f);
766                 this.win.rooview.el.set_scale(0.5f, 0.5f);
767                 //this.win.rooview.el.restore_easing_state();
768                 break;
769
770             case State.CODE: 
771                 this.win.codeeditview.el.set_size(codesize, alloc.height);
772                 var scale = avail > 0.0f ? (avail - codesize -10 ) / avail : 0.0f;
773                     //this.win.rooview.el.save_easing_state();
774                  
775                 this.win.rooview.el.set_scale(scale,scale);
776                // this.win.rooview.el.restore_easing_state();
777                 break;
778                 
779             case State.PROP:
780             case State.LISTENER:
781                  this.win.addpropsview.el.set_size(palsize, alloc.height);
782                 var scale = avail > 0.0f ? (avail - palsize -10 ) / avail : 0.0f;
783                 this.win.rooview.el.set_scale(scale,scale);
784                 break;
785                 
786             case State.OBJECT:  
787                 this.win.objectview.el.set_size(palsize, alloc.height);    
788                 var scale = avail > 0.0f ? (avail - palsize -10 ) / avail : 0.0f;
789                 //this.win.rooview.el.save_easing_state();
790                 this.win.rooview.el.set_scale(scale,scale);
791                // this.win.rooview.el.restore_easing_state();
792                 break;
793         }
794     }
795
796     // -- buttons show hide.....
797
798     public void buttonsShowHide()
799     {
800         // basically hide everything, then show the relivant..
801
802          this.win.backbutton.el.hide();
803     
804         this.win.projectbutton.el.hide(); // show file nav...
805         this.win.editfilebutton.el.hide();
806         this.win.projecteditbutton.el.hide();
807          
808         
809         this.win.objectshowbutton.el.hide(); // add objects
810         this.win.addpropbutton.el.hide();  
811         this.win.addlistenerbutton.el.hide(); 
812
813     
814     
815         this.win.addprojectbutton.el.hide();
816         this.win.addfilebutton.el.hide();
817         this.win.delprojectbutton.el.hide();
818         this.win.new_window.el.hide();
819         this.win.reload_resources.el.hide();
820         
821         switch (this.state) {
822             
823             case State.PREVIEW:  // this is the default state when working...
824                
825                 this.win.projectbutton.el.show(); // show file nav...
826                 this.win.editfilebutton.el.show();
827                 this.win.projecteditbutton.el.show();
828                  
829                 
830                 this.win.objectshowbutton.el.show(); // add objects
831                 this.win.addpropbutton.el.show();  
832                 this.win.addlistenerbutton.el.show(); 
833                 break;
834             
835            
836             case State.CODE: 
837             case State.PROP:
838             case State.LISTENER:
839             case State.OBJECT:
840                 
841                 this.win.backbutton.el.show();
842                 this.win.objectshowbutton.el.show(); // add objects
843                 this.win.addpropbutton.el.show();  
844                 this.win.addlistenerbutton.el.show(); 
845                 break;
846             
847             case State.PROJECT: 
848                 // anything else?
849                 this.win.backbutton.el.show();
850                 break;
851             
852     
853             case State.FILES:
854                 this.win.backbutton.el.show();
855                      
856                 this.win.addprojectbutton.el.show();
857                 this.win.addfilebutton.el.show();
858                 this.win.delprojectbutton.el.show();
859                 this.win.new_window.el.show();
860                 this.win.reload_resources.el.show();
861                 break;
862         }
863
864     }
865
866     
867 }
868
869