KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Raptor > model > raptor_mainModel


1 /*******************************************************************************
2  * Copyright (c) 2004, Dirk von der Weiden.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution.
6  *
7  * Contributors:
8  * Dirk von der Weiden - initial API and implementation
9  *
10  * Created on 04.04.2004
11  *
12  * date: 04.04.2004
13  * project: WiSer Builder
14  *
15  *******************************************************************************/

16
17 package Raptor.model;
18
19 import java.io.*;
20 import java.util.*;
21
22 import Jmc.model.*;
23 import Jmc.commonGui.*;
24 import Jmc.connector.xml_parameterWriter;
25 import Jmc.baseTools.*;
26 import Jmc.baseGui.*;
27 import Jmc.persist.*;
28 import Jmc.webAppl.*;
29 import Jmc.swingAppl.*;
30 import Jmc.webGui.*;
31
32 /**
33  * @author Dirk
34  *
35  * date: 01.08.2003
36  * project: WiSer-Builder
37  *
38  * <p>
39  * ...
40  * </p>
41  */

42 public class raptor_mainModel extends base_modelValue
43 {
44   private base_treeNode pem_treeNodeSelection = null;
45   private base_multipleModelValue_if pem_treeSelection = null;
46   private base_multipleModelValue_if pem_inEditor = null;
47   private base_multipleModelValue_if pem_locked = null;
48   private String JavaDoc pem_ProjectName = null;
49   private base_guiObj pem_messageTable = null;
50   private base_guiObj pem_sourceWin = null;
51   private base_guiObj pem_appTree = null;
52   private base_guiObj pem_editWin = null;
53   private base_guiObj pem_widgetSelect= null;
54   private base_guiObj pem_pathWin = null;
55   private base_appl_if pem_appl = null;
56   private base_fileChooser_if pem_fc = null;
57   private base_menu_if pem_ctxMenu = null;
58   private raptor_settings pem_settings = new raptor_settings ();
59
60   private int pem_trCount = 0;
61   private int pem_maxtrCount = 0;
62    
63   private base_modelValue_if pem_root = null;
64
65   private base_ringBuffer pem_mbuff = new base_ringBuffer ();
66
67   private base_multipleModelValue_if pem_preview_swing = null;
68   private String JavaDoc pem_swingpname = null;
69
70   private base_form_if pem_swingPDialog = null;
71   private base_dialog_if pem_dialog = null;
72
73   private base_multipleModelValue_if pem_preview_html = null;
74   private String JavaDoc pem_htmlpname = null;
75   private base_appl_if pem_webAppl = null;
76   private base_registredObject pem_id1 = null;
77   private base_registredObject pem_id2 = null;
78   private base_registredObject pem_id3 = null;
79   private base_registredObject pem_id4 = null;
80   private base_registredObject pem_id5 = null;
81   private boolean pem_undoredo = true;
82
83   private gui_objFactory pem_fact = null;
84   
85   public raptor_mainModel ( base_multipleModelValue_if xtreeSelection,
86                             base_multipleModelValue_if xinEditor,
87                             String JavaDoc xProjectName,
88                             base_guiObj xmessageWin,
89                             base_guiObj xsourceWin,
90                             base_guiObj xappTree,
91                             base_guiObj xeditWin,
92                             base_guiObj xwidgetSelcet,
93                             base_guiObj xpathWin,
94                             base_appl_if xappl,
95                             base_fileChooser_if xFc,
96                             base_menu_if xCtx)
97   {
98     this.setPem_appl(xappl);
99     this.setPem_appTree(xappTree);
100     this.setPem_editWin(xeditWin);
101     this.setPem_inEditor(xinEditor);
102     this.setPem_messageTable(xmessageWin);
103     this.setPem_ProjectName(xProjectName);
104     this.setPem_sourceWin(xsourceWin);
105     this.setPem_treeSelection(xtreeSelection);
106     this.setPem_widgetSelect(xwidgetSelcet);
107     this.setPem_pathWin(xpathWin);
108     this.setPem_fc(xFc);
109
110     this.pem_ctxMenu = xCtx;
111     // this.pem_fact = this.pem_appl.pcmf_getGuiObjFactory();
112
this.pem_fact = new gui_objFactory(this.getPem_settings().getPem_actTplKitPar());
113     this.pem_id1 = new base_registredObject ();
114     this.pem_id2 = new base_registredObject ();
115     this.pem_id3 = new base_registredObject ();
116     this.pem_id4 = new base_registredObject ();
117     this.pem_id5 = new base_registredObject ();
118
119     return;
120   }
121   /**
122      * <p>
123      * Does...
124      * </p><p>
125      *
126      * @return a Type with
127      * </p><p>
128      * @param
129      * </p>
130      */

131   public gui_objFactory getPem_factory()
132   {
133     return this.pem_fact;
134   }
135
136   /**
137      * <p>
138      * Does...
139      * </p><p>
140      *
141      * @return a Type with
142      * </p><p>
143      * @param
144      * </p>
145      */

146   public base_multipleModelValue_if getPem_inEditor()
147   {
148     return pem_inEditor;
149   }
150
151     /**
152          * <p>
153          * Does...
154          * </p><p>
155          *
156          * @return a Type with
157          * </p><p>
158          * @param
159          * </p>
160          */

161     public String JavaDoc getPem_ProjectName()
162     {
163         return pem_ProjectName;
164     }
165
166     /**
167          * <p>
168          * Does...
169          * </p><p>
170          *
171          * @return a Type with
172          * </p><p>
173          * @param
174          * </p>
175          */

176     public base_multipleModelValue_if getPem_treeSelection()
177     {
178         return pem_treeSelection;
179     }
180
181     /**
182          * <p>
183          * Does...
184          * </p><p>
185          *
186          * @return a Type with
187          * </p><p>
188          * @param
189          * </p>
190          */

191     public void setPem_inEditor(base_multipleModelValue_if value_if)
192     {
193     pem_inEditor = value_if;
194     if (value_if == null)
195       return;
196
197     base_guiObj l_pane = (base_guiObj)value_if.pcmf_getUiMap();
198     if (l_pane != null)
199     {
200       base_guiObj l_li = (base_guiObj)l_pane.pcmf_getSubNode("icon_linked");
201       base_guiObj l_ul = (base_guiObj)l_pane.pcmf_getSubNode("icon_unlinked");
202
203       base_treeElement l_node = (base_treeElement)value_if;
204       if (l_node != null)
205       {
206         if (l_node.pcmf_getParentNode() == null)
207         {
208           l_ul.pcmf_enable();
209           l_li.pcmf_disable();
210
211           ((base_treeNode)base_registredObject.pcmf_getObjByName("insertM1")).pcmf_enable();
212           ((base_treeNode)base_registredObject.pcmf_getObjByName("insertM2")).pcmf_enable();
213           ((base_treeNode)base_registredObject.pcmf_getObjByName("insertM3")).pcmf_enable();
214           
215           ((base_menu_if)base_registredObject.pcmf_getObjByName("CtxMenu")).pcmf_commitMenu();
216           ((base_menu_if)base_registredObject.pcmf_getObjByName("MainMenu")).pcmf_commitMenu();
217         }
218         else
219         {
220           l_li.pcmf_enable();
221           l_ul.pcmf_disable();
222
223           ((base_treeNode)base_registredObject.pcmf_getObjByName("insertM1")).pcmf_disable();
224           ((base_treeNode)base_registredObject.pcmf_getObjByName("insertM2")).pcmf_disable();
225           ((base_treeNode)base_registredObject.pcmf_getObjByName("insertM3")).pcmf_disable();
226
227           ((base_menu_if)base_registredObject.pcmf_getObjByName("CtxMenu")).pcmf_commitMenu();
228           ((base_menu_if)base_registredObject.pcmf_getObjByName("MainMenu")).pcmf_commitMenu();
229         }
230       }
231     }
232     }
233
234     /**
235          * <p>
236          * Does...
237          * </p><p>
238          *
239          * @return a Type with
240          * </p><p>
241          * @param
242          * </p>
243          */

244     public void setPem_ProjectName(String JavaDoc string)
245     {
246         pem_ProjectName = string;
247     }
248
249     /**
250          * <p>
251          * Does...
252          * </p><p>
253          *
254          * @return a Type with
255          * </p><p>
256          * @param
257          * </p>
258          */

259     public void setPem_treeSelection(base_multipleModelValue_if value_if)
260     {
261         pem_treeSelection = value_if;
262     }
263
264     /**
265          * <p>
266          * Does...
267          * </p><p>
268          *
269          * @return a Type with
270          * </p><p>
271          * @param
272          * </p>
273          */

274     public base_appl_if getPem_appl()
275     {
276         return pem_appl;
277     }
278
279     /**
280          * <p>
281          * Does...
282          * </p><p>
283          *
284          * @return a Type with
285          * </p><p>
286          * @param
287          * </p>
288          */

289     public base_guiObj getPem_appTree()
290     {
291         return pem_appTree;
292     }
293
294     /**
295          * <p>
296          * Does...
297          * </p><p>
298          *
299          * @return a Type with
300          * </p><p>
301          * @param
302          * </p>
303          */

304     public base_guiObj getPem_editWin()
305     {
306         return pem_editWin;
307     }
308
309     /**
310          * <p>
311          * Does...
312          * </p><p>
313          *
314          * @return a Type with
315          * </p><p>
316          * @param
317          * </p>
318          */

319     public base_guiObj getPem_pathWin()
320     {
321         return pem_pathWin;
322     }
323
324     /**
325          * <p>
326          * Does...
327          * </p><p>
328          *
329          * @return a Type with
330          * </p><p>
331          * @param
332          * </p>
333          */

334     public base_guiObj getPem_sourceWin()
335     {
336         return pem_sourceWin;
337     }
338
339     /**
340          * <p>
341          * Does...
342          * </p><p>
343          *
344          * @return a Type with
345          * </p><p>
346          * @param
347          * </p>
348          */

349     public base_guiObj getPem_widgetSelect()
350     {
351         return pem_widgetSelect;
352     }
353
354     /**
355          * <p>
356          * Does...
357          * </p><p>
358          *
359          * @return a Type with
360          * </p><p>
361          * @param
362          * </p>
363          */

364     public void setPem_appl(base_appl_if base_appl_if)
365     {
366         pem_appl = base_appl_if;
367     }
368
369     /**
370          * <p>
371          * Does...
372          * </p><p>
373          *
374          * @return a Type with
375          * </p><p>
376          * @param
377          * </p>
378          */

379     public void setPem_appTree(base_guiObj obj)
380     {
381         pem_appTree = obj;
382     }
383
384     /**
385          * <p>
386          * Does...
387          * </p><p>
388          *
389          * @return a Type with
390          * </p><p>
391          * @param
392          * </p>
393          */

394     public void setPem_editWin(base_guiObj obj)
395     {
396         pem_editWin = obj;
397     }
398
399     /**
400          * <p>
401          * Does...
402          * </p><p>
403          *
404          * @return a Type with
405          * </p><p>
406          * @param
407          * </p>
408          */

409     public void setPem_messageTable(base_guiObj obj)
410     {
411         pem_messageTable = obj;
412     }
413
414     /**
415          * <p>
416          * Does...
417          * </p><p>
418          *
419          * @return a Type with
420          * </p><p>
421          * @param
422          * </p>
423          */

424     public void setPem_pathWin(base_guiObj obj)
425     {
426         pem_pathWin = obj;
427     }
428
429     /**
430          * <p>
431          * Does...
432          * </p><p>
433          *
434          * @return a Type with
435          * </p><p>
436          * @param
437          * </p>
438          */

439     public void setPem_sourceWin(base_guiObj obj)
440     {
441         pem_sourceWin = obj;
442     }
443
444     /**
445          * <p>
446          * Does...
447          * </p><p>
448          *
449          * @return a Type with
450          * </p><p>
451          * @param
452          * </p>
453          */

454     public void setPem_widgetSelect(base_guiObj obj)
455     {
456         pem_widgetSelect = obj;
457     }
458
459     /**
460          * <p>
461          * Does...
462          * </p><p>
463          *
464          * @return a Type with
465          * </p><p>
466          * @param
467          * </p>
468          */

469     public base_fileChooser_if getPem_fc()
470     {
471         return pem_fc;
472     }
473
474     /**
475          * <p>
476          * Does...
477          * </p><p>
478          *
479          * @return a Type with
480          * </p><p>
481          * @param
482          * </p>
483          */

484     public void setPem_fc(base_fileChooser_if chooser_if)
485     {
486         pem_fc = chooser_if;
487     }
488
489     /**
490          * <p>
491          * Does...
492          * </p><p>
493          *
494          * @return a Type with
495          * </p><p>
496          * @param
497          * </p>
498          */

499     public base_ringBuffer getPem_mbuff()
500     {
501         return pem_mbuff;
502     }
503
504     public static int RAPTOR_ERROR = 0;
505     public static int RAPTOR_MESSAGE = 1;
506     public static int RAPTOR_INFO = 2;
507     
508   public void pcmf_addMessage (String JavaDoc xMessage, int xType)
509   {
510     base_table_if l_table = (base_table_if)this.pem_messageTable;
511     ArrayList l_row = new ArrayList (1);
512     
513     if (xType == RAPTOR_MESSAGE)
514         l_row.add(base_registredObject.pcmf_getObjByName("warn_icon"));
515     else
516     if (xType == RAPTOR_INFO)
517         l_row.add(base_registredObject.pcmf_getObjByName("info_icon"));
518     else
519     if (xType == RAPTOR_ERROR)
520         l_row.add(base_registredObject.pcmf_getObjByName("error_icon"));
521     else
522         l_row.add("");
523     
524     l_row.add(xMessage);
525     
526     base_table l_content = l_table.pcmf_getComplete();
527     l_content.pcmf_addRowArrayList(0,l_row);
528     
529     base_guiWidget_if l_cnt = (base_guiWidget_if)base_registredObject.pcmf_getObjByName("mMaxLines");
530     
531     try
532         {
533         int l_icnt = Integer.parseInt(l_cnt.pcmf_getValue().toString());
534         if (l_content.pcmf_getRowCnt() > l_icnt)
535             l_content.pcmf_removeRow(l_icnt);
536         }
537     catch (Exception JavaDoc e)
538         {
539         ((base_guiWidget_if)base_registredObject.pcmf_getObjByName("mMaxLines")).pcmf_setValue("10");
540         this.pcmf_addMessage(xMessage, xType);
541         this.pcmf_addMessage("- please enter a valid number", raptor_mainModel.RAPTOR_ERROR);
542         return;
543         }
544     l_table.pcmf_setComplete(l_content);
545     
546     l_table.pcmf_commitTable();
547     l_table.pcmf_repaint();
548     
549     this.pem_messageTable.pcmf_repaint();
550   }
551
552   public void pcmf_refreshSourceView ()
553   {
554     ByteArrayOutputStream l_stream = new ByteArrayOutputStream();
555     base_dataXmlWriter l_w = new base_dataXmlWriter (l_stream);
556
557     if (this.pem_treeSelection == null)
558       return;
559
560     l_w.pcmf_format(" ");
561     String JavaDoc l_tpl = this.pem_treeSelection.pcmf_getMyTemplate();
562     if (l_tpl == null)
563       return;
564
565     l_w.pcmf_writeModel(l_tpl, this.pem_treeSelection);
566     this.pem_sourceWin.pcmf_setValue(l_stream.toString());
567     ((base_scrollController_if)this.pem_sourceWin).pcmf_scrollYAbs(0);
568     this.pem_sourceWin.pcmf_repaint();
569         
570     return;
571   }
572
573   public void pcmf_createHtmlWdgPreview ()
574   {
575     try
576     {
577       if (pem_treeSelection.pcmf_getMyTemplate().equals("page"))
578         throw (new Exception JavaDoc ("not valid"));
579
580       if (this.pem_swingPDialog == null)
581       {
582         pem_dialog = this.pem_appl.pcmf_getGuiObjFactory().pcmf_createDialog(gui_objFactory.HTML, "HTML Widget-Preview", false, this.pem_appl);
583         
584         if (((base_webAppl)this.pem_appl).pcmf_canHandleIForm())
585           this.pem_swingPDialog = this.pem_appl.pcmf_getGuiObjFactory().pcmf_createIForm(gui_objFactory.HTML, "SP-Form", false, pem_appl);
586         else
587           this.pem_swingPDialog = this.pem_appl.pcmf_getGuiObjFactory().pcmf_createForm(gui_objFactory.HTML, "SP-Form", false, pem_appl);
588
589         pem_dialog.pcmf_getGuiObj().pcmf_addNode("SP-Form", this.pem_swingPDialog.pcmf_getGuiObj());
590         pem_appl.pcmf_getGuiObj().pcmf_addNode("HTML Widget-Preview", (base_treeNode)pem_dialog);
591       };
592
593       this.pem_swingPDialog.pcmf_getGuiObj().pcmf_clearAndRelease();
594
595       gui_applProducer l_prod = new gui_applProducer(null, this.pem_fact);
596       this.pcmf_refreshSourceView();
597
598       if (this.pem_webAppl != null)
599         this.pem_webAppl.pcmf_getGuiObj().pcmf_releaseSubs();
600
601       this.pem_webAppl = this.pem_fact.pcmf_createAppl(gui_objFactory.HTML, this.pem_appl.pcmf_getRootUrl(), this.pem_appl.pcmf_getPort(), false);
602       
603       if (this.pem_appl instanceof base_webAppl)
604         ((base_webAppl)this.pem_webAppl).pcmf_setRenderer( ((base_webAppl)this.pem_appl).pcmf_getRenderer() ) ;
605       
606       ((base_webAppl)this.pem_webAppl).pcmf_setTemplateKit(new html_templateKit("environment.xml", this.getPem_settings().getPem_actTplKit(), this.pem_fact, this.getPem_settings().getPem_actTplKit()));
607       
608       l_prod.pcmf_setTerminateOnError(false);
609       l_prod.pcmf_produceFromString (gui_objFactory.HTML, this.pem_sourceWin.pcmf_getValue(), this.pem_swingPDialog.pcmf_getGuiObj(), this.pem_webAppl);
610       this.pem_webAppl.pcmf_addPage("tmp", this.pem_fact.pcmf_createGuiPage(gui_objFactory.HTML, "tmp", true, pem_webAppl));
611
612       pem_dialog.pcmf_displayDialog();
613     }
614     catch (Exception JavaDoc e)
615     {
616       this.pcmf_addMessage("- please select a valid widget to preview, absolute positioning not allowed for root-node", raptor_mainModel.RAPTOR_MESSAGE);
617     }
618
619     return;
620   }
621
622   public void pcmf_createSwingWdgPreview ()
623   {
624     try
625     {
626       if (this.pem_swingPDialog == null)
627       {
628         pem_dialog = this.pem_appl.pcmf_getGuiObjFactory().pcmf_createDialog(gui_objFactory.SWING, "Swing Widget-Preview", false, this.pem_appl);
629         this.pem_swingPDialog = this.pem_appl.pcmf_getGuiObjFactory().pcmf_createForm(gui_objFactory.SWING, "SP-Form", false, pem_appl);
630
631         pem_dialog.pcmf_getGuiObj().pcmf_addNode("SP-Form", this.pem_swingPDialog.pcmf_getGuiObj());
632       };
633
634       this.pem_swingPDialog.pcmf_getGuiObj().pcmf_clear();
635
636       gui_applProducer l_prod = new gui_applProducer(null, this.pem_fact);
637       this.pcmf_refreshSourceView();
638
639       l_prod.pcmf_setTerminateOnError(false);
640       this.pem_fact.pcmf_resetPluginStatics();
641       l_prod.pcmf_produceFromStringInOwnThread(gui_objFactory.SWING, this.pem_sourceWin.pcmf_getValue(), this.pem_swingPDialog.pcmf_getGuiObj(), this.pem_appl, "PREVIEW" + this.pem_id1.pcmf_getObjName());
642
643       pem_dialog.pcmf_displayDialog();
644     }
645     catch (Exception JavaDoc e)
646     {
647       this.pcmf_addMessage("- please select a valid widget to preview, absolute positioning not allowed for root-node", raptor_mainModel.RAPTOR_MESSAGE);
648     }
649     return;
650   }
651
652   public void pcmf_cleanupPreview()
653   {
654     if (this.pem_dialog != null)
655       this.pem_dialog.pcmf_hideDialog();
656
657     base_treeNode l_node = (base_treeNode)this.pem_appl.pcmf_getGuiObj().pcmf_getSubNode(this.pem_swingpname);
658     if (l_node != null)
659     {
660       this.pem_appl.pcmf_getGuiObj().pcmf_removeNode(this.pem_swingpname);
661     };
662
663     base_registredObject.pcmf_removeContext("PREVIEW" + this.pem_id1.pcmf_getObjName());
664     base_registredObject.pcmf_removeContext("PREVIEW" + this.pem_id2.pcmf_getObjName());
665     base_registredObject.pcmf_removeContext("PREVIEW" + this.pem_id3.pcmf_getObjName());
666     base_registredObject.pcmf_removeContext("PREVIEW" + this.pem_id4.pcmf_getObjName());
667     base_registredObject.pcmf_removeContext("PREVIEW" + this.pem_id5.pcmf_getObjName());
668   }
669
670   public void pcmf_loadTplKitValues (String JavaDoc xBlock)
671   {
672     if (this.pem_webAppl != null)
673       this.pem_webAppl.pcmf_getGuiObj().pcmf_releaseSubs();
674
675     this.pem_webAppl = this.pem_fact.pcmf_createAppl(gui_objFactory.HTML, this.pem_appl.pcmf_getRootUrl(), this.pem_appl.pcmf_getPort(), false);
676     html_templateKit l_kit = new html_templateKit("environment.xml", xBlock, this.pem_fact, xBlock);
677     ((base_webAppl)this.pem_webAppl).pcmf_setTemplateKit(l_kit);
678
679     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_SUBMIT")).pcmf_setValue (l_kit.getSUBMIT().toRawString());
680     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_SUBMIT_T")).pcmf_setValue (l_kit.getSUBMIT_T().toRawString());
681     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_TOOLTIP")).pcmf_setValue (l_kit.getTOOLTIP().toRawString());
682     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_COLORS")).pcmf_setValue (l_kit.getCOLORS().toRawString());
683     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_POSITION")).pcmf_setValue (l_kit.getPOSITION().toRawString());
684     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_DPOSITION")).pcmf_setValue (l_kit.getDPOSITION().toRawString());
685     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_DLPOSITION")).pcmf_setValue (l_kit.getDLPOSITION().toRawString());
686     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_CHANNEL_DRAG")).pcmf_setValue (l_kit.getCHANNEL_DRAG().toRawString());
687     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_CHANNEL_DROP")).pcmf_setValue (l_kit.getCHANNEL_DROP().toRawString());
688     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_CHANNEL_GF")).pcmf_setValue (l_kit.getCHANNEL_GF().toRawString());
689     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_CHANNEL_LF")).pcmf_setValue (l_kit.getCHANNEL_LF().toRawString());
690     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_CHANNEL_CLK")).pcmf_setValue (l_kit.getCHANNEL_CLK().toRawString());
691     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_CTXMENU")).pcmf_setValue (l_kit.getCTXMENU().toRawString());
692     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_FONT")).pcmf_setValue (l_kit.getFONT().toRawString());
693     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_FOCUS")).pcmf_setValue (l_kit.getFOCUS().toRawString());
694     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_BGIMG")).pcmf_setValue (l_kit.getBGIMG().toRawString());
695     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_BORDER")).pcmf_setValue (l_kit.getBORDER().toRawString());
696     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_FSIZE")).pcmf_setValue (l_kit.getFSIZE().toRawString());
697
698     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_WRAP")).pcmf_setValue (l_kit.getWRAP().toRawString());
699     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_WRAPCOM")).pcmf_setValue (l_kit.getWRAPCOM().toRawString());
700     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_COMFRAME")).pcmf_setValue (l_kit.getCOMFRAME().toRawString());
701     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_INSERTOL")).pcmf_setValue (l_kit.getINSERTOL().toRawString());
702     ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_COMFRAMEFR")).pcmf_setValue (l_kit.getCOMFRAMEFR().toRawString());
703   }
704
705   public void pcmf_showFactorySettings()
706   {
707     base_guiObj l_disable = (base_guiObj)base_registredObject.pcmf_getObjByName("disableFact");
708     if (l_disable.pcmf_getValue().equals("CHECKED"))
709     {
710       l_disable.pcmf_getParentNode().pcmf_getSubNode("pane").pcmf_getSubNode("ResTable").pcmf_disable();
711       l_disable.pcmf_getParentNode().pcmf_getSubNode("edit").pcmf_disable();
712       l_disable.pcmf_getParentNode().pcmf_getSubNode("save changes").pcmf_disable();
713
714       return;
715     }
716     else
717     {
718       l_disable.pcmf_getParentNode().pcmf_getSubNode("pane").pcmf_getSubNode("ResTable").pcmf_enable();
719       l_disable.pcmf_getParentNode().pcmf_getSubNode("edit").pcmf_enable();
720       l_disable.pcmf_getParentNode().pcmf_getSubNode("save changes").pcmf_enable();
721     }
722     base_guiObj l_update = (base_guiObj)base_registredObject.pcmf_getObjByName("editFact");
723     if (l_update.pcmf_getValue().equals("CHECKED"))
724     {
725       l_disable.pcmf_getParentNode().pcmf_getSubNode("pane").pcmf_getSubNode("ResTable").pcmf_enable();
726       ((base_guiObj)base_registredObject.pcmf_getObjByName("saveFact")).pcmf_enable();
727     }
728     else
729     {
730       l_disable.pcmf_getParentNode().pcmf_getSubNode("pane").pcmf_getSubNode("ResTable").pcmf_disable();
731       ((base_guiObj)base_registredObject.pcmf_getObjByName("saveFact")).pcmf_disable();
732     }
733
734     try
735     {
736       ((base_guiObj)base_registredObject.pcmf_getObjByName("fact_interfaces")).pcmf_setValue(base_tools.pcmf_array2String(this.pem_fact.pcmf_getSwingClass(this.pem_inEditor.pcmf_getMyTemplate()).getInterfaces(), 10, 0, 1));
737       
738       if (this.pem_fact.pcmf_getSwingClass(this.pem_inEditor.pcmf_getMyTemplate()) != null)
739         ((base_guiObj)base_registredObject.pcmf_getObjByName("inp_swingClass")).pcmf_setValue(this.pem_fact.pcmf_getSwingClass(this.pem_inEditor.pcmf_getMyTemplate()).toString().substring(6));
740       else
741         ((base_guiObj)base_registredObject.pcmf_getObjByName("inp_swingClass")).pcmf_setValue("");
742       
743       if (this.pem_fact.pcmf_getHtmlClass(this.pem_inEditor.pcmf_getMyTemplate()) != null)
744             ((base_guiObj)base_registredObject.pcmf_getObjByName("inp_htmlClass")).pcmf_setValue(this.pem_fact.pcmf_getHtmlClass(this.pem_inEditor.pcmf_getMyTemplate()).toString().substring(6));
745       else
746         ((base_guiObj)base_registredObject.pcmf_getObjByName("inp_htmlClass")).pcmf_setValue("");
747       
748       ((base_guiObj)base_registredObject.pcmf_getObjByName("inp_htmlTpl")).pcmf_setValue(this.pem_fact.pcmf_getHtmlTemplate(this.pem_inEditor.pcmf_getMyTemplate())!=null?this.pem_fact.pcmf_getHtmlTemplate(this.pem_inEditor.pcmf_getMyTemplate()):"");
749       
750       if (this.pem_fact.pcmf_getViewClass(this.pem_inEditor.pcmf_getMyTemplate()) != null)
751         ((base_guiObj)base_registredObject.pcmf_getObjByName("inp_htmlView")).pcmf_setValue(this.pem_fact.pcmf_getViewClass(this.pem_inEditor.pcmf_getMyTemplate()).toString().substring(6));
752       else
753         ((base_guiObj)base_registredObject.pcmf_getObjByName("inp_htmlView")).pcmf_setValue("");
754     }
755     catch (Exception JavaDoc e)
756     {
757       ((base_guiObj)base_registredObject.pcmf_getObjByName("fact_interfaces")).pcmf_setValue("N.A.");
758
759       l_disable.pcmf_getParentNode().pcmf_getSubNode("pane").pcmf_getSubNode("ResTable").pcmf_disable();
760       l_disable.pcmf_getParentNode().pcmf_getSubNode("edit").pcmf_disable();
761       l_disable.pcmf_getParentNode().pcmf_getSubNode("save changes").pcmf_disable();
762
763       this.pcmf_addMessage("- error getting factory-settings of this widget", raptor_mainModel.RAPTOR_ERROR);
764     };
765   }
766
767   public void pcmf_saveFactorySettings()
768   {
769     try
770     {
771       base_environment.pcmf_setParameter(this.getPem_settings().getPem_actTplKitPar(), this.pem_inEditor.pcmf_getMyTemplate(), "swingClass", ((base_guiObj)base_registredObject.pcmf_getObjByName("inp_swingClass")).pcmf_getValue());
772       base_environment.pcmf_setParameter(this.getPem_settings().getPem_actTplKitPar(), this.pem_inEditor.pcmf_getMyTemplate(), "htmlClass", ((base_guiObj)base_registredObject.pcmf_getObjByName("inp_htmlClass")).pcmf_getValue());
773       base_environment.pcmf_setParameter(this.getPem_settings().getPem_actTplKitPar(), this.pem_inEditor.pcmf_getMyTemplate(), "htmlTemplate", ((base_guiObj)base_registredObject.pcmf_getObjByName("inp_htmlTpl")).pcmf_getValue());
774       base_environment.pcmf_setParameter(this.getPem_settings().getPem_actTplKitPar(), this.pem_inEditor.pcmf_getMyTemplate(), "htmlRenderer", ((base_guiObj)base_registredObject.pcmf_getObjByName("inp_htmlView")).pcmf_getValue());
775       
776       this.getPem_settings().getPem_writer().pcmf_writeSource(base_environment.pcmf_getParameterGetter(), this.getPem_settings().getPem_actTplKitPar(), this.getPem_settings().getPem_actTplKitPar());
777     }
778     catch (Exception JavaDoc e)
779     {
780       this.pcmf_addMessage("- error writing factory-settings of this widget", raptor_mainModel.RAPTOR_ERROR);
781     };
782   }
783
784   public void pcmf_showTemplate ()
785   {
786     base_treeNode l_root = null;
787     boolean l_edit = false;
788
789     try
790     {
791       base_guiObj l_disable = (base_guiObj)base_registredObject.pcmf_getObjByName("disableTpl");
792       if (l_disable.pcmf_getValue().equals("CHECKED"))
793       {
794         l_disable.pcmf_getParentNode().pcmf_getSubNode("pane").pcmf_getSubNode("ResTable").pcmf_disable();
795         l_disable.pcmf_getParentNode().pcmf_getSubNode("edit").pcmf_disable();
796         l_disable.pcmf_getParentNode().pcmf_getSubNode("save changes").pcmf_disable();
797
798         return;
799       }
800       else
801       {
802         l_disable.pcmf_getParentNode().pcmf_getSubNode("pane").pcmf_getSubNode("ResTable").pcmf_enable();
803         l_disable.pcmf_getParentNode().pcmf_getSubNode("edit").pcmf_enable();
804         l_disable.pcmf_getParentNode().pcmf_getSubNode("save changes").pcmf_enable();
805       }
806
807       l_root = new base_treeNode ("root", null);
808
809       if (this.pem_webAppl != null)
810         this.pem_webAppl.pcmf_getGuiObj().pcmf_releaseSubs();
811
812       this.pem_webAppl = this.pem_fact.pcmf_createAppl(gui_objFactory.HTML, this.pem_appl.pcmf_getRootUrl(), this.pem_appl.pcmf_getPort(), false);
813       ((base_webAppl)this.pem_webAppl).pcmf_setTemplateKit(new html_templateKit("environment.xml", this.getPem_settings().getPem_actTplKit(), this.pem_fact, this.getPem_settings().getPem_actTplKit()));
814
815       base_guiObj l_update = (base_guiObj)base_registredObject.pcmf_getObjByName("editTpl");
816       if (l_update.pcmf_getValue().equals("CHECKED"))
817       {
818         l_edit = true;
819         ((base_guiObj)base_registredObject.pcmf_getObjByName("saveTpl")).pcmf_enable();
820       }
821       else
822       {
823         l_edit = false;
824         ((base_guiObj)base_registredObject.pcmf_getObjByName("saveTpl")).pcmf_disable();
825       }
826
827       ByteArrayOutputStream l_stream = new ByteArrayOutputStream();
828       base_dataXmlWriter l_w = new base_dataXmlWriter (l_stream);
829
830       String JavaDoc l_mytpl = this.pem_inEditor.pcmf_getMyTemplate();
831       if (l_mytpl == null || l_mytpl.equals("application"))
832         return;
833
834       l_w.pcmf_writeModel(l_mytpl, this.pem_inEditor);
835
836       base_table_if l_table = (base_table_if)base_registredObject.pcmf_getObjByName("tpl_table");
837       gui_applProducer l_prod = new gui_applProducer(null, this.pem_fact);
838       
839       l_prod.pcmf_setTerminateOnError(false);
840       this.pem_fact.pcmf_resetPluginStatics();
841       l_prod.pcmf_produceFromStringInOwnThread(gui_objFactory.HTML, l_stream.toString(), l_root, this.pem_webAppl, "PREVIEW" + this.pem_id5.pcmf_getObjName());
842       
843       html_GuiObj l_tObj = (html_GuiObj)l_root.pcmf_getFirstSubNode();
844       html_template l_tpl = l_tObj.pcmf_getHtmlTemplateObject();
845
846       Iterator l_it = l_tpl.pcmf_getAllHtmlKeys().iterator();
847       String JavaDoc l_key = null;
848       String JavaDoc l_val = null;
849       Vector l_rows = new Vector();
850       Vector l_row = null;
851       base_textBox_if l_tb = null;
852       while (l_it.hasNext())
853       {
854         l_row = new Vector ();
855         l_key = l_it.next().toString();
856         l_val = l_tpl.pcmf_getRawString(l_key);
857         l_row.add(l_key);
858         l_tb = this.pem_appl.pcmf_getGuiObjFactory().pcmf_createTextBox(this.pem_appl.pcmf_getApplType(), "par", 80, 3, l_val, this.pem_appl);
859
860         if (l_edit)
861           l_tb.pcmf_getGuiObj().pcmf_enable();
862         else
863           l_tb.pcmf_getGuiObj().pcmf_disable();
864
865         l_row.add(l_tb);
866         l_rows.add(l_row);
867       }
868       l_table.pcmf_setRowsOnly(l_rows);
869       l_root.pcmf_releaseSubs();
870     }
871     catch (Exception JavaDoc e)
872     {
873       this.pcmf_addMessage("- error getting html-templates of this widget", raptor_mainModel.RAPTOR_ERROR);
874       l_root.pcmf_releaseSubs();
875     };
876   };
877
878   public void pcmf_createAutoWdgPreview ()
879   {
880     // Save state for undo/redo
881
this.pcmf_saveTransaction();
882     
883     // Debug
884
// do
885
// {
886
// Debug End
887

888     base_guiObj l_preview = (base_guiObj)base_registredObject.pcmf_getObjByName("AutoPreview");
889     base_layoutableContainer_if l_previewp = (base_layoutableContainer_if)base_registredObject.pcmf_getObjByName("AutoPreview_1");
890     
891     l_preview.pcmf_deleteFixedSize();
892     l_previewp.pcmf_setFill(l_preview, true, true);
893     
894     l_preview.pcmf_clearAndRelease();
895
896     pcmf_cleanupPreview();
897     pcmf_showTemplate();
898     pcmf_showFactorySettings();
899     this.pcmf_refreshSourceView();
900
901     base_guiObj l_disable = (base_guiObj)base_registredObject.pcmf_getObjByName("disableWdg");
902     if (l_disable.pcmf_getValue().equals("CHECKED"))
903     {
904       ((base_guiObj)base_registredObject.pcmf_getObjByName("AutoPreview_1")).pcmf_disable();
905       l_disable.pcmf_getParentNode().pcmf_getSubNode("lock").pcmf_disable();
906       return;
907     }
908     else
909     {
910       ((base_guiObj)base_registredObject.pcmf_getObjByName("AutoPreview_1")).pcmf_enable();
911       l_disable.pcmf_getParentNode().pcmf_getSubNode("lock").pcmf_enable();
912     }
913
914     base_guiObj l_update = (base_guiObj)base_registredObject.pcmf_getObjByName("lockWdg");
915
916     if (l_update.pcmf_getValue().equals("NOTCHECKED"))
917       this.pem_locked = this.pem_inEditor;
918
919     if (this.pem_locked == null ||this.pem_locked.pcmf_getMyTemplate().equals("page") || this.pem_locked.pcmf_getMyTemplate().equals("application"))
920     {
921       this.pcmf_addMessage("- this widget cannot be displayed in auto-preview-window, use page-preview", raptor_mainModel.RAPTOR_INFO);
922       return;
923     }
924
925     ByteArrayOutputStream l_stream = new ByteArrayOutputStream();
926     base_dataXmlWriter l_w = new base_dataXmlWriter (l_stream);
927
928
929     String JavaDoc l_tpl = this.pem_locked.pcmf_getMyTemplate();
930     if (l_tpl == null)
931       return;
932
933     l_w.pcmf_writeModel(l_tpl, this.pem_locked);
934
935     try
936     {
937       gui_applProducer l_prod = new gui_applProducer(null, this.pem_fact);
938       
939       if (this.pem_appl.pcmf_getApplType() == gui_objFactory.SWING)
940       {
941         l_prod.pcmf_setTerminateOnError(false);
942         this.pem_fact.pcmf_resetPluginStatics();
943         l_prod.pcmf_produceFromStringInOwnThread(this.pem_appl.pcmf_getApplType(), l_stream.toString(), l_preview, this.pem_appl, "PREVIEW" + this.pem_id4.pcmf_getObjName());
944       }
945       else
946       {
947         if (this.pem_webAppl != null)
948           this.pem_webAppl.pcmf_getGuiObj().pcmf_releaseSubs();;
949
950         this.pem_webAppl = this.pem_fact.pcmf_createAppl(gui_objFactory.HTML, this.pem_appl.pcmf_getRootUrl(), this.pem_appl.pcmf_getPort(), false);
951         
952         if (this.pem_appl instanceof base_webAppl)
953           ((base_webAppl)this.pem_webAppl).pcmf_setRenderer( ((base_webAppl)this.pem_appl).pcmf_getRenderer() ) ;
954
955         ((base_webAppl)this.pem_webAppl).pcmf_setTemplateKit(new html_templateKit("environment.xml", this.getPem_settings().getPem_actTplKit(), this.pem_fact, this.getPem_settings().getPem_actTplKit()));
956
957         l_prod.pcmf_produceFromString(this.pem_appl.pcmf_getApplType(), l_stream.toString(), l_preview, this.pem_webAppl);
958         this.pem_webAppl.pcmf_addPage("tmp", this.pem_fact.pcmf_createGuiPage(gui_objFactory.HTML, "tmp", true, pem_webAppl));
959       }
960     }
961     catch (Exception JavaDoc e)
962     {
963       this.pcmf_addMessage("- this widget cannot be displayed in auto-preview-window, use special-previews" , raptor_mainModel.RAPTOR_INFO);
964     }
965     ((base_guiObj)base_registredObject.pcmf_getObjByName("Aps_dlg")).pcmf_repaint();
966     ((base_guiObj)base_registredObject.pcmf_getObjByName("SplitP1")).pcmf_repaint();
967         
968     // Debug
969
// System.out.println(base_registredObject.pcmf_getRegistryStatisticString(true));
970
// Runtime.getRuntime().gc();
971
// System.out.println("============>" + Runtime.getRuntime().freeMemory());
972
// System.out.println("============>" + Runtime.getRuntime().totalMemory());
973
// System.out.println("============>" + Runtime.getRuntime().maxMemory());
974
// try
975
// {
976
// Thread.sleep(1000);
977
// }
978
// catch (Exception e)
979
// {
980
// }
981
// } while (true);
982
// Debug End
983
}
984
985   public void pcmf_createAutoWdgPreview (base_multipleModelValue_if xOld, base_multipleModelValue_if xNew)
986   {
987     pcmf_cleanupPreview();
988
989     base_guiObj l_disable = (base_guiObj)base_registredObject.pcmf_getObjByName("disableWdg");
990     if (l_disable.pcmf_getValue().equals("CHECKED"))
991     {
992       ((base_guiObj)base_registredObject.pcmf_getObjByName("AutoPreview_1")).pcmf_disable();
993       l_disable.pcmf_getParentNode().pcmf_getSubNode("lock").pcmf_disable();
994       return;
995     }
996     else
997     {
998       ((base_guiObj)base_registredObject.pcmf_getObjByName("AutoPreview_1")).pcmf_enable();
999       l_disable.pcmf_getParentNode().pcmf_getSubNode("lock").pcmf_enable();
1000    }
1001
1002    base_guiObj l_update = (base_guiObj)base_registredObject.pcmf_getObjByName("lockWdg");
1003
1004    if (l_update.pcmf_getValue().equals("NOTCHECKED"))
1005      this.pem_locked = this.pem_inEditor;
1006
1007    if (this.pem_locked == xOld)
1008      this.pem_locked = xNew;
1009
1010    if (this.pem_locked == null ||this.pem_locked.pcmf_getMyTemplate().equals("page") || this.pem_locked.pcmf_getMyTemplate().equals("application"))
1011    {
1012      this.pcmf_addMessage("- this widget cannot be displayed in auto-preview-window, use page-preview", raptor_mainModel.RAPTOR_INFO);
1013      return;
1014    }
1015
1016    ByteArrayOutputStream l_stream = new ByteArrayOutputStream();
1017    base_dataXmlWriter l_w = new base_dataXmlWriter (l_stream);
1018
1019
1020    String JavaDoc l_tpl = this.pem_locked.pcmf_getMyTemplate();
1021    if (l_tpl == null)
1022      return;
1023
1024    l_w.pcmf_writeModel(l_tpl, this.pem_locked);
1025
1026    try
1027    {
1028      base_guiObj l_preview = (base_guiObj)base_registredObject.pcmf_getObjByName("AutoPreview");
1029      base_layoutableContainer_if l_previewp = (base_layoutableContainer_if)base_registredObject.pcmf_getObjByName("AutoPreview_1");
1030      
1031      l_preview.pcmf_deleteFixedSize();
1032      l_previewp.pcmf_setFill(l_preview, true, true);
1033      
1034      gui_applProducer l_prod = new gui_applProducer(null, this.pem_fact);
1035      this.pcmf_refreshSourceView();
1036
1037      if (this.pem_appl.pcmf_getApplType() == gui_objFactory.SWING)
1038      {
1039        l_preview.pcmf_clear();
1040        l_prod.pcmf_setTerminateOnError(false);
1041        this.pem_fact.pcmf_resetPluginStatics();
1042        l_prod.pcmf_produceFromStringInOwnThread(this.pem_appl.pcmf_getApplType(), l_stream.toString(), l_preview, this.pem_appl, "PREVIEW" + this.pem_id4.pcmf_getObjName());
1043      }
1044      else
1045      {
1046        l_preview.pcmf_clearAndRelease();
1047
1048        if (this.pem_webAppl != null)
1049          this.pem_webAppl.pcmf_getGuiObj().pcmf_releaseSubs();;
1050
1051        this.pem_webAppl = this.pem_fact.pcmf_createAppl(gui_objFactory.HTML, this.pem_appl.pcmf_getRootUrl(), this.pem_appl.pcmf_getPort(), false);
1052
1053        if (this.pem_appl instanceof base_webAppl)
1054          ((base_webAppl)this.pem_webAppl).pcmf_setRenderer( ((base_webAppl)this.pem_appl).pcmf_getRenderer() ) ;
1055
1056        ((base_webAppl)this.pem_webAppl).pcmf_setTemplateKit(new html_templateKit("environment.xml", this.getPem_settings().getPem_actTplKit(), this.pem_fact, this.getPem_settings().getPem_actTplKit()));
1057
1058        l_prod.pcmf_produceFromString(this.pem_appl.pcmf_getApplType(), l_stream.toString(), l_preview, this.pem_webAppl);
1059        this.pem_webAppl.pcmf_addPage("tmp", this.pem_fact.pcmf_createGuiPage(gui_objFactory.HTML, "tmp", true, pem_webAppl));
1060      }
1061    }
1062    catch (Exception JavaDoc e)
1063    {
1064      this.pcmf_addMessage("- this widget cannot be displayed in auto-preview-window, use special-previews", raptor_mainModel.RAPTOR_INFO);
1065    }
1066    ((base_guiObj)base_registredObject.pcmf_getObjByName("Aps_dlg")).pcmf_repaint();
1067    ((base_guiObj)base_registredObject.pcmf_getObjByName("SplitP1")).pcmf_repaint();
1068
1069    return;
1070  }
1071
1072  private boolean pcmf_copyConf()
1073  {
1074    try
1075    {
1076      base_dataXmlWriter l_w = new base_dataXmlWriter (this.pem_settings.getPem_tapp_root() + "/xml_gui/" + this.pem_settings.getPem_tapp_target());
1077      base_treeView_if l_tr = (base_treeView_if)base_registredObject.pcmf_getObjByName("atree");
1078        
1079      base_modelValue_if l_sel = (base_modelValue_if)l_tr.pcmf_getValue();
1080    
1081      l_w.pcmf_writeModel(l_sel.pcmf_getMyTemplate(), l_sel);
1082    }
1083    catch (Exception JavaDoc e)
1084    {
1085      base_log.pcmf_logException("N.A.", this, e);
1086      base_log.pcmf_log("N.A.", "error saving gui configuration to test application", this, base_log.ERROR);
1087      this.pcmf_addMessage("- error saving gui configuration to test application, check settings", raptor_mainModel.RAPTOR_ERROR);
1088      return (false);
1089    }
1090    return (true);
1091  }
1092
1093  private boolean pcmf_copyAdditional()
1094  {
1095    try
1096    {
1097      String JavaDoc l_target = this.pem_settings.getPem_tapp_copy();
1098      StringTokenizer l_tok = new StringTokenizer(l_target,"=;");
1099      
1100      String JavaDoc l_tFile = null;
1101      String JavaDoc l_sFile = null;
1102    
1103      while (l_tok.hasMoreElements())
1104      {
1105        l_sFile = l_tok.nextToken();
1106        l_tFile = l_tok.nextToken();
1107        base_tools.pcmf_copyDir(base_environment.pcmf_buildPath(l_sFile), base_environment.pcmf_buildPath(this.pem_settings.getPem_tapp_root() + "/" + l_tFile));
1108      }
1109    }
1110    catch (Exception JavaDoc e)
1111    {
1112      base_log.pcmf_logException("N.A.", this, e);
1113      base_log.pcmf_log("N.A.", "error copying configuration to test application", this, base_log.ERROR);
1114      this.pcmf_addMessage("- error copying configuration to test application, check settings", raptor_mainModel.RAPTOR_ERROR);
1115      return (false);
1116    }
1117    
1118    return (true);
1119  }
1120  
1121  public void pcmf_createFullAppPreviewSwing()
1122  {
1123    // Copy gui configuration
1124
if (!this.pcmf_copyConf())
1125      return;
1126      
1127    // Copy additional configuration
1128
if (!this.pcmf_copyAdditional())
1129      return;
1130
1131    // Call swing client
1132
((base_swingServer)this.pem_appl).pcmf_execClientCommand(this.pem_settings.getPem_tapp_command());
1133  }
1134
1135  public void pcmf_createFullAppPreviewHTML()
1136  {
1137    // Copy gui configuration
1138
if (!this.pcmf_copyConf())
1139      return;
1140      
1141    // Copy additional configuration
1142
if (!this.pcmf_copyAdditional())
1143      return;
1144
1145    // Call browser
1146
String JavaDoc l_call = this.getPem_settings().getPem_iePath() + " " + this.pem_settings.getPem_tapp_url();
1147    ((base_swingServer)this.pem_appl).pcmf_execClientCommand(l_call);
1148  }
1149
1150  public void pcmf_createSwingPreview ()
1151  {
1152    // Debug
1153
// while (true)
1154
// {
1155
// Debug End
1156

1157        try
1158        {
1159      // Debug
1160
// System.out.println(base_registredObject.pcmf_getRegistryStatisticString(false));
1161
// Thread.sleep(1000);
1162
// Debug End
1163

1164      if (this.pem_treeSelection.pcmf_getMyTemplate().equals("application"))
1165      {
1166        this.pcmf_createFullAppPreviewSwing();
1167        return;
1168      }
1169
1170      pcmf_cleanupPreview();
1171
1172      if (this.pem_treeSelection.pcmf_getMyTemplate().equals("page"))
1173      {
1174            if (this.pem_preview_swing == null)
1175        {
1176          this.pem_preview_swing = this.pem_treeSelection;
1177          this.pem_swingpname = ((base_singleModelValue_if)this.pem_preview_swing.pcmf_getModelValue("name")).pcmf_getValue().toString();
1178        }
1179        else
1180            {
1181          base_treeNode l_node = (base_treeNode)this.pem_appl.pcmf_getGuiObj().pcmf_getSubNode(this.pem_swingpname);
1182          if (l_node != null)
1183          {
1184            this.pem_appl.pcmf_getGuiObj().pcmf_removeNode(this.pem_swingpname);
1185          };
1186
1187          this.pem_preview_swing = this.pem_treeSelection ;
1188          this.pem_swingpname = ((base_singleModelValue_if)this.pem_preview_swing.pcmf_getModelValue("name")).pcmf_getValue().toString();
1189            }
1190
1191        gui_applProducer l_prod = new gui_applProducer(null, this.pem_fact);
1192        this.pcmf_refreshSourceView();
1193        l_prod.pcmf_setTerminateOnError(false);
1194        this.pem_fact.pcmf_resetPluginStatics();
1195        l_prod.pcmf_produceFromStringInOwnThread(gui_objFactory.SWING, this.pem_sourceWin.pcmf_getValue(), this.pem_appl.pcmf_getGuiObj(), this.pem_appl, "PREVIEW" + this.pem_id2.pcmf_getObjName() );
1196      }
1197      else
1198        this.pcmf_createSwingWdgPreview();
1199    }
1200    catch (Exception JavaDoc e)
1201    {
1202      this.pcmf_addMessage("- please select a page or a widget to preview", raptor_mainModel.RAPTOR_MESSAGE);
1203      base_log.pcmf_logException(this.pem_appl.pcmf_getGuiObj().toString(), this, e);
1204    }
1205    
1206    // Debug
1207
// }
1208
// Debug End
1209
}
1210
1211  // tobe recoded!
1212
public void pcmf_createHtmlPreview (boolean xSource)
1213  {
1214    try
1215    {
1216      if (this.pem_treeSelection.pcmf_getMyTemplate().equals("page"))
1217      {
1218        pcmf_cleanupPreview();
1219
1220        if (this.pem_preview_html == null)
1221        {
1222          this.pem_preview_html = this.pem_treeSelection;
1223          this.pem_htmlpname = "html-" + ((base_singleModelValue_if)this.pem_preview_html.pcmf_getModelValue("name")).pcmf_getValue().toString();
1224        }
1225        else
1226        {
1227          if (this.pem_appl.pcmf_getGuiObj().pcmf_getSubNode(this.pem_htmlpname) != null)
1228          {
1229            base_treeNode l_node = this.pem_appl.pcmf_getGuiObj().pcmf_removeNode(this.pem_htmlpname);
1230            if (l_node != null)
1231              l_node.pcmf_releaseSubs();
1232          }
1233
1234          this.pem_preview_html = this.pem_treeSelection ;
1235          this.pem_htmlpname = "html-" + ((base_singleModelValue_if)this.pem_preview_html.pcmf_getModelValue("name")).pcmf_getValue().toString();
1236        }
1237
1238        if (this.pem_webAppl != null)
1239          this.pem_webAppl.pcmf_getGuiObj().pcmf_releaseSubs();
1240
1241        this.pem_webAppl = this.pem_fact.pcmf_createAppl(gui_objFactory.HTML, this.pem_appl.pcmf_getRootUrl(), this.pem_appl.pcmf_getPort(), false);
1242        
1243        ((base_webAppl)this.pem_webAppl).pcmf_setTemplateKit(new html_templateKit("environment.xml", this.getPem_settings().getPem_actTplKit(), this.pem_fact, this.getPem_settings().getPem_actTplKit()));
1244        
1245        if (this.pem_appl instanceof base_webAppl)
1246          ((base_webAppl)this.pem_webAppl).pcmf_setRenderer( ((base_webAppl)this.pem_appl).pcmf_getRenderer() ) ;
1247        else
1248          ((base_webAppl)this.pem_webAppl).pcmf_setRenderer();
1249
1250        gui_applProducer l_prod = new gui_applProducer(null, this.pem_fact);
1251        this.pcmf_refreshSourceView();
1252        l_prod.pcmf_setTerminateOnError(false);
1253        this.pem_fact.pcmf_resetPluginStatics();
1254        l_prod.pcmf_produceFromStringInOwnThread(gui_objFactory.HTML, this.pem_sourceWin.pcmf_getValue(), this.pem_webAppl.pcmf_getGuiObj(), this.pem_webAppl, "PREVIEW" + this.pem_id3.pcmf_getObjName());
1255
1256        base_guiPage_if l_page = this.pem_fact.pcmf_createGuiPage(gui_objFactory.SWING, this.pem_htmlpname, false, this.pem_appl);
1257        l_page.pcmf_getGuiObj().pcmf_enableSubmit();
1258
1259        base_textBox_if l_editor = null;
1260        if (xSource)
1261          l_editor= this.pem_appl.pcmf_getGuiObjFactory().pcmf_createEditor(gui_objFactory.SWING, "html", this.pem_webAppl.pcmf_execView().toString(), "text/plain", this.pem_appl);
1262        else
1263        {
1264          this.pcmf_callExternalViewer(this.pem_webAppl.pcmf_execView().toString());
1265          return;
1266        }
1267        l_page.pcmf_getGuiObj().pcmf_addNode("html", (base_treeNode)l_editor);
1268        ((base_panel_if)l_page).pcmf_setScroll(false);
1269        l_page.pcmf_setPosition("html", 0, 0, 1, 1, -1);
1270
1271        pem_appl.pcmf_addPage(pem_htmlpname, l_page);
1272      }
1273      else
1274      if (this.pem_treeSelection.pcmf_getMyTemplate().equals("application"))
1275      {
1276        this.pcmf_createFullAppPreviewHTML();
1277      }
1278      else
1279        this.pcmf_addMessage("- please select a page to preview", raptor_mainModel.RAPTOR_MESSAGE);
1280    }
1281    catch (Exception JavaDoc e)
1282    {
1283      this.pcmf_addMessage("- please select a page to preview", raptor_mainModel.RAPTOR_MESSAGE);
1284      base_log.pcmf_logException(this.pem_appl.pcmf_getGuiObj().toString(), this, e);
1285    }
1286    return;
1287  }
1288
1289  public void pcmf_callExternalViewer (String JavaDoc xHtml)
1290  {
1291    try
1292    {
1293      BufferedOutputStream oStream = (new BufferedOutputStream(new FileOutputStream(this.getPem_settings().getPem_tmpPath() + "\\testhtml.html")));
1294      oStream.write(xHtml.getBytes());
1295      oStream.flush();
1296
1297      String JavaDoc l_call = this.getPem_settings().getPem_iePath() + " \"" + this.getPem_settings().getPem_tmpPath() + "\\testhtml.html" + "\"";
1298      base_log.pcmf_log("raptor", "calling external viewer: " + l_call, this, base_log.MESSAGE);
1299      Runtime.getRuntime().exec(l_call);
1300    }
1301    catch (Exception JavaDoc e)
1302    {
1303      base_log.pcmf_log("raptor","error calling external viewer", this, base_log.ERROR);
1304    }
1305  }
1306
1307  public base_menu_if pcmf_getCtxMenu ()
1308  {
1309    return (this.pem_ctxMenu);
1310  }
1311    /**
1312         * <p>
1313         * Does...
1314         * </p><p>
1315         *
1316         * @return a Type with
1317         * </p><p>
1318         * @param
1319         * </p>
1320         */

1321    public raptor_settings getPem_settings()
1322    {
1323        return pem_settings;
1324    }
1325
1326  public void pcmf_setMenues(Object JavaDoc xSelect, String JavaDoc xMenu)
1327  {
1328    base_menu_if l_ctx = this.pcmf_getCtxMenu();
1329    Iterator l_it = ((base_treeNode)l_ctx.pcmf_getGuiObj().pcmf_getSubNode(xMenu)).pcmf_getSubIterator();
1330    String JavaDoc l_mname = null;
1331    base_treeNode l_menui = null;
1332    int i_cnt = 0;
1333    while (l_it.hasNext())
1334    {
1335      l_menui = (base_treeNode)l_it.next();
1336      l_mname = l_menui.pcmf_getValue().toString();
1337      if (xSelect instanceof base_multipleModelValue_if)
1338      {
1339        if(((base_multipleModelValue_if)((base_multipleModelValue_if)xSelect).pcmf_getMyTemplateObj()) != null && ((base_multipleModelValue_if)((base_multipleModelValue_if)xSelect).pcmf_getMyTemplateObj()).pcmf_getModelValue(l_mname) instanceof base_multipleModelValue_if)
1340        {
1341          l_menui.pcmf_enableThis();
1342          i_cnt ++;
1343        }
1344        else
1345          l_menui.pcmf_disableThis();
1346      }
1347      else
1348        l_menui.pcmf_disableThis();
1349    };
1350    if (i_cnt == 0)
1351      ((base_treeNode)l_ctx.pcmf_getGuiObj().pcmf_getSubNode(xMenu)).pcmf_disableThis();
1352    else
1353      ((base_treeNode)l_ctx.pcmf_getGuiObj().pcmf_getSubNode(xMenu)).pcmf_enableThis();
1354
1355    l_ctx.pcmf_commitMenu();
1356  }
1357
1358    public void setPem_fact(gui_objFactory factory)
1359    {
1360    try
1361    {
1362      if (this.pem_fact != null)
1363        this.pem_fact.pcmf_delete();
1364    }
1365    catch (Exception JavaDoc e)
1366    {
1367      base_log.pcmf_logException(this.pem_appl.pcmf_getGuiObj().toString(), this, e);
1368    };
1369      
1370        pem_fact = factory;
1371    }
1372  
1373  public void pcmf_saveTransaction()
1374  {
1375    if (this.pem_undoredo == false)
1376      return;
1377       
1378    if (this.pem_maxtrCount < 1)
1379      ((base_link_if)base_registredObject.pcmf_getObjByName("undo_but")).pcmf_getGuiObj().pcmf_disable();
1380    else
1381      ((base_link_if)base_registredObject.pcmf_getObjByName("undo_but")).pcmf_getGuiObj().pcmf_enable();
1382
1383    ((base_link_if)base_registredObject.pcmf_getObjByName("redo_but")).pcmf_getGuiObj().pcmf_disable();
1384
1385    this.pem_maxtrCount = this.pem_trCount;
1386
1387    this.pem_maxtrCount++;
1388    this.pem_trCount++;
1389
1390    try
1391    {
1392      base_dataXmlWriter l_w = new base_dataXmlWriter (this.pem_settings.getPem_tmpPath() + "/raptor_redoSave" + this.pem_id1.pcmf_getObjLongName() + Integer.toString(pem_maxtrCount) + ".bak");
1393      base_treeView_if l_tr = (base_treeView_if)base_registredObject.pcmf_getObjByName("atree");
1394        
1395      base_modelValue_if l_sel = (base_modelValue_if)l_tr.pcmf_getRoot();
1396    
1397      l_w.pcmf_writeModel(l_sel.pcmf_getMyTemplate(), l_sel);
1398    }
1399    catch (Exception JavaDoc e)
1400    {
1401      base_log.pcmf_log("N.A.", "error saving transaction to undo file function has been disabled", this, base_log.ERROR);
1402      this.pcmf_addMessage("- error saving transaction, disable function", raptor_mainModel.RAPTOR_ERROR);
1403
1404      ((base_link_if)base_registredObject.pcmf_getObjByName("undo_but")).pcmf_getGuiObj().pcmf_disable();
1405      ((base_link_if)base_registredObject.pcmf_getObjByName("redo_but")).pcmf_getGuiObj().pcmf_disable();
1406      this.pem_undoredo = false;
1407    }
1408  }
1409  
1410  public void pcmf_undo()
1411  {
1412    pcmf_cleanupPreview();
1413
1414    ((base_treeNode)this.pem_root).pcmf_clearAndRelease();
1415    
1416    try
1417    {
1418      this.pem_appl.pcmf_beginSessionTR();
1419      
1420      base_tpl2dataXmlReader l_r = new base_tpl2dataXmlReader (this.pem_settings.getPem_tmpPath() + "/raptor_redoSave" + this.pem_id1.pcmf_getObjLongName() + Integer.toString(--pem_trCount) + ".bak", false, true);
1421      l_r.pcmf_read(this.pem_appl.pcmf_getGuiObj().pcmf_getModelTpl(), this.pem_root);
1422    }
1423    catch (Exception JavaDoc e)
1424    {
1425      base_log.pcmf_log("N.A.", "error undoing transaction", this, base_log.ERROR);
1426      this.pcmf_addMessage("- error undoing transaction", raptor_mainModel.RAPTOR_ERROR);
1427    }
1428    finally
1429    {
1430      this.pem_appl.pcmf_commitSessionTR();
1431    }
1432    
1433    if (this.pem_trCount == 1)
1434      ((base_link_if)base_registredObject.pcmf_getObjByName("undo_but")).pcmf_getGuiObj().pcmf_disable();
1435    else
1436      ((base_link_if)base_registredObject.pcmf_getObjByName("undo_but")).pcmf_getGuiObj().pcmf_enable();
1437
1438    ((base_link_if)base_registredObject.pcmf_getObjByName("redo_but")).pcmf_getGuiObj().pcmf_enable();
1439
1440    ((base_treeNode)this.pem_root).pcmf_hideLevel(1);
1441    
1442    this.pem_locked = null;
1443    this.pcmf_clearEditWin();
1444    
1445    this.pem_appTree.pcmf_setValue(this.pem_root);
1446                
1447    pem_appTree.pcmf_repaint();
1448  }
1449
1450  public void pcmf_redo ()
1451  {
1452    pcmf_cleanupPreview();
1453
1454    ((base_treeNode)this.pem_root).pcmf_clearAndRelease();
1455    
1456    ++this.pem_trCount;
1457    
1458    try
1459    {
1460      this.pem_appl.pcmf_beginSessionTR();
1461      
1462      base_tpl2dataXmlReader l_r = new base_tpl2dataXmlReader (this.pem_settings.getPem_tmpPath() + "/raptor_redoSave" + this.pem_id1.pcmf_getObjLongName() + Integer.toString(pem_trCount) + ".bak", false, true);
1463      l_r.pcmf_read(this.pem_appl.pcmf_getGuiObj().pcmf_getModelTpl(), this.pem_root);
1464    }
1465    catch (Exception JavaDoc e)
1466    {
1467      base_log.pcmf_log("N.A.", "error redoing transaction", this, base_log.ERROR);
1468      this.pcmf_addMessage("- error redoing transaction", raptor_mainModel.RAPTOR_ERROR);
1469    }
1470    finally
1471    {
1472      this.pem_appl.pcmf_commitSessionTR();
1473    }
1474      
1475    if (this.pem_trCount == this.pem_maxtrCount)
1476      ((base_link_if)base_registredObject.pcmf_getObjByName("redo_but")).pcmf_getGuiObj().pcmf_disable();
1477    else
1478      ((base_link_if)base_registredObject.pcmf_getObjByName("redo_but")).pcmf_getGuiObj().pcmf_enable();
1479
1480    ((base_link_if)base_registredObject.pcmf_getObjByName("undo_but")).pcmf_getGuiObj().pcmf_enable();
1481    
1482    ((base_treeNode)this.pem_root).pcmf_hideLevel(1);
1483
1484    this.pem_locked = null;
1485    this.pcmf_clearEditWin();
1486
1487    this.pem_appTree.pcmf_setValue(this.pem_root);
1488    
1489    pem_appTree.pcmf_repaint();
1490  }
1491  
1492    public base_modelValue_if getPem_root()
1493    {
1494        return pem_root;
1495    }
1496
1497    public void setPem_root(base_modelValue_if value_if)
1498    {
1499        pem_root = value_if;
1500    }
1501  
1502  public void pcmf_clearEditWin()
1503  {
1504    base_guiObj l_actObj = null;
1505    Iterator l_it = this.getPem_editWin().pcmf_getSubIterator();
1506    Object JavaDoc l_test = null;
1507    while (l_it.hasNext())
1508    {
1509      l_test = l_it.next();
1510      if (l_test instanceof base_eventChannel_if == false)
1511      {
1512        l_actObj = (base_guiObj)l_test;
1513        break;
1514      }
1515    }
1516    String JavaDoc act = null;
1517    if (l_actObj != null)
1518    {
1519      act = l_actObj.pcmf_getName();
1520      this.getPem_editWin().pcmf_removeNode(act);
1521    };
1522    this.pem_inEditor = null;
1523  };
1524
1525    public base_treeNode getPem_treeNodeSelection()
1526    {
1527        return pem_treeNodeSelection;
1528    }
1529
1530    public void setPem_treeNodeSelection(base_treeNode value_if)
1531    {
1532        pem_treeNodeSelection = value_if;
1533    }
1534
1535    // Repositioning of mainFrame
1536

1537    private boolean pem_doRestore = true;
1538  
1539    private int pem_mainFrameWi = 1024;
1540  private int pem_mainFrameHi = 768;
1541
1542  private int pem_builderHi = 590;
1543  private int pem_builderWi = 1018;
1544  private int pem_builderX = 0;
1545  private int pem_builderY = 0;
1546  private String JavaDoc pem_builderState = base_guiPage_if.PAGE_OPENED;
1547  private int pem_builderZ = 0;
1548
1549  private int pem_sourceHi = 590;
1550  private int pem_sourceWi = 1018;
1551  private int pem_sourceX = 0;
1552  private int pem_sourceY = 0;
1553  private String JavaDoc pem_sourceState = base_guiPage_if.PAGE_OPENED;
1554  private int pem_sourceZ = 0;
1555
1556  private int pem_messageHi = 590;
1557  private int pem_messageWi = 1018;
1558  private int pem_messageX = 0;
1559  private int pem_messageY = 0;
1560  private String JavaDoc pem_messageState = base_guiPage_if.PAGE_OPENED;
1561  private int pem_messageZ = 0;
1562
1563  public void pcmf_writeDesktopSettings()
1564  {
1565    try
1566    {
1567        if (this.pem_settings.isPem_doRestore() == false)
1568            return;
1569        
1570        this.pem_builderZ = this.pem_appl.pcmf_getGuiObj().pcmf_indexOf(this.pem_appl.pcmf_getGuiObj().pcmf_getSubNode("WiSer-Builder"));
1571        this.pem_messageZ = this.pem_appl.pcmf_getGuiObj().pcmf_indexOf(this.pem_appl.pcmf_getGuiObj().pcmf_getSubNode("Message"));
1572        this.pem_sourceZ = this.pem_appl.pcmf_getGuiObj().pcmf_indexOf(this.pem_appl.pcmf_getGuiObj().pcmf_getSubNode("Source"));
1573
1574        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "MAIN_FRAME_HEIGHT", Integer.toString(this.pem_mainFrameHi));
1575        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "MAIN_FRAME_WIDTH", Integer.toString(this.pem_mainFrameWi));
1576
1577        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "BUILDER_HEIGHT", Integer.toString(this.pem_builderHi));
1578        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "BUILDER_WIDTH", Integer.toString(this.pem_builderWi));
1579        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "BUILDER_X", Integer.toString(this.pem_builderX));
1580        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "BUILDER_Y", Integer.toString(this.pem_builderY));
1581        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "BUILDER_Z", Integer.toString(this.pem_builderZ));
1582        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "BUILDER_STATE", this.pem_builderState);
1583
1584        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "SOURCE_HEIGHT", Integer.toString(this.pem_sourceHi));
1585        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "SOURCE_WIDTH", Integer.toString(this.pem_sourceWi));
1586        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "SOURCE_X", Integer.toString(this.pem_sourceX));
1587        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "SOURCE_Y", Integer.toString(this.pem_sourceY));
1588        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "SOURCE_Z", Integer.toString(this.pem_sourceZ));
1589        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "SOURCE_STATE", this.pem_sourceState);
1590
1591        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "MESSAGE_HEIGHT", Integer.toString(this.pem_messageHi));
1592        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "MESSAGE_WIDTH", Integer.toString(this.pem_messageWi));
1593        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "MESSAGE_X", Integer.toString(this.pem_messageX));
1594        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "MESSAGE_Y", Integer.toString(this.pem_messageY));
1595        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "MESSAGE_Z", Integer.toString(this.pem_messageZ));
1596        base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "MESSAGE_STATE", this.pem_messageState);
1597
1598        xml_parameterWriter l_writer = new xml_parameterWriter();
1599                
1600        l_writer.pcmf_writeSource(base_environment.pcmf_getParameterGetter(), "environment.xml", "environment.xml");
1601    }
1602    catch (Exception JavaDoc e)
1603    {
1604        
1605    }
1606  }
1607
1608  public void pcmf_loadDesktopSettings()
1609  {
1610    try
1611    {
1612        this.pem_doRestore = base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "RESTORE").toString().equals("true")?true:false;
1613
1614        this.pem_mainFrameHi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "MAIN_FRAME_HEIGHT").toString());
1615        this.pem_mainFrameWi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "MAIN_FRAME_WIDTH").toString());
1616
1617        this.pem_builderHi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "BUILDER_HEIGHT").toString());
1618        this.pem_builderWi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "BUILDER_WIDTH").toString());
1619        this.pem_builderX = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "BUILDER_X").toString());
1620        this.pem_builderY = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "BUILDER_Y").toString());
1621        this.pem_builderZ = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "BUILDER_Z").toString());
1622        this.pem_builderState = base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "BUILDER_STATE").toString();
1623
1624        this.pem_sourceHi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "SOURCE_HEIGHT").toString());
1625        this.pem_sourceWi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "SOURCE_WIDTH").toString());
1626        this.pem_sourceX = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "SOURCE_X").toString());
1627        this.pem_sourceY = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "SOURCE_Y").toString());
1628        this.pem_sourceZ = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "SOURCE_Z").toString());
1629        this.pem_sourceState = base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "SOURCE_STATE").toString();
1630
1631        this.pem_messageHi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "MESSAGE_HEIGHT").toString());
1632        this.pem_messageWi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "MESSAGE_WIDTH").toString());
1633        this.pem_messageX = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "MESSAGE_X").toString());
1634        this.pem_messageY = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "MESSAGE_Y").toString());
1635        this.pem_messageZ = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "MESSAGE_Z").toString());
1636        this.pem_messageState = base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "MESSAGE_STATE").toString();
1637    }
1638    catch (Exception JavaDoc e)
1639    {
1640
1641    }
1642  }
1643
1644  public void pcmf_loadDesktopDefaultSettings()
1645  {
1646    try
1647    {
1648        this.pem_mainFrameHi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_MAIN_FRAME_HEIGHT").toString());
1649        this.pem_mainFrameWi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_MAIN_FRAME_WIDTH").toString());
1650
1651        this.pem_builderHi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_BUILDER_HEIGHT").toString());
1652        this.pem_builderWi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_BUILDER_WIDTH").toString());
1653        this.pem_builderX = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_BUILDER_X").toString());
1654        this.pem_builderY = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_BUILDER_Y").toString());
1655        this.pem_builderZ = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_BUILDER_Z").toString());
1656        this.pem_builderState = base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_BUILDER_STATE").toString();
1657
1658        this.pem_sourceHi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_SOURCE_HEIGHT").toString());
1659        this.pem_sourceWi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_SOURCE_WIDTH").toString());
1660        this.pem_sourceX = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_SOURCE_X").toString());
1661        this.pem_sourceY = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_SOURCE_Y").toString());
1662        this.pem_sourceZ = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_SOURCE_Z").toString());
1663        this.pem_sourceState = base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_SOURCE_STATE").toString();
1664
1665        this.pem_messageHi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_MESSAGE_HEIGHT").toString());
1666        this.pem_messageWi = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_MESSAGE_WIDTH").toString());
1667        this.pem_messageX = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_MESSAGE_X").toString());
1668        this.pem_messageY = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_MESSAGE_Y").toString());
1669        this.pem_messageZ = Integer.parseInt(base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_MESSAGE_Z").toString());
1670        this.pem_messageState = base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "DEF_MESSAGE_STATE").toString();
1671    }
1672    catch (Exception JavaDoc e)
1673    {
1674
1675    }
1676  }
1677
1678  public void pcmf_restoreDesktop()
1679  {
1680        this.pem_appl.pcmf_setApplWinSize(0, 0);
1681        
1682    base_treeNode l_builder = this.pem_appl.pcmf_removeWidget("WiSer-Builder");
1683    base_treeNode l_source = this.pem_appl.pcmf_removeWidget("Source");
1684    base_treeNode l_message = this.pem_appl.pcmf_removeWidget("Message");
1685
1686        this.pem_appl.pcmf_show();
1687
1688        for (int i = 0; i < 30; i++)
1689        {
1690            if (this.pem_builderZ == i && this.pem_builderState.equals(base_guiPage_if.PAGE_CLOSED) == false)
1691            {
1692                if (l_builder == null)
1693                    l_builder = (base_treeNode) base_registredObject.pcmf_getObjByName("builder");
1694                
1695                this.pem_appl.pcmf_getGuiObj().pcmf_addNode("WiSer-Builder", l_builder);
1696                this.pem_appl.pcmf_setActive("WiSer-Builder");
1697            }
1698            else
1699            if (this.pem_sourceZ == i && this.pem_sourceState.equals(base_guiPage_if.PAGE_CLOSED) == false)
1700            {
1701                if (l_source == null)
1702                    l_source = (base_treeNode) base_registredObject.pcmf_getObjByName("sourcewin");
1703
1704                this.pem_appl.pcmf_getGuiObj().pcmf_addNode("Source", l_source);
1705                this.pem_appl.pcmf_setActive("Source");
1706            }
1707            else
1708            if (this.pem_messageZ == i && this.pem_messageState.equals(base_guiPage_if.PAGE_CLOSED) == false)
1709            {
1710                if (l_message == null)
1711                    l_message = (base_treeNode) base_registredObject.pcmf_getObjByName("messagewin");
1712
1713                this.pem_appl.pcmf_getGuiObj().pcmf_addNode("Message", l_message);
1714                this.pem_appl.pcmf_setActive("Message");
1715            }
1716        }
1717        
1718        this.pem_appl.pcmf_setGuiObjPosition("WiSer-Builder", this.pem_builderX, this.pem_builderY, this.pem_builderWi, this.pem_builderHi, "WEST");
1719        this.pem_appl.pcmf_setGuiObjPosition("Source", this.pem_sourceX, this.pem_sourceY, this.pem_sourceWi, this.pem_sourceHi, "WEST");
1720        this.pem_appl.pcmf_setGuiObjPosition("Message", this.pem_messageX, this.pem_messageY, this.pem_messageWi, this.pem_messageHi, "WEST");
1721
1722        this.pem_appl.pcmf_setApplWinSize(pem_mainFrameWi, pem_mainFrameHi);
1723        this.pem_appl.pcmf_getGuiObj().pcmf_repaint();
1724        this.pcmf_writeDesktopSettings();
1725  }
1726  
1727    public void setPem_mainFrameHi(int pem_mainFrameHi)
1728    {
1729        this.pem_mainFrameHi = pem_mainFrameHi;
1730    }
1731
1732    public void setPem_mainFrameWi(int pem_mainFrameWi)
1733    {
1734        this.pem_mainFrameWi = pem_mainFrameWi;
1735    }
1736
1737    public void setPem_builderHi(int pem_builderHi)
1738    {
1739        this.pem_builderHi = pem_builderHi;
1740    }
1741
1742    public void setPem_builderWi(int pem_builderWi)
1743    {
1744        this.pem_builderWi = pem_builderWi;
1745    }
1746
1747    public void setPem_builderX(int pem_builderX)
1748    {
1749        this.pem_builderX = pem_builderX;
1750    }
1751
1752    public void setPem_builderY(int pem_builderY)
1753    {
1754        this.pem_builderY = pem_builderY;
1755    }
1756
1757    public void setPem_builderState(String JavaDoc pem_builderState)
1758    {
1759        this.pem_builderState = pem_builderState;
1760    }
1761
1762    public void setPem_builderZ(int pem_builderZ)
1763    {
1764        this.pem_builderZ = pem_builderZ;
1765    }
1766    
1767//==
1768

1769    public void setPem_sourceHi(int pem_sourceHi)
1770    {
1771        this.pem_sourceHi = pem_sourceHi;
1772    }
1773
1774    public void setPem_sourceWi(int pem_sourceWi)
1775    {
1776        this.pem_sourceWi = pem_sourceWi;
1777    }
1778
1779    public void setPem_sourceX(int pem_sourceX)
1780    {
1781        this.pem_sourceX = pem_sourceX;
1782    }
1783
1784    public void setPem_sourceY(int pem_sourceY)
1785    {
1786        this.pem_sourceY = pem_sourceY;
1787    }
1788
1789    public void setPem_sourceState(String JavaDoc pem_sourceState)
1790    {
1791        this.pem_sourceState = pem_sourceState;
1792    }
1793
1794    public void setPem_sourceZ(int pem_sourceZ)
1795    {
1796        this.pem_sourceZ = pem_sourceZ;
1797    }
1798    
1799    //==
1800

1801    public void setPem_messageHi(int pem_messageHi)
1802    {
1803        this.pem_messageHi = pem_messageHi;
1804    }
1805
1806    public void setPem_messageWi(int pem_messageWi)
1807    {
1808        this.pem_messageWi = pem_messageWi;
1809    }
1810
1811    public void setPem_messageX(int pem_messageX)
1812    {
1813        this.pem_messageX = pem_messageX;
1814    }
1815
1816    public void setPem_messageY(int pem_messageY)
1817    {
1818        this.pem_messageY = pem_messageY;
1819    }
1820
1821    public void setPem_messageState(String JavaDoc pem_messageState)
1822    {
1823        this.pem_messageState = pem_messageState;
1824    }
1825
1826    public void setPem_messageZ(int pem_messageZ)
1827    {
1828        this.pem_messageZ = pem_messageZ;
1829    }
1830}
Popular Tags