src/Builder4/config1.builder
[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         this.window_gladeview.main_window = this.win;
450     }
451     
452     public void easingSaveAll()
453     {
454         this.win.addpropsview.el.save_easing_state();
455         this.win.codeeditview.el.save_easing_state();
456         this.win.objectview.el.save_easing_state();
457         this.win.projecteditview.el.save_easing_state();
458         this.win.rooview.el.save_easing_state();
459         this.clutterfiles.el.save_easing_state();
460          
461     }
462     public void easingRestoreAll()
463     {
464         this.win.addpropsview.el.restore_easing_state();
465         this.win.codeeditview.el.restore_easing_state();
466         this.win.objectview.el.restore_easing_state();
467         this.win.projecteditview.el.restore_easing_state();
468         this.win.rooview.el.restore_easing_state();
469         this.clutterfiles.el.restore_easing_state();
470         
471     }
472     public void switchState(State new_state)
473     {
474         
475         // save the easing state of everything..
476         this.easingSaveAll();
477         
478         switch (this.state) {
479
480             case State.PREVIEW:
481                 if (this.left_tree.getActiveFile() != null) {
482                      if (this.left_tree.getActiveFile().xtype == "Roo" ) {
483                          this.window_rooview.createThumb();
484                      } else {
485                           this.window_gladeview.createThumb();
486                       }
487                 }
488                 // normally we are going from preview to another state.
489                 // and different windows hide the preview in differnt ways..
490                 
491                 break;
492             
493            case State.LISTENER:
494            case State.PROP:
495                 
496                 this.win.addpropsview.el.set_scale(0.0f,0.0f);
497                  break;
498                 
499             case State.CODE:
500
501
502                 this.code_editor.saveContents();
503               
504                 this.win.codeeditview.el.set_scale(0.0f,0.0f);
505                  break;
506
507
508              case State.OBJECT:
509                
510                 this.win.objectview.el.set_scale(0.0f,0.0f);
511                  break;
512
513            case State.PROJECT:
514                 if (this.win.project.xtype == "Gtk") {
515                     this.vala_projectsettings.save();
516                 } 
517                 
518                 this.win.projecteditview.el.set_scale(0.0f,0.0f);
519                  break;
520
521           case State.FILES:
522                 // hide files...
523                 
524                 this.win.rooview.el.show_all();
525                 this.win.rooview.el.set_easing_duration(1000);
526                 this.win.rooview.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
527                 this.win.rooview.el.set_scale(1.0f,1.0f);
528                 this.win.rooview.el.set_pivot_point(0.5f,0.5f);
529                 this.win.rooview.el.set_opacity(0xff);
530                
531                 
532                
533                  this.clutterfiles.el.set_easing_duration(1000);
534                 this.clutterfiles.el.set_pivot_point(0.5f,0.5f);
535                 this.clutterfiles.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, -180.0f);
536                 this.clutterfiles.el.set_opacity(0);
537  
538                 //this.clutterfiles.el.hide();
539                  
540
541                 break;
542
543                 
544         }
545        
546         var oldstate  =this.state;
547         this.state = new_state;
548         
549         
550                 
551         this.buttonsShowHide();
552         
553         
554         switch (this.state) {
555             
556             case State.PREVIEW:  // this is the default state when working...
557                  this.win.editpane.el.show(); // holder for tree and properties..
558                  
559              
560                  this.left_projects.el.hide(); 
561                  if (oldstate != State.FILES) {
562                     // it's handled above..
563                     print ("changing state to preview from NOT files..");
564                      
565  
566                     this.win.rooview.el.set_scale(1.0f,1.0f);
567                  }
568                
569                 break;
570
571
572             case State.LISTENER:
573                 // same as prop?
574             case State.PROP:
575                 var ae =      this.left_tree.getActiveElement();
576                 if (ae == null) {
577                     this.state = oldstate;
578                     this.buttonsShowHide();
579                     this.resizeCanvasElements();
580                     this.easingRestoreAll();
581                     return;
582                 }
583                 this.add_props.el.show_all();
584                 this.add_props.show(
585                     Palete.factory(this.win.project.xtype), 
586                     this.state == State.LISTENER ? "signals" : "props",
587                     ae.fqn()
588                 );
589  
590                     
591  
592                 
593                 // -- FIXME? this needs to be State aware?
594          
595                 this.win.rooview.el.set_pivot_point(1.0f,0.5f);
596                   
597                 this.win.addpropsview.el.set_scale(1.0f,1.0f);
598                  break;
599            
600             case State.OBJECT:
601                  var n = this.left_tree.getActiveElement();
602
603                 if (this.left_tree.model.file == null) {
604                     this.state =oldstate;
605                     this.buttonsShowHide();
606                     this.resizeCanvasElements();
607                     this.easingRestoreAll();
608                     return;
609                 }
610                 
611                 if (n == null && this.left_tree.model.file.tree != null) {
612                     this.state = oldstate;
613                     this.buttonsShowHide();
614                     this.resizeCanvasElements();
615                     this.easingRestoreAll();
616                     return;
617                 }
618
619                 this.rightpalete.el.show_all();
620                 this.rightpalete.load(this.left_tree.getActiveFile().palete(), n == null ? "*top" : n.fqn());
621
622                 
623               
624             
625                 this.win.objectview.el.set_scale(1.0f,1.0f);
626                  
627                 break;
628                
629                
630             case State.CODE:
631
632                 this.code_editor.el.show_all();
633                 
634                 // caller needs to call editor - show....
635                   
636  
637                  this.win.codeeditview.el.set_scale(1.0f,1.0f);
638                  break;
639
640
641
642            case State.PROJECT:
643
644                if (this.win.project.xtype == "Roo") {
645                     this.projectsettings.el.show_all();
646                     this.projectsettings.show(this.win.project);
647                 } else {
648                     this.vala_projectsettings.el.show_all();
649                     this.vala_projectsettings.show((Project.Gtk)this.win.project);
650                 }
651
652                 this.win.rooview.el.set_pivot_point(1.0f,1.0f); // bottom right..
653                 
654                 this.win.projecteditview.el.set_scale(1.0f,1.0f);
655                 
656                
657                 break;
658                 
659            case State.FILES:  // can only get here from PREVIEW state.. in theory..
660                 
661    
662                 this.win.editpane.el.hide(); // holder for tree and properties..
663              
664                 this.left_projects.el.show(); 
665             
666                  this.win.rooview.el.set_easing_duration(1000);
667                 this.win.rooview.el.set_pivot_point(0.5f,0.5f);
668                 this.win.rooview.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 180.0f);
669                 this.win.rooview.el.set_opacity(0);
670                 //el.set_scale(0.0f,0.0f);
671
672  
673                 if (this.win.project != null) {
674                     this.left_projects.selectProject(this.win.project);
675                 }
676              
677                 
678                 this.clutterfiles.el.show_all();
679                  
680                 this.clutterfiles.el.set_easing_duration(1000);
681                 this.clutterfiles.el.set_pivot_point(0.5f,0.5f);
682                 this.clutterfiles.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
683                 this.clutterfiles.el.set_opacity(0xff);
684                 
685                 
686                 
687                 break;
688
689
690         }
691         this.resizeCanvasElements();
692         this.easingRestoreAll();
693         
694             
695     }
696     
697     public int redraw_count = 0;
698     public void resizeCanvas() // called by window resize .. delays redraw
699     {
700         var rc = this.redraw_count;        
701         this.redraw_count = 2;
702         if (rc == 0) {
703             GLib.Timeout.add(100,  ()  =>{
704                  return this.resizeCanvasQueue();
705             });
706         }
707     }
708     public bool  resizeCanvasQueue()
709     {
710         //print("WindowState.resizeCanvasQueue %d\n", this.redraw_count);        
711
712         if (this.redraw_count < 1) {
713             return false; // should not really happen...
714         }
715
716
717         this.redraw_count--;
718
719         if (this.redraw_count > 0) {
720             return true; // do it again in 1 second...
721         }
722         // got down to 0 or -1....
723         this.redraw_count = 0;
724         this.resizeCanvasElements();
725         return false;
726
727     }
728     public void resizeCanvasElements()
729     {
730         Gtk.Allocation alloc;
731         this.win.clutterembed.el.get_allocation(out alloc);
732
733            // print("WindowState.resizeCanvasElements\n");
734             if (!this.children_loaded || this.win.clutterembed == null) {
735                 print("WindowState.resizeCanvasElements = ingnore not loaded or no clutterfiles\n");
736             return; 
737         }
738             
739         var avail = alloc.width < 50.0f ? 0 :  alloc.width - 50.0f;
740         var palsize = avail < 300.0f ? avail : 300.0f;
741            
742  
743         // -------- code edit min 600
744         
745         var codesize = avail < 800.0f ? avail : 800.0f;
746         
747         
748         //print("set code size %f\n", codesize);
749
750             
751         
752         switch ( this.state) {
753             case State.PREVIEW:
754                 this.win.rooview.el.set_size(alloc.width-50, alloc.height);
755                 break;
756     
757             case State.FILES: 
758                 this.clutterfiles.set_size(alloc.width-50, alloc.height);
759                 break;
760
761             case State.PROJECT:
762              
763                 this.win.projecteditview.el.set_size(alloc.width-50, alloc.height / 2.0f);
764                 
765                // this.win.rooview.el.save_easing_state();
766                 //this.win.rooview.el.set_size(alloc.width / 2.0f, alloc.height / 2.0f);
767                 this.win.rooview.el.set_scale(0.5f, 0.5f);
768                 //this.win.rooview.el.restore_easing_state();
769                 break;
770
771             case State.CODE: 
772                 this.win.codeeditview.el.set_size(codesize, alloc.height);
773                 var scale = avail > 0.0f ? (avail - codesize -10 ) / avail : 0.0f;
774                     //this.win.rooview.el.save_easing_state();
775                  
776                 this.win.rooview.el.set_scale(scale,scale);
777                // this.win.rooview.el.restore_easing_state();
778                 break;
779                 
780             case State.PROP:
781             case State.LISTENER:
782                  this.win.addpropsview.el.set_size(palsize, alloc.height);
783                 var scale = avail > 0.0f ? (avail - palsize -10 ) / avail : 0.0f;
784                 this.win.rooview.el.set_scale(scale,scale);
785                 break;
786                 
787             case State.OBJECT:  
788                 this.win.objectview.el.set_size(palsize, alloc.height);    
789                 var scale = avail > 0.0f ? (avail - palsize -10 ) / avail : 0.0f;
790                 //this.win.rooview.el.save_easing_state();
791                 this.win.rooview.el.set_scale(scale,scale);
792                // this.win.rooview.el.restore_easing_state();
793                 break;
794         }
795     }
796
797     // -- buttons show hide.....
798
799     public void buttonsShowHide()
800     {
801         // basically hide everything, then show the relivant..
802
803          this.win.backbutton.el.hide();
804     
805         this.win.projectbutton.el.hide(); // show file nav...
806         this.win.editfilebutton.el.hide();
807         this.win.projecteditbutton.el.hide();
808          
809         
810         this.win.objectshowbutton.el.hide(); // add objects
811         this.win.addpropbutton.el.hide();  
812         this.win.addlistenerbutton.el.hide(); 
813
814     
815     
816         this.win.addprojectbutton.el.hide();
817         this.win.addfilebutton.el.hide();
818         this.win.delprojectbutton.el.hide();
819         this.win.new_window.el.hide();
820         this.win.reload_resources.el.hide();
821         
822         switch (this.state) {
823             
824             case State.PREVIEW:  // this is the default state when working...
825                
826                 this.win.projectbutton.el.show(); // show file nav...
827                 this.win.editfilebutton.el.show();
828                 this.win.projecteditbutton.el.show();
829                  
830                 
831                 this.win.objectshowbutton.el.show(); // add objects
832                 this.win.addpropbutton.el.show();  
833                 this.win.addlistenerbutton.el.show(); 
834                 break;
835             
836            
837             case State.CODE: 
838             case State.PROP:
839             case State.LISTENER:
840             case State.OBJECT:
841                 
842                 this.win.backbutton.el.show();
843                 this.win.objectshowbutton.el.show(); // add objects
844                 this.win.addpropbutton.el.show();  
845                 this.win.addlistenerbutton.el.show(); 
846                 break;
847             
848             case State.PROJECT: 
849                 // anything else?
850                 this.win.backbutton.el.show();
851                 break;
852             
853     
854             case State.FILES:
855                 this.win.backbutton.el.show();
856                      
857                 this.win.addprojectbutton.el.show();
858                 this.win.addfilebutton.el.show();
859                 this.win.delprojectbutton.el.show();
860                 this.win.new_window.el.show();
861                 this.win.reload_resources.el.show();
862                 break;
863         }
864
865     }
866
867     
868 }
869
870