001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.uml.ui.controls.newdialog;
043:
044: import java.awt.BorderLayout;
045: import java.awt.Color;
046: import java.awt.GridBagConstraints;
047: import java.awt.GridBagLayout;
048:
049: import javax.swing.JLabel;
050: import javax.swing.JPanel;
051: import javax.swing.JTextArea;
052: import javax.swing.border.TitledBorder;
053:
054: import org.netbeans.modules.uml.ui.support.wizard.IWizardSheet;
055: import org.netbeans.modules.uml.ui.support.wizard.WizardInteriorPage;
056:
057: /**
058: * @author sumitabhk
059: *
060: */
061: public class NewDialogWizardPage extends WizardInteriorPage {
062: private String origLocation = null;
063:
064: protected JLabel m_title = new JLabel();
065: protected JTextArea m_subTitle = new JTextArea();
066: protected JLabel m_headerImage = new JLabel();
067: protected JPanel m_HeaderPanel = new JPanel();
068: protected JPanel m_DetailPanel = new JPanel();
069:
070: public NewDialogWizardPage(IWizardSheet parent, String caption,
071: String headerTitle, String headerSubTitle) {
072: super (parent);//, caption, headerTitle, headerSubTitle);
073: }
074:
075: public NewDialogWizardPage(IWizardSheet parent) {
076: this (parent, "", "", "");
077: }
078:
079: protected void createUI() {
080: super .createUI();
081: // JLabel m_Watermark = new JLabel();
082: // m_Watermark.setIcon(getParentSheet().getBmpWatermark());
083: // setLayout(new BorderLayout());
084: // add(m_Watermark, BorderLayout.WEST);
085: // add(pnlContents, BorderLayout.CENTER);
086:
087: m_subTitle.setEditable(false);
088: pnlContents.setLayout(new GridBagLayout());
089:
090: JPanel panelHeaderText = new JPanel();
091: JPanel panelHeaderImage = new JPanel();
092:
093: m_title.setFont(new java.awt.Font("SansSerif", 1, 12));
094: m_subTitle.setFont(new java.awt.Font("SansSerif", 0, 10));
095: m_subTitle.setLineWrap(true);
096: m_subTitle.setWrapStyleWord(false);
097:
098: m_HeaderPanel.setBackground(Color.white);
099: panelHeaderText.setBackground(Color.white);
100: panelHeaderImage.setBackground(Color.white);
101:
102: m_HeaderPanel.setLayout(new GridBagLayout());
103: panelHeaderText.setLayout(new GridBagLayout());
104: panelHeaderImage.setLayout(new BorderLayout(5, 5));
105:
106: m_headerImage.setIcon(getParentSheet().getBmpHeader());
107:
108: panelHeaderImage.add(m_headerImage, BorderLayout.CENTER);
109:
110: GridBagConstraints gridBagConstraints = new GridBagConstraints();
111: gridBagConstraints.fill = GridBagConstraints.NONE;
112: gridBagConstraints.gridx = 0;
113: gridBagConstraints.gridy = 0;
114: gridBagConstraints.weightx = 0.1;
115: gridBagConstraints.weighty = 0.1;
116: gridBagConstraints.anchor = GridBagConstraints.WEST;
117: panelHeaderText.add(m_title, gridBagConstraints);//, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(8, 20, 0, 16), 263, 0));
118:
119: gridBagConstraints = new GridBagConstraints();
120: gridBagConstraints.fill = GridBagConstraints.BOTH;
121: gridBagConstraints.gridx = 0;
122: gridBagConstraints.gridy = 1;
123: gridBagConstraints.weightx = 0.9;
124: gridBagConstraints.weighty = 0.9;
125: gridBagConstraints.anchor = GridBagConstraints.WEST;
126: panelHeaderText.add(m_subTitle, gridBagConstraints);//, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 35, 6, 16), 232, 20));
127:
128: gridBagConstraints = new GridBagConstraints();
129: gridBagConstraints.fill = GridBagConstraints.BOTH;
130: gridBagConstraints.anchor = GridBagConstraints.WEST;
131: gridBagConstraints.gridx = 0;
132: gridBagConstraints.gridy = 0;
133: gridBagConstraints.weightx = 0.9;
134: m_HeaderPanel.add(panelHeaderText, gridBagConstraints);
135:
136: gridBagConstraints = new GridBagConstraints();
137: gridBagConstraints.fill = GridBagConstraints.NONE;
138: gridBagConstraints.anchor = GridBagConstraints.EAST;
139: gridBagConstraints.gridx = 1;
140: gridBagConstraints.gridy = 0;
141: gridBagConstraints.weightx = 0.1;
142: gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
143: m_HeaderPanel.add(panelHeaderImage, gridBagConstraints);
144: m_HeaderPanel.setBorder(new TitledBorder(null, "",
145: javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
146: javax.swing.border.TitledBorder.DEFAULT_POSITION,
147: new java.awt.Font("Dialog", 0, 12)));
148:
149: pnlContents.setBackground(Color.white);
150: gridBagConstraints = new GridBagConstraints();
151: gridBagConstraints.fill = GridBagConstraints.BOTH;
152: gridBagConstraints.gridx = 0;
153: gridBagConstraints.gridy = 0;
154: gridBagConstraints.weightx = 0.1;
155: gridBagConstraints.weighty = 0.1;
156: pnlContents.add(m_HeaderPanel, gridBagConstraints);
157:
158: gridBagConstraints = new GridBagConstraints();
159: gridBagConstraints.fill = GridBagConstraints.BOTH;
160: gridBagConstraints.gridx = 0;
161: gridBagConstraints.gridy = 1;
162: gridBagConstraints.weightx = 0.9;
163: gridBagConstraints.weighty = 0.9;
164: pnlContents.add(m_DetailPanel, gridBagConstraints);
165: }
166:
167: protected boolean onInitDialog() {
168: return super .onInitDialog();
169: }
170:
171: public void onWizardBack() {
172: super .onWizardBack();
173: }
174:
175: public void onWizardNext() {
176: super.onWizardNext();
177: }
178:
179: }
|