KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectstyle > cayenne > dataview > dvmodeler > DVModelerFrameHelper


1 /* ====================================================================
2  *
3  * The ObjectStyle Group Software License, version 1.1
4  * ObjectStyle Group - http://objectstyle.org/
5  *
6  * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
7  * of the software. All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * 1. Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  *
16  * 2. Redistributions in binary form must reproduce the above copyright
17  * notice, this list of conditions and the following disclaimer in
18  * the documentation and/or other materials provided with the
19  * distribution.
20  *
21  * 3. The end-user documentation included with the redistribution, if any,
22  * must include the following acknowlegement:
23  * "This product includes software developed by independent contributors
24  * and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
25  * Alternately, this acknowlegement may appear in the software itself,
26  * if and wherever such third-party acknowlegements normally appear.
27  *
28  * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
29  * or promote products derived from this software without prior written
30  * permission. For written permission, email
31  * "andrus at objectstyle dot org".
32  *
33  * 5. Products derived from this software may not be called "ObjectStyle"
34  * or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
35  * names without prior written permission.
36  *
37  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
38  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
39  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40  * DISCLAIMED. IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
41  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
43  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
44  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
45  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
47  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48  * SUCH DAMAGE.
49  * ====================================================================
50  *
51  * This software consists of voluntary contributions made by many
52  * individuals and hosted on ObjectStyle Group web site. For more
53  * information on the ObjectStyle Group, please see
54  * <http://objectstyle.org/>.
55  */

56
57 package org.objectstyle.cayenne.dataview.dvmodeler;
58
59 import java.awt.CardLayout JavaDoc;
60 import java.awt.event.ActionEvent JavaDoc;
61 import java.awt.event.ActionListener JavaDoc;
62 import java.awt.event.WindowAdapter JavaDoc;
63 import java.awt.event.WindowEvent JavaDoc;
64 import java.awt.event.WindowListener JavaDoc;
65 import java.beans.PropertyChangeEvent JavaDoc;
66 import java.beans.PropertyChangeListener JavaDoc;
67 import java.io.File JavaDoc;
68 import java.io.IOException JavaDoc;
69 import java.util.ArrayList JavaDoc;
70 import java.util.Iterator JavaDoc;
71 import java.util.Map JavaDoc;
72
73 import javax.swing.AbstractAction JavaDoc;
74 import javax.swing.Action JavaDoc;
75 import javax.swing.ImageIcon JavaDoc;
76 import javax.swing.JFileChooser JavaDoc;
77 import javax.swing.JOptionPane JavaDoc;
78 import javax.swing.JPanel JavaDoc;
79 import javax.swing.JTabbedPane JavaDoc;
80 import javax.swing.JTable JavaDoc;
81 import javax.swing.JTree JavaDoc;
82 import javax.swing.KeyStroke JavaDoc;
83 import javax.swing.event.ChangeEvent JavaDoc;
84 import javax.swing.event.ChangeListener JavaDoc;
85 import javax.swing.event.TreeSelectionEvent JavaDoc;
86 import javax.swing.event.TreeSelectionListener JavaDoc;
87 import javax.swing.tree.TreePath JavaDoc;
88
89
90
91 /**
92  * This class is helper for DVModelerFrame class.
93  *
94  * @author Nataliya Kholodna
95  * @version 1.0
96  */

97
98
99 class DVModelerFrameHelper {
100   private DVModelerFrame dvModelerFrame;
101   private CayenneProject cayenneProject;
102
103   /*This is actions for menu items from dvModelerFrame*/
104   private Action JavaDoc saveAction = new SaveAction();
105   private Action JavaDoc openAction = new OpenAction();
106   private Action JavaDoc addNewObjEntityViewAction = new AddNewObjEntityViewAction();
107   private Action JavaDoc addNewFieldAction = new AddNewFieldAction();
108   private Action JavaDoc addNewDataViewAction = new AddNewDataViewAction();
109   private Action JavaDoc deleteAction = new DeleteAction();
110
111   private JFileChooser JavaDoc openProjectFileChooser = new JFileChooser JavaDoc();
112
113   private PropertyChangeMediator propertyChangeMediator =
114       new PropertyChangeMediator();
115
116   private ErrorsDialog loadErrorsDialog;
117   private ErrorsDialog saveErrorsDialog;
118
119   public DVModelerFrameHelper(DVModelerFrame dvModelerFrame) {
120     this.dvModelerFrame = dvModelerFrame;
121     configureFileChoosers();
122   }
123
124   public Action JavaDoc getSaveAction(){
125     return saveAction;
126   }
127
128   public Action JavaDoc getOpenAction(){
129     return openAction;
130   }
131
132   public Action JavaDoc getAddNewObjEntityViewAction(){
133     return addNewObjEntityViewAction;
134   }
135
136   public Action JavaDoc getAddNewFieldAction(){
137     return addNewFieldAction;
138   }
139
140   public Action JavaDoc getAddNewDataViewAction(){
141     return addNewDataViewAction;
142   }
143   public Action JavaDoc getDeleteAction(){
144     return deleteAction;
145   }
146
147
148   public WindowListener JavaDoc getDVModelerFrameWindowListener(){
149     return new WindowAdapter JavaDoc() {
150       public void windowClosing(WindowEvent JavaDoc e) {
151         exitAction(e);
152       }
153     };
154   }
155
156   public ActionListener JavaDoc getMenuItemExitActionListener(){
157     return new ActionListener JavaDoc(){
158       public void actionPerformed(ActionEvent JavaDoc e) {
159         exitAction(null);
160       }
161     };
162   }
163
164   private void exitAction(WindowEvent JavaDoc e){
165     if (cayenneProject != null){
166       int returnVal = JOptionPane.showConfirmDialog(
167           dvModelerFrame,
168           "Save current project before exit?",
169           "DVModeler :: Exit Confirmation",
170           JOptionPane.YES_NO_CANCEL_OPTION,
171           JOptionPane.QUESTION_MESSAGE);
172       if (returnVal == JOptionPane.YES_OPTION){
173         int selectedValue = saveCayenneProjectFileAction(null, SaveErrorsDialog.EXIT_DIALOG);
174         if ((selectedValue == -1)||(selectedValue == SaveErrorsDialog.EXIT_WITHOUT_SAVING)){
175           System.exit(0);
176         }
177       } else if (returnVal == JOptionPane.NO_OPTION){
178         System.exit(0);
179       }
180     } else {
181       System.exit(0);
182     }
183   }
184
185   public ActionListener JavaDoc getMenuItemCloseActionListener(){
186     return new ActionListener JavaDoc(){
187       public void actionPerformed(ActionEvent JavaDoc e){
188         closeAction(e);
189       }
190     };
191   }
192
193   private void closeAction(ActionEvent JavaDoc e){
194     if (cayenneProject != null){
195       int returnVal = JOptionPane.showConfirmDialog(
196           dvModelerFrame,
197           "Save current project before closing?",
198           "DVModeler :: Close Confirmation",
199           JOptionPane.YES_NO_CANCEL_OPTION,
200           JOptionPane.QUESTION_MESSAGE);
201       if (returnVal == JOptionPane.YES_OPTION){
202         int selectedValue = saveCayenneProjectFileAction(null, SaveErrorsDialog.CLOSE_DIALOG);
203         if ((selectedValue == -1)
204            || (selectedValue == SaveErrorsDialog.CLOSE_WITHOUT_SAVING)){
205           closeCayenneProject();
206         }
207
208       } else if (returnVal == JOptionPane.NO_OPTION){
209         closeCayenneProject();
210       }
211     }
212   }
213
214   private void closeCayenneProject(){
215     JTree JavaDoc dataMapTree = dvModelerFrame.getDataMapTree();
216     JTree JavaDoc dataViewTree = dvModelerFrame.getDataViewTree();
217     cayenneProject = null;
218     DataMapTreeModel dataMapTreeModel =
219       (DataMapTreeModel)dataMapTree.getModel();
220     dataMapTreeModel.setDataMaps(null);
221
222     DataViewTreeModel dataViewTreeModel =
223       (DataViewTreeModel)dataViewTree.getModel();
224     dataViewTreeModel.setDataViews(null);
225
226     dvModelerFrame.getTopCardPanel().showPanel(null);
227     showBottomEmptyPanel();
228
229     addNewDataViewAction.setEnabled(false);
230     saveAction.setEnabled(false);
231     dvModelerFrame.getMenuItemClose().setEnabled(false);
232     dvModelerFrame.getMenuItemLoadErrors().setEnabled(false);
233     dvModelerFrame.getMenuItemSaveErrors().setEnabled(false);
234   }
235
236
237   public ChangeListener JavaDoc getDataTabbedPaneChangeListener(){
238     return new ChangeListener JavaDoc() {
239       public void stateChanged(ChangeEvent JavaDoc e) {
240         browserTabChanged();
241       }
242     };
243   }
244
245   public void browserTabChanged() {
246     JTabbedPane JavaDoc dataTabbedPane = dvModelerFrame.getDataTabbedPane();
247     int selectedIndex = dataTabbedPane.getSelectedIndex();
248     String JavaDoc title = "";
249     if (selectedIndex == 0) {
250       title = "View Browser";
251       dataViewTreeNodeSelected();
252     } else if (selectedIndex == 1) {
253       title = "Entity Browser";
254       dataMapTreeNodeSelected();
255     }
256     dvModelerFrame.getBrowserTile().setCaption(title);
257     enableControls();
258   }
259
260   private void enableControls() {
261     JTree JavaDoc dataMapTree = dvModelerFrame.getDataMapTree();
262     JTree JavaDoc dataViewTree = dvModelerFrame.getDataViewTree();
263
264     JTabbedPane JavaDoc dataTabbedPane = dvModelerFrame.getDataTabbedPane();
265     boolean dataViewTabSelected = (dataTabbedPane.getSelectedIndex() == 0);
266     boolean openProject = (cayenneProject != null);
267     Object JavaDoc node = (dataViewTabSelected ?
268                    dataViewTree.getLastSelectedPathComponent() :
269                    dataMapTree.getLastSelectedPathComponent());
270     addNewDataViewAction.setEnabled(
271         openProject && dataViewTabSelected);
272     addNewObjEntityViewAction.setEnabled(
273         node instanceof DataView ||
274         node instanceof ObjEntity);
275     addNewFieldAction.setEnabled(
276         node instanceof ObjEntityView);
277     deleteAction.setEnabled(
278         node instanceof DataView ||
279         node instanceof ObjEntityView ||
280         node instanceof ObjEntityViewField);
281   }
282
283
284   private class OpenAction extends AbstractAction JavaDoc {
285     private OpenAction() {
286       super(
287           "Open Cayenne Project...",
288           new ImageIcon JavaDoc(SaveAction.class.getResource("images/open.gif")));
289       setEnabled(true);
290       putValue(Action.ACTION_COMMAND_KEY, "open-project");
291       putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("control O"));
292       putValue(Action.SHORT_DESCRIPTION, "Open Cayenne Project");
293     }
294     public void actionPerformed(ActionEvent JavaDoc e) {
295       openCayenneProjectFileAction(e);
296     }
297   }
298
299   private void openCayenneProjectFileAction(ActionEvent JavaDoc event){
300     JTree JavaDoc dataMapTree = dvModelerFrame.getDataMapTree();
301     JTree JavaDoc dataViewTree = dvModelerFrame.getDataViewTree();
302
303     int returnVal = openProjectFileChooser.showDialog(dvModelerFrame, "Open Project");
304
305     if (returnVal == JFileChooser.APPROVE_OPTION) {
306       if (cayenneProject != null) {
307         int result = JOptionPane.showConfirmDialog(
308             dvModelerFrame,
309             "Save current project before its closing?",
310             "DVModeler :: Confirmation",
311             JOptionPane.YES_NO_CANCEL_OPTION,
312             JOptionPane.QUESTION_MESSAGE);
313         if (result == JOptionPane.CANCEL_OPTION)
314           return;
315         else if (result == JOptionPane.YES_OPTION)
316           result = saveCayenneProjectFileAction(null, SaveErrorsDialog.CLOSE_DIALOG);
317         if ((result == -1) || (result == SaveErrorsDialog.CLOSE_WITHOUT_SAVING)){
318           cayenneProject = null;
319           dvModelerFrame.getMenuItemLoadErrors().setEnabled(false);
320           dvModelerFrame.getMenuItemSaveErrors().setEnabled(false);
321         } else return;
322       }
323
324       File JavaDoc file = openProjectFileChooser.getSelectedFile();
325
326       try {
327         cayenneProject = new CayenneProject(file);
328         java.util.List JavaDoc loadErrorsList = cayenneProject.getLoadErrors();
329
330         if (loadErrorsList.size() != 0){
331           loadErrorsDialog = new ErrorsDialog(dvModelerFrame, loadErrorsList, "Load Errors");
332           loadErrorsDialog.setVisible(true);
333           dvModelerFrame.getMenuItemLoadErrors().setEnabled(true);
334         }
335
336         DataViewTreeModel dataViewTreeModel = (DataViewTreeModel)dataViewTree.getModel();
337         dataViewTreeModel.setDataViews(cayenneProject.getDataViews());
338         DataMapTreeModel dataMapTreeModel = (DataMapTreeModel)dataMapTree.getModel();
339         dataMapTreeModel.setDataMaps(cayenneProject.getDataMaps());
340
341         JTable JavaDoc fieldsTable = dvModelerFrame.getFieldsTable();
342         FieldsTableModel tableModel = (FieldsTableModel)fieldsTable.getModel();
343         dvModelerFrame.getTopCardPanel().setModels(dataMapTreeModel,dataViewTreeModel,tableModel);
344         for (Iterator JavaDoc i = cayenneProject.getDataViews().iterator(); i.hasNext(); ) {
345           DataView dataView = (DataView)i.next();
346           dataView.addPropertyChangeListener(propertyChangeMediator);
347           for (Iterator JavaDoc j = dataView.getObjEntityViews().iterator(); j.hasNext(); ) {
348             ObjEntityView view = (ObjEntityView)j.next();
349             view.addPropertyChangeListener(propertyChangeMediator);
350             for (Iterator JavaDoc k = view.getObjEntityViewFields().iterator(); k.hasNext(); ) {
351               ObjEntityViewField field = (ObjEntityViewField)k.next();
352               field.addPropertyChangeListener(propertyChangeMediator);
353             }
354           }
355         }
356       }
357       catch (DVModelerException ex) {
358         showExceptionDialog(
359             "Could not open selected Cayenne project", ex);
360       } finally {
361         dvModelerFrame.getTopCardPanel().setProject(cayenneProject);
362         enableControls();
363         saveAction.setEnabled(true);
364         dvModelerFrame.getMenuItemClose().setEnabled(true);
365       }
366     }
367   }
368
369     private class AddNewDataViewAction extends AbstractAction JavaDoc {
370     private AddNewDataViewAction() {
371       super(
372           "Add Data View",
373           new ImageIcon JavaDoc(DVModelerFrame.class.getResource("images/add-dataview.gif")));
374       setEnabled(false);
375       putValue(Action.ACTION_COMMAND_KEY, "create-new-data-view");
376       putValue(Action.SHORT_DESCRIPTION, "Create New Data View");
377     }
378     public void actionPerformed(ActionEvent JavaDoc e) {
379       addNewDataViewAction();
380     }
381   }
382
383   private void addNewDataViewAction() {
384     JTree JavaDoc dataViewTree = dvModelerFrame.getDataViewTree();
385
386     DataView dataView = cayenneProject.createDataView();
387     DataViewTreeModel dataViewTreeModel =
388         (DataViewTreeModel)dataViewTree.getModel();
389     TreePath JavaDoc path = dataViewTreeModel.dataViewAdded(dataView);
390     dataViewTree.makeVisible(path);
391     dataView.addPropertyChangeListener(propertyChangeMediator);
392   }
393
394     private class AddNewObjEntityViewAction extends AbstractAction JavaDoc {
395     private AddNewObjEntityViewAction() {
396       super(
397           "Add ObjEntityView",
398           new ImageIcon JavaDoc(AddNewObjEntityViewAction.class.getResource("images/add-objentityview.gif")));
399       setEnabled(false);
400       putValue(Action.ACTION_COMMAND_KEY, "create-new-view");
401       putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("control W"));
402       putValue(Action.SHORT_DESCRIPTION, "Create New ObjEntityView");
403     }
404     public void actionPerformed(ActionEvent JavaDoc e) {
405       addNewObjEntityViewAction(e);
406     }
407   }
408
409   private void addNewObjEntityViewAction(ActionEvent JavaDoc event){
410     JTabbedPane JavaDoc dataTabbedPane = dvModelerFrame.getDataTabbedPane();
411     JTree JavaDoc dataMapTree = dvModelerFrame.getDataMapTree();
412     JTree JavaDoc dataViewTree = dvModelerFrame.getDataViewTree();
413
414     int tabIndex = dataTabbedPane.getSelectedIndex();
415     ObjEntityView view = null;
416     if (tabIndex == 0) {
417       TreePath JavaDoc path = dataViewTree.getSelectionPath();
418       DataView dataView = (DataView)path.getLastPathComponent();
419       ObjEntity selectedObjEntity = (ObjEntity)JOptionPane.showInputDialog(
420           dvModelerFrame,
421           "Select ObjEntity",
422           "DVModeler :: New Entity View",
423           JOptionPane.PLAIN_MESSAGE,
424           null,
425           cayenneProject.getObjEntities(),
426           cayenneProject.getObjEntities()[0]);
427        if (selectedObjEntity != null){
428          view = new ObjEntityView(dataView);
429          view.setObjEntity(selectedObjEntity);
430        } else return;
431
432
433     } else if (tabIndex == 1) {
434       TreePath JavaDoc path = dataMapTree.getSelectionPath();
435
436       ObjEntity objEntity = (ObjEntity)path.getLastPathComponent();
437       /* DataView choice */
438       Object JavaDoc[] dataViews = cayenneProject.getDataViews().toArray();
439       if (dataViews.length == 0) {
440         JOptionPane.showMessageDialog(
441             dvModelerFrame,
442             "First, create a data view (Tab \"Views\")",
443             "DVModeler :: Warning",
444             JOptionPane.WARNING_MESSAGE);
445         return;
446       }
447       DataView selectedDataView = (DataView)JOptionPane.showInputDialog(
448           dvModelerFrame,
449           "Select Data View",
450           "DVModeler :: New Entity View",
451           JOptionPane.PLAIN_MESSAGE,
452           null,
453           dataViews,
454           dataViews[0]);
455       if (selectedDataView == null)
456       return;
457       java.util.List JavaDoc allObjEntityViews = new ArrayList JavaDoc();
458
459       for (Iterator JavaDoc j = cayenneProject.getDataViews().iterator(); j.hasNext();){
460         DataView dataView = (DataView)j.next();
461         allObjEntityViews.addAll(dataView.getObjEntityViews());
462       }
463       view = selectedDataView.createObjEntityView(allObjEntityViews);
464       view.setObjEntity(objEntity);
465     }
466
467     DataViewTreeModel dataViewTreeModel =
468         (DataViewTreeModel)dataViewTree.getModel();
469     TreePath JavaDoc path = dataViewTreeModel.objEntityViewAdded(view);
470     dataViewTree.makeVisible(path);
471     DataMapTreeModel dataMapTreeModel =
472         (DataMapTreeModel)dataMapTree.getModel();
473     path = dataMapTreeModel.objEntityViewAdded(view);
474     if (path != null)
475       dataMapTree.makeVisible(path);
476
477     view.addPropertyChangeListener(propertyChangeMediator);
478   }
479
480   private class AddNewFieldAction extends AbstractAction JavaDoc {
481     private AddNewFieldAction() {
482       super(
483           "Add Field",
484           new ImageIcon JavaDoc(AddNewFieldAction.class.getResource("images/add-objentityviewfield.gif")));
485       setEnabled(false);
486       putValue(Action.ACTION_COMMAND_KEY, "create-new-field");
487       putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("control F"));
488       putValue(Action.SHORT_DESCRIPTION, "Create New Field in ObjEntityView");
489     }
490     public void actionPerformed(ActionEvent JavaDoc e) {
491       addNewFieldAction(e);
492     }
493   }
494
495   private void addNewFieldAction(ActionEvent JavaDoc event){
496     JTabbedPane JavaDoc dataTabbedPane = dvModelerFrame.getDataTabbedPane();
497     JTree JavaDoc dataMapTree = dvModelerFrame.getDataMapTree();
498     JTree JavaDoc dataViewTree = dvModelerFrame.getDataViewTree();
499
500     int tabIndex = dataTabbedPane.getSelectedIndex();
501     TreePath JavaDoc selectionPath = null;
502     if (tabIndex == 0) {
503       selectionPath = dataViewTree.getSelectionPath();
504     } else if (tabIndex == 1) {
505       selectionPath = dataMapTree.getSelectionPath();
506     }
507     ObjEntityView objEntityView = (ObjEntityView)selectionPath.getLastPathComponent();
508     ObjEntityViewField newField = objEntityView.createObjEntityViewField();
509     DataViewTreeModel dataViewTreeModel =
510         (DataViewTreeModel)dataViewTree.getModel();
511     TreePath JavaDoc path = dataViewTreeModel.fieldAdded(newField);
512     dataViewTree.makeVisible(path);
513     DataMapTreeModel dataMapTreeModel =
514         (DataMapTreeModel)dataMapTree.getModel();
515     path = dataMapTreeModel.fieldAdded(newField);
516     if (path != null)
517       dataMapTree.makeVisible(path);
518
519     int fieldIndex = objEntityView.getIndexOfObjEntityViewField(newField);
520
521     JTable JavaDoc fieldsTable = dvModelerFrame.getFieldsTable();
522     FieldsTableModel tableModel = (FieldsTableModel)fieldsTable.getModel();
523       tableModel.fireTableRowsInserted(fieldIndex,fieldIndex);
524
525
526     newField.addPropertyChangeListener(propertyChangeMediator);
527   }
528
529
530
531   private class SaveAction extends AbstractAction JavaDoc {
532     private SaveAction() {
533       super(
534           "Save Cayenne Project",
535           new ImageIcon JavaDoc(SaveAction.class.getResource("images/save_edit.gif")));
536       setEnabled(true);
537       putValue(Action.ACTION_COMMAND_KEY, "save-project");
538       putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("control S"));
539       putValue(Action.SHORT_DESCRIPTION, "Save Cayenne Project");
540     }
541     public void actionPerformed(ActionEvent JavaDoc e) {
542       saveCayenneProjectFileAction(e, SaveErrorsDialog.SAVE_DIALOG);
543     }
544   }
545  /**
546  * It return -1 if
547  */

548   private int saveCayenneProjectFileAction(ActionEvent JavaDoc event, String JavaDoc dialogType){
549     if (cayenneProject == null)
550       return -1;
551     try {
552       cayenneProject.buildDataViewsElements();
553       java.util.List JavaDoc saveErrorsList = cayenneProject.getSaveErrors();
554
555       if (saveErrorsList.size() != 0){
556         saveErrorsDialog = new ErrorsDialog(dvModelerFrame, saveErrorsList, "Save Errors");
557         saveErrorsDialog.setVisible(false);
558         dvModelerFrame.getMenuItemSaveErrors().setEnabled(true);
559
560         int selectedValue = SaveErrorsDialog.showSaveErrorsDialog(dvModelerFrame, saveErrorsList, dialogType);
561
562         if (selectedValue == SaveErrorsDialog.SAVE_ANYWAY){
563           cayenneProject.save();
564         }else return selectedValue;
565       }else {
566         cayenneProject.save();
567       }
568     }
569     catch (IOException JavaDoc ex) {
570
571       showExceptionDialog(
572           "Could not save Cayenne project", ex);
573     }
574     return -1;
575   }
576
577   private class DeleteAction extends AbstractAction JavaDoc {
578     private DeleteAction() {
579       super(
580           "Delete",
581           new ImageIcon JavaDoc(AddNewObjEntityViewAction.class.getResource("images/delete.gif")));
582       setEnabled(false);
583       putValue(Action.ACTION_COMMAND_KEY, "delete");
584       putValue(Action.SHORT_DESCRIPTION, "Remove Selected Item");
585
586     }
587     public void actionPerformed(ActionEvent JavaDoc e) {
588       deleteAction(e);
589     }
590   }
591
592   private void deleteAction(ActionEvent JavaDoc e){
593     JTabbedPane JavaDoc dataTabbedPane = dvModelerFrame.getDataTabbedPane();
594     JTree JavaDoc dataMapTree = dvModelerFrame.getDataMapTree();
595     JTree JavaDoc dataViewTree = dvModelerFrame.getDataViewTree();
596
597     boolean dataViewTabSelected = (dataTabbedPane.getSelectedIndex() == 0);
598     Object JavaDoc node = (dataViewTabSelected ?
599                    dataViewTree.getLastSelectedPathComponent() :
600                    dataMapTree.getLastSelectedPathComponent());
601
602     if (node instanceof DataView){
603       DataView dataView = (DataView)node;
604       if (dataView.getObjEntityViewCount() != 0){
605         int option = JOptionPane.showConfirmDialog(
606           dvModelerFrame,
607           "Do you really whant to delete the selected DataView?",
608           "DVModeler :: Deleting DataView",
609           JOptionPane.OK_CANCEL_OPTION
610         );
611
612         if (option == JOptionPane.OK_OPTION){
613           int index = cayenneProject.getDataViews().indexOf(dataView);
614           Map JavaDoc removingViews = cayenneProject.removeDataView(dataView);
615
616           DataViewTreeModel dataViewTreeModel =
617             (DataViewTreeModel)dataViewTree.getModel();
618           dataViewTreeModel.dataViewRemoved(dataView, index);
619
620           DataMapTreeModel dataMapTreeModel =
621             (DataMapTreeModel)dataMapTree.getModel();
622           dataMapTreeModel.objEntityViewsRemoved(removingViews);
623
624           if (cayenneProject.getDataViews().size() == 0){
625
626             dvModelerFrame.getTopCardPanel().showPanel(null);
627             showBottomEmptyPanel();
628           }else{
629             if (index == 0){
630               selectDataView((DataView)cayenneProject.getDataViews().get(0));
631             } else {
632               selectDataView((DataView)cayenneProject.getDataViews().get(index - 1));
633             }
634           }
635         }
636       } else {
637         int index = cayenneProject.getDataViews().indexOf(dataView);
638         cayenneProject.removeDataView(dataView);
639
640         DataViewTreeModel dataViewTreeModel =
641           (DataViewTreeModel)dataViewTree.getModel();
642         dataViewTreeModel.dataViewRemoved(dataView, index);
643
644         if (cayenneProject.getDataViews().size() == 0){
645
646           dvModelerFrame.getTopCardPanel().showPanel(null);
647           showBottomEmptyPanel();
648         }else{
649           if (index == 0){
650             selectDataView((DataView)cayenneProject.getDataViews().get(0));
651           } else {
652             selectDataView((DataView)cayenneProject.getDataViews().get(index - 1));
653           }
654         }
655       }
656
657
658     } else if (node instanceof ObjEntityView){
659       ObjEntityView view = (ObjEntityView)node;
660       DataView dataView = view.getDataView();
661       int indexInDataView = dataView.getIndexOfObjEntityView(view);
662       ObjEntity entity = view.getObjEntity();
663
664       int indexInDataMap = -1;
665
666       if (entity != null){
667         indexInDataMap = entity.getIndexOfObjEntityView(view);
668         dataView.removeObjEntityView(view);
669
670         DataMapTreeModel dataMapTreeModel =
671           (DataMapTreeModel)dataMapTree.getModel();
672         dataMapTreeModel.objEntityViewRemoved(entity, view, indexInDataMap);
673
674       } else {
675         dataView.removeObjEntityView(view);
676       }
677
678       DataViewTreeModel dataViewTreeModel =
679         (DataViewTreeModel)dataViewTree.getModel();
680       dataViewTreeModel.objEntityViewRemoved(view, indexInDataView);
681
682
683       if (dataViewTabSelected){
684         if (dataView.getObjEntityViewCount() == 0){
685           selectDataView(dataView);
686         }else{
687           if (indexInDataView == 0){
688             selectObjEntityView(dataViewTabSelected, dataView.getObjEntityView(0));
689           } else {
690             selectObjEntityView(dataViewTabSelected, dataView.getObjEntityView(indexInDataView - 1));
691           }
692         }
693       }else{
694         if (entity.getObjEntityViewCount() == 0){
695           selectObjEntity(entity);
696         }else{
697           if (indexInDataMap == 0){
698             selectObjEntityView(dataViewTabSelected, entity.getObjEntityView(0));
699           } else {
700             selectObjEntityView(dataViewTabSelected, entity.getObjEntityView(indexInDataMap - 1));
701           }
702         }
703       }
704     } else if (node instanceof ObjEntityViewField){
705       ObjEntityViewField field = (ObjEntityViewField)node;
706       ObjEntityView view = field.getObjEntityView();
707
708       int index = view.getIndexOfObjEntityViewField(field);
709       view.removeObjEntityViewField(field);
710
711       DataViewTreeModel dataViewTreeModel =
712         (DataViewTreeModel)dataViewTree.getModel();
713       dataViewTreeModel.fieldRemoved(field, index);
714
715       DataMapTreeModel dataMapTreeModel =
716         (DataMapTreeModel)dataMapTree.getModel();
717       dataMapTreeModel.fieldRemoved(field, index);
718
719       JTable JavaDoc fieldsTable = dvModelerFrame.getFieldsTable();
720       FieldsTableModel tableModel = (FieldsTableModel)fieldsTable.getModel();
721       tableModel.fireTableRowsDeleted(index,index);
722       
723       if (view.getObjEntityViewFieldCount() == 0){
724         if (dataViewTabSelected){
725           selectObjEntityViewInDataViewTree(view);
726         } else {
727           selectObjEntityViewInDataMapTree(view);
728         }
729
730       } else {
731         if (index == 0){
732           selectField(dataViewTabSelected, view.getObjEntityViewField(0));
733         } else {
734           selectField(dataViewTabSelected, view.getObjEntityViewField(index-1));
735
736         }
737       }
738     }
739   }
740
741
742   private void selectDataView(DataView dataView){
743     JTree JavaDoc dataViewTree = dvModelerFrame.getDataViewTree();
744
745     DataViewTreeModel dataViewTreeModel = (DataViewTreeModel)dataViewTree.getModel();
746     Object JavaDoc[] path = new Object JavaDoc[] {dataViewTreeModel.getRoot(),
747                                   dataView
748                                   };
749
750     dataViewTree.setSelectionPath(new TreePath JavaDoc(path));
751   }
752
753   private void selectObjEntity(ObjEntity entity){
754     JTree JavaDoc dataMapTree = dvModelerFrame.getDataMapTree();
755
756     DataMapTreeModel dataMapTreeModel = (DataMapTreeModel)dataMapTree.getModel();
757     DataMap dataMap = entity.getDataMap();
758     Object JavaDoc[] path = new Object JavaDoc[] {dataMapTreeModel.getRoot(),
759                                   dataMap,
760                                   entity
761                                  };
762
763     dataMapTree.setSelectionPath(new TreePath JavaDoc(path));
764   }
765
766   private void selectObjEntityView(boolean dataViewTabSelected, ObjEntityView view){
767     DataView dataView = view.getDataView();
768     JTree JavaDoc dataMapTree = dvModelerFrame.getDataMapTree();
769     JTree JavaDoc dataViewTree = dvModelerFrame.getDataViewTree();
770
771     DataViewTreeModel dataViewTreeModel = (DataViewTreeModel)dataViewTree.getModel();
772     if (dataViewTabSelected){
773       Object JavaDoc[] path = new Object JavaDoc[]{dataViewTreeModel.getRoot(),
774                                    dataView,
775                                    view
776                                   };
777
778       dataViewTree.setSelectionPath(new TreePath JavaDoc(path));
779     } else {
780       ObjEntity entity = view.getObjEntity();
781       DataMap dataMap = entity.getDataMap();
782       DataMapTreeModel dataMapTreeModel = (DataMapTreeModel)dataMapTree.getModel();
783
784       Object JavaDoc[] path = new Object JavaDoc[]{dataMapTreeModel.getRoot(),
785                                    dataMap,
786                                    entity,
787                                    view
788                                   };
789       dataMapTree.setSelectionPath(new TreePath JavaDoc(path));
790     }
791   }
792
793   private void selectObjEntityViewInDataViewTree(ObjEntityView view){
794     JTree JavaDoc dataViewTree = dvModelerFrame.getDataViewTree();
795
796     DataViewTreeModel dataViewTreeModel = (DataViewTreeModel)dataViewTree.getModel();
797     DataView dataView = view.getDataView();
798     Object JavaDoc[] path = new Object JavaDoc[] {dataViewTreeModel.getRoot(),
799                                         dataView,
800                                         view
801                                        };
802
803     dataViewTree.setSelectionPath(new TreePath JavaDoc(path));
804   }
805
806   private void selectObjEntityViewInDataMapTree(ObjEntityView view){
807     JTree JavaDoc dataMapTree = dvModelerFrame.getDataMapTree();
808
809     DataMapTreeModel dataMapTreeModel = (DataMapTreeModel)dataMapTree.getModel();
810     ObjEntity entity = view.getObjEntity();
811     DataMap dataMap = entity.getDataMap();
812     Object JavaDoc[] path = new Object JavaDoc[] {dataMapTreeModel.getRoot(),
813                                         dataMap,
814                                         entity,
815                                         view
816                                        };
817
818     dataMapTree.setSelectionPath(new TreePath JavaDoc(path));
819   }
820   private void selectField(boolean dataViewTabSelected, ObjEntityViewField field){
821     JTree JavaDoc dataMapTree = dvModelerFrame.getDataMapTree();
822     JTree JavaDoc dataViewTree = dvModelerFrame.getDataViewTree();
823
824     ObjEntityView view = field.getObjEntityView();
825     DataView dataView = view.getDataView();
826     DataViewTreeModel dataViewTreeModel = (DataViewTreeModel)dataViewTree.getModel();
827     if (dataViewTabSelected){
828       Object JavaDoc[] path = new Object JavaDoc[]{dataViewTreeModel.getRoot(),
829                                    dataView,
830                                    view,
831                                    field
832                                   };
833
834       dataViewTree.setSelectionPath(new TreePath JavaDoc(path));
835     } else {
836       ObjEntity entity = view.getObjEntity();
837       DataMap dataMap = entity.getDataMap();
838       DataMapTreeModel dataMapTreeModel = (DataMapTreeModel)dataMapTree.getModel();
839
840       Object JavaDoc[] path = new Object JavaDoc[]{dataMapTreeModel.getRoot(),
841                                    dataMap,
842                                    entity,
843                                    view,
844                                    field
845                                   };
846       dataMapTree.setSelectionPath(new TreePath JavaDoc(path));
847     }
848   }
849
850   public ActionListener JavaDoc getMenuItemLoadErrorsActionListenr(){
851     return new ActionListener JavaDoc(){
852       public void actionPerformed(ActionEvent JavaDoc e){
853         loadErrorsAction(e);
854       }
855     };
856   }
857
858   private void loadErrorsAction(ActionEvent JavaDoc e){
859     loadErrorsDialog.setVisible(true);
860   }
861
862   public ActionListener JavaDoc getMenuItemSaveErrorsActionListener(){
863     return new ActionListener JavaDoc(){
864       public void actionPerformed(ActionEvent JavaDoc e){
865         saveErrorsAction(e);
866       }
867     };
868   }
869
870   private void saveErrorsAction(ActionEvent JavaDoc e){
871     saveErrorsDialog.setVisible(true);
872   }
873
874   public TreeSelectionListener JavaDoc getDataMapTreeTreeSelectionListener(){
875     return new TreeSelectionListener JavaDoc(){
876       public void valueChanged(TreeSelectionEvent JavaDoc e){
877         dataMapTreeNodeSelected();
878       }
879     };
880   }
881
882   private void dataMapTreeNodeSelected() {
883     JTree JavaDoc dataMapTree = dvModelerFrame.getDataMapTree();
884
885     Object JavaDoc node = dataMapTree.getLastSelectedPathComponent();
886     String JavaDoc topTitle = "";
887     String JavaDoc bottomTitle = "";
888     if (node == null){
889       dvModelerFrame.getTopCardPanel().showPanel(null);
890       showBottomEmptyPanel();
891     }else if (node instanceof DataMap){
892       dvModelerFrame.getTopCardPanel().showPanel((DVObject)node);
893       showBottomEmptyPanel();
894       topTitle = "Data View \"" +
895                  node +
896                  "\" :: Properties";
897     } else if (node instanceof ObjEntity){
898       dvModelerFrame.getTopCardPanel().showPanel((DVObject)node);
899       ObjEntity objEntity = (ObjEntity)node;
900       showRelatioshipsTable(objEntity);
901       topTitle = "Entity \"" +
902                  node +
903                  "\" :: Attributes";
904       bottomTitle = "Entity \"" +
905                     node +
906                     "\" :: Relationships";
907     } else if (node instanceof ObjEntityView){
908       dvModelerFrame.getTopCardPanel().showPanel((DVObject)node);
909       showFieldsTable((ObjEntityView)node);
910       topTitle = "View \"" +
911                  node +
912                  "\" :: Properties";
913       bottomTitle = "View \"" +
914                     node +
915                     "\" :: Fields";
916     } else if (node instanceof ObjEntityViewField){
917       dvModelerFrame.getTopCardPanel().showPanel((DVObject)node);
918       ObjEntityViewField field = (ObjEntityViewField)node;
919
920       showFieldsTable(field.getObjEntityView());
921       int index = field.getObjEntityView().getIndexOfObjEntityViewField(field);
922       JTable JavaDoc fieldsTable = dvModelerFrame.getFieldsTable();
923       fieldsTable.setRowSelectionInterval(index,index);
924
925       topTitle = "Field \"" + node + "\" :: Properties";
926       bottomTitle = "View \"" +
927                     ((ObjEntityViewField)node).getObjEntityView() +
928                     "\" :: Fields";
929     }
930
931     dvModelerFrame.getTopTile().setCaption(topTitle);
932     dvModelerFrame.getBottomTile().setCaption(bottomTitle);
933     enableControls();
934   }
935
936   public TreeSelectionListener JavaDoc getDataViewTreeTreeSelectionListener(){
937     return new TreeSelectionListener JavaDoc(){
938       public void valueChanged(TreeSelectionEvent JavaDoc e){
939         dataViewTreeNodeSelected();
940       }
941     };
942   }
943
944   private void dataViewTreeNodeSelected() {
945     JTree JavaDoc dataViewTree = dvModelerFrame.getDataViewTree();
946
947     Object JavaDoc node = dataViewTree.getLastSelectedPathComponent();
948     String JavaDoc topTitle = "";
949     String JavaDoc bottomTitle = "";
950
951     if (node == null){
952       dvModelerFrame.getTopCardPanel().showPanel(null);
953       showBottomEmptyPanel();
954     }else if (node instanceof DataView){
955       dvModelerFrame.getTopCardPanel().showPanel((DVObject)node);
956       showBottomEmptyPanel();
957       topTitle = "Data View \"" +
958                  node +
959                  "\" :: Properties";
960     } else if (node instanceof ObjEntityView){
961       dvModelerFrame.getTopCardPanel().showPanel((DVObject)node);
962       showFieldsTable((ObjEntityView)node);
963       topTitle = "View \"" +
964                  node +
965                  "\" :: Properties";
966       bottomTitle = "View \"" +
967                     node +
968                     "\" :: Fields";
969     } else if (node instanceof ObjEntityViewField){
970       dvModelerFrame.getTopCardPanel().showPanel((DVObject)node);
971       ObjEntityViewField field = (ObjEntityViewField)node;
972       showFieldsTable(field.getObjEntityView());
973       int index = field.getObjEntityView().getIndexOfObjEntityViewField(field);
974
975       JTable JavaDoc fieldsTable = dvModelerFrame.getFieldsTable();
976       fieldsTable.setRowSelectionInterval(index,index);
977       topTitle = "Field \"" + node + "\" :: Properties";
978       bottomTitle = "View \"" +
979                     ((ObjEntityViewField)node).getObjEntityView() +
980                     "\" :: Fields";
981     }
982     dvModelerFrame.getTopTile().setCaption(topTitle);
983     dvModelerFrame.getBottomTile().setCaption(bottomTitle);
984     enableControls();
985   }
986
987
988     private void showBottomEmptyPanel(){
989     JPanel JavaDoc bottomCardPanel = dvModelerFrame.getBottomCardPanel();
990     CardLayout JavaDoc cardLayout = (CardLayout JavaDoc)bottomCardPanel.getLayout();
991     cardLayout.show(bottomCardPanel, "emptyPanel");
992   }
993
994   private void showFieldsTable(ObjEntityView view){
995     JTable JavaDoc fieldsTable = dvModelerFrame.getFieldsTable();
996     FieldsTableModel fieldsTableModel = (FieldsTableModel)fieldsTable.getModel();
997     fieldsTableModel.setObjEntityView(view);
998
999     JPanel JavaDoc bottomCardPanel = dvModelerFrame.getBottomCardPanel();
1000    CardLayout JavaDoc cardLayout = (CardLayout JavaDoc)bottomCardPanel.getLayout();
1001    cardLayout.show(bottomCardPanel, "fieldsTable");
1002  }
1003
1004  private void showRelatioshipsTable(ObjEntity objEntity){
1005    java.util.List JavaDoc relationships = new ArrayList JavaDoc();
1006    relationships.addAll(objEntity.getDataMap().getObjRelationshipsBySource(objEntity));
1007    relationships.addAll(objEntity.getDataMap().getObjRelationshipsByTarget(objEntity));
1008
1009    JTable JavaDoc relationshipsTable = dvModelerFrame.getRelationshipsTable();
1010    RelationshipsTableModel model = (RelationshipsTableModel)relationshipsTable.getModel();
1011    model.setObjRelationships(relationships);
1012
1013    JPanel JavaDoc bottomCardPanel = dvModelerFrame.getBottomCardPanel();
1014    CardLayout JavaDoc cardLayout = (CardLayout JavaDoc)bottomCardPanel.getLayout();
1015    cardLayout.show(bottomCardPanel, "relationshipsTable");
1016  }
1017
1018    private void configureFileChoosers() {
1019    openProjectFileChooser.setDialogType(JFileChooser.OPEN_DIALOG);
1020    openProjectFileChooser.setApproveButtonMnemonic('O');
1021    openProjectFileChooser.setApproveButtonText("Open Project");
1022    openProjectFileChooser.setApproveButtonToolTipText("Open Selected Cayenne Project");
1023    openProjectFileChooser.setDialogTitle("DVModeler :: Open Cayenne Project");
1024    openProjectFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1025    openProjectFileChooser.setMultiSelectionEnabled(false);
1026    openProjectFileChooser.setFileFilter(new javax.swing.filechooser.FileFilter JavaDoc() {
1027      public String JavaDoc getDescription() {
1028        return "(*.xml) Cayenne Project Files";
1029      }
1030      public boolean accept(File JavaDoc file) {
1031        return (file.isDirectory() ||
1032                file.getName().toLowerCase().endsWith(".xml"));
1033      }
1034    });
1035  }
1036
1037    private class PropertyChangeMediator implements PropertyChangeListener JavaDoc {
1038    public void propertyChange(PropertyChangeEvent JavaDoc e) {
1039      Object JavaDoc source = e.getSource();
1040      String JavaDoc propertyName = e.getPropertyName();
1041
1042      JTree JavaDoc dataMapTree = dvModelerFrame.getDataMapTree();
1043      JTree JavaDoc dataViewTree = dvModelerFrame.getDataViewTree();
1044
1045      DataViewTreeModel dataViewTreeModel =
1046          (DataViewTreeModel)dataViewTree.getModel();
1047      DataMapTreeModel dataMapTreeModel =
1048          (DataMapTreeModel)dataMapTree.getModel();
1049
1050      JTable JavaDoc fieldsTable = dvModelerFrame.getFieldsTable();
1051
1052
1053      if (source instanceof DataView) {
1054        if ("name".equals(propertyName)) {
1055          String JavaDoc topTitle = "Data View \"" +
1056                             source +
1057                             "\" :: Properties";
1058          dvModelerFrame.getTopTile().setCaption(topTitle);
1059          dataViewTreeModel.dataViewChanged((DataView)source);
1060        }
1061      } else if (source instanceof ObjEntityView) {
1062        if ("name".equals(propertyName)) {
1063          String JavaDoc topTitle = "View \"" +
1064                            source +
1065                            "\" :: Properties";
1066          String JavaDoc bottomTitle = "View \"" +
1067                               source +
1068                               "\" :: Fields";
1069          dvModelerFrame.getTopTile().setCaption(topTitle);
1070          dvModelerFrame.getBottomTile().setCaption(bottomTitle);
1071          dataViewTreeModel.objEntityViewChanged((ObjEntityView)source);
1072          dataMapTreeModel.objEntityViewChanged((ObjEntityView)source);
1073        }
1074      } else if (source instanceof ObjEntityViewField) {
1075
1076        FieldsTableModel fieldsTableModel = (FieldsTableModel)fieldsTable.getModel();
1077        ObjEntityViewField field = (ObjEntityViewField)source;
1078
1079        if ("name".equals(propertyName)) {
1080          String JavaDoc topTitle = "Field \"" + source + "\" :: Properties";
1081          dvModelerFrame.getTopTile().setCaption(topTitle);
1082          dataViewTreeModel.fieldChanged(field);
1083          dataMapTreeModel.fieldChanged(field);
1084          fieldsTableModel.fireTableCellUpdated(field.getObjEntityView().getIndexOfObjEntityViewField(field), 0);
1085        }
1086        if ("dataType".equals(propertyName)){
1087          fieldsTableModel.fireTableCellUpdated(field.getObjEntityView().getIndexOfObjEntityViewField(field), 1);
1088        }
1089        if ("calcType".equals(propertyName)){
1090          fieldsTableModel.fireTableCellUpdated(field.getObjEntityView().getIndexOfObjEntityViewField(field), 2);
1091        }
1092        if ("objRelationship".equals(propertyName)){
1093
1094          dataViewTreeModel.fieldChanged(field);
1095          dataMapTreeModel.fieldChanged(field);
1096          fieldsTableModel.fireTableCellUpdated(field.getObjEntityView().getIndexOfObjEntityViewField(field), 3);
1097        }
1098        if ("objAttribute".equals(propertyName)){
1099          dataViewTreeModel.fieldChanged(field);
1100          dataMapTreeModel.fieldChanged(field);
1101          fieldsTableModel.fireTableCellUpdated(field.getObjEntityView().getIndexOfObjEntityViewField(field), 3);
1102        }
1103        if ("lookup".equals(propertyName)){
1104          dataViewTreeModel.fieldChanged(field);
1105          dataMapTreeModel.fieldChanged(field);
1106          fieldsTableModel.fireTableCellUpdated(field.getObjEntityView().getIndexOfObjEntityViewField(field), 4);
1107        }
1108      }
1109    }
1110  }
1111
1112  private void showExceptionDialog(String JavaDoc description, Exception JavaDoc ex) {
1113    String JavaDoc message = "<html>" + description + "<br>";
1114    message += ex.getClass() + ": " + ex.getMessage() + "<br>";
1115    Exception JavaDoc cause = (Exception JavaDoc)ex.getCause();
1116    if (cause != null) {
1117      message += "caused by " + cause.getClass() + ": " + cause.getMessage();
1118    }
1119    message += "</html>";
1120    JOptionPane.showMessageDialog(
1121        dvModelerFrame, message, "DVModeler :: Error", JOptionPane.ERROR_MESSAGE);
1122  }
1123
1124
1125
1126}
1127
Popular Tags