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.support.wizard;
043:
044: import java.awt.BorderLayout;
045: import java.awt.Color;
046: import java.awt.GridBagConstraints;
047: import java.awt.GridBagLayout;
048: import java.awt.Insets;
049:
050: import javax.swing.JLabel;
051: import javax.swing.JPanel;
052: import javax.swing.JTextArea;
053:
054: public abstract class WizardInteriorPage extends WizardPage {
055:
056: private static final String PG_CAPTION = null;
057: private static final String PG_TITLE = "Enter Page Title";
058: private static final String PG_SUBTITLE = "Enter Page Subtitle";
059:
060: private JPanel pnlHeader = new JPanel();
061: private JPanel pnlHeaderText = new JPanel();
062: private JPanel pnlHeaderImage = new JPanel();
063: protected JPanel pnlContents = new JPanel();
064:
065: private JLabel m_Title = new JLabel();
066: private JTextArea m_SubTitle = new JTextArea();
067: private JLabel m_HeaderImage = new JLabel();
068:
069: public WizardInteriorPage(IWizardSheet parent, int nIDCaption,
070: int nIDHeaderTitle, int nIDHeaderSubTitle) {
071: this (parent);
072: }
073:
074: public WizardInteriorPage(IWizardSheet parent, String caption,
075: String headerTitle, String headerSubTitle) {
076: super (parent);
077: this .setCaption(caption);
078: m_Title.setText(headerTitle);
079: m_SubTitle.setText(headerSubTitle);
080: }
081:
082: public WizardInteriorPage(IWizardSheet parent) {
083: this (parent, PG_CAPTION, PG_TITLE, PG_SUBTITLE);
084: }
085:
086: public WizardInteriorPage() {
087: super ();
088: }
089:
090: protected void createUI() {
091: super .createUI();
092:
093: //cb
094: // m_Title.setFont(new java.awt.Font("SansSerif", 1, 12));
095: // m_SubTitle.setFont(new java.awt.Font("SansSerif", 0, 10));
096: m_SubTitle.setLineWrap(true);
097: m_SubTitle.setWrapStyleWord(true);
098: m_SubTitle.setFocusable(false);
099: m_SubTitle.getAccessibleContext().setAccessibleName(
100: WizardResouces.getString("ACSN_TEXTAREA"));
101: m_SubTitle.getAccessibleContext().setAccessibleDescription(
102: WizardResouces.getString("ACSD_TEXTAREA"));
103:
104: pnlHeader.setBackground(Color.white);
105: pnlHeaderText.setBackground(Color.white);
106: pnlHeaderImage.setBackground(Color.white);
107:
108: pnlHeader.setLayout(new BorderLayout());
109: pnlHeaderText.setLayout(new GridBagLayout());
110: pnlHeaderImage.setLayout(new BorderLayout(5, 5));
111:
112: m_HeaderImage.setIcon(getParentSheet().getBmpHeader());
113:
114: this .pnlHeaderImage.add(m_HeaderImage, BorderLayout.CENTER);
115:
116: pnlHeaderText.add(m_Title, new GridBagConstraints(0, 0, 1, 1,
117: 0.0, 0.0, GridBagConstraints.WEST,
118: GridBagConstraints.NONE, new Insets(8, 20, 0, 16), 263,
119: 0));
120: pnlHeaderText.add(m_SubTitle, new GridBagConstraints(0, 1, 1,
121: 1, 1.0, 1.0, GridBagConstraints.CENTER,
122: GridBagConstraints.BOTH, new Insets(0, 35, 6, 16), 232,
123: 20));
124:
125: pnlHeader.add(pnlHeaderText, BorderLayout.CENTER);
126: pnlHeader.add(pnlHeaderImage, BorderLayout.EAST);
127:
128: pnlHeaderText.setEnabled(false);
129: pnlHeader.setEnabled(false);
130: m_SubTitle.setEditable(false);
131:
132: this .add(pnlHeader, BorderLayout.NORTH);
133: this .add(pnlContents, BorderLayout.CENTER);
134: }
135:
136: protected boolean onInitDialog() {
137:
138: return super.onInitDialog();
139: }
140:
141: }
|