KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > kelp > common > dods > CoreDodsTool


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  * Contributor(s):
20  * Paul Mahar
21  *
22  */

23
24 package org.enhydra.kelp.common.dods;
25
26 // Kelp imports
27
import org.enhydra.kelp.common.AbstractTool;
28
29 // ToolBox imports
30
import org.enhydra.tool.common.ButtonPanel;
31 import org.enhydra.tool.common.InnerPanel;
32 import org.enhydra.tool.common.SwingUtil;
33
34 // Standard imports
35
import java.awt.Frame JavaDoc;
36 import java.awt.event.ActionListener JavaDoc;
37 import java.util.ResourceBundle JavaDoc;
38
39 //Dusan
40
import java.io.File JavaDoc;
41 import org.enhydra.dods.generator.DODSGenerator;
42
43 //
44
public class CoreDodsTool extends AbstractTool {
45     static ResourceBundle JavaDoc addinRes =
46         ResourceBundle.getBundle("org.enhydra.kelp.common.Res"); // nores
47

48     private DodsInnerPanel innerPanel = null;
49     private DodsButtonPanel buttonPanel = null;
50     DODSGenerator generator;
51
52     public static final String JavaDoc getDefaultTitle() {
53       return "DODS Generator";
54     }
55
56     public static void main(String JavaDoc[] args) {
57         //Dusan 16.3.2003.
58
System.setProperty("DODS_HOME", "C:"+File.separator+"enhydra5.2"+
59           File.separator+"dods");
60
61         SwingUtil.setLookAndFeelToSystem();
62         CoreDodsTool tool = null;
63
64         tool = new CoreDodsTool();
65         tool.showDialog(new Frame JavaDoc());
66         System.exit(0);
67     }
68
69     public CoreDodsTool() {
70         super();
71     }
72
73     // override AbstractTool
74
public void clearAll() {
75         super.clearAll();
76         innerPanel = null;
77         buttonPanel = null;
78     }
79
80     // implement AbstractTool
81
public String JavaDoc getTitle() {
82       return CoreDodsTool.getDefaultTitle();
83     }
84
85     // implement AbstractTool
86
public ActionListener JavaDoc createButtonListener() {
87         return (new DodsButtonListener(this));
88     }
89
90     // implement AbstractTool
91
public InnerPanel getInnerPanel() {
92         if (innerPanel == null) {
93             innerPanel = new DodsInnerPanel();
94         }
95         return innerPanel;
96     }
97
98     // implement AbstractTool
99
public ButtonPanel getButtonPanel() {
100         if (buttonPanel == null) {
101             buttonPanel = new DodsButtonPanel();
102         }
103         return buttonPanel;
104     }
105
106     // implement AbstractTool
107
protected String JavaDoc getProgressTitle() {
108         return addinRes.getString("Dods_Progress");
109     }
110
111     protected void back() {
112       innerPanel.back();
113     }
114
115     protected void generate() {
116        innerPanel.generate(this);
117     }
118
119 }
120
Popular Tags