001: /*
002: * Copyright (c) 2007, Sun Microsystems, Inc.
003: * All rights reserved.
004: *
005: * Redistribution and use in source and binary forms, with or without
006: * modification, are permitted provided that the following conditions are met:
007: *
008: * * Redistributions of source code must retain the above copyright notice,
009: * this list of conditions and the following disclaimer.
010: * * Redistributions in binary form must reproduce the above copyright
011: * notice, this list of conditions and the following disclaimer in
012: * the documentation and/or other materials provided with the distribution.
013: * * Neither the name of Sun Microsystems, Inc. nor the names of its
014: * contributors may be used to endorse or promote products derived
015: * from this software without specific prior written permission.
016: *
017: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
018: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
019: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
020: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
021: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
022: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
023: * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
024: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
025: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
026: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
027: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
028: */
029:
030: /*
031: * DocumentEditorAboutBox.java
032: */
033:
034: package documenteditor;
035:
036: import org.jdesktop.application.Action;
037:
038: public class DocumentEditorAboutBox extends javax.swing.JDialog {
039:
040: public DocumentEditorAboutBox(java.awt.Frame parent) {
041: super (parent);
042: initComponents();
043: getRootPane().setDefaultButton(closeButton);
044: }
045:
046: @Action
047: public void closeAboutBox() {
048: setVisible(false);
049: }
050:
051: /** This method is called from within the constructor to
052: * initialize the form.
053: * WARNING: Do NOT modify this code. The content of this method is
054: * always regenerated by the Form Editor.
055: */
056: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
057: private void initComponents() {
058:
059: closeButton = new javax.swing.JButton();
060: javax.swing.JLabel appTitleLabel = new javax.swing.JLabel();
061: javax.swing.JLabel versionLabel = new javax.swing.JLabel();
062: javax.swing.JLabel appVersionLabel = new javax.swing.JLabel();
063: javax.swing.JLabel vendorLabel = new javax.swing.JLabel();
064: javax.swing.JLabel appVendorLabel = new javax.swing.JLabel();
065: javax.swing.JLabel homepageLabel = new javax.swing.JLabel();
066: javax.swing.JLabel appHomepageLabel = new javax.swing.JLabel();
067: javax.swing.JLabel appDescLabel = new javax.swing.JLabel();
068: javax.swing.JLabel imageLabel = new javax.swing.JLabel();
069:
070: setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
071: org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application
072: .getInstance(documenteditor.DocumentEditorApp.class)
073: .getContext().getResourceMap(
074: DocumentEditorAboutBox.class);
075: setTitle(resourceMap.getString("title")); // NOI18N
076: setModal(true);
077: setName("aboutBox"); // NOI18N
078: setResizable(false);
079:
080: javax.swing.ActionMap actionMap = org.jdesktop.application.Application
081: .getInstance(documenteditor.DocumentEditorApp.class)
082: .getContext().getActionMap(
083: DocumentEditorAboutBox.class, this );
084: closeButton.setAction(actionMap.get("closeAboutBox")); // NOI18N
085:
086: appTitleLabel.setFont(appTitleLabel.getFont()
087: .deriveFont(
088: appTitleLabel.getFont().getStyle()
089: | java.awt.Font.BOLD,
090: appTitleLabel.getFont().getSize() + 4));
091: appTitleLabel.setText(resourceMap
092: .getString("Application.title")); // NOI18N
093:
094: versionLabel
095: .setFont(versionLabel.getFont().deriveFont(
096: versionLabel.getFont().getStyle()
097: | java.awt.Font.BOLD));
098: versionLabel
099: .setText(resourceMap.getString("versionLabel.text")); // NOI18N
100:
101: appVersionLabel.setText(resourceMap
102: .getString("Application.version")); // NOI18N
103:
104: vendorLabel.setFont(vendorLabel.getFont().deriveFont(
105: vendorLabel.getFont().getStyle() | java.awt.Font.BOLD));
106: vendorLabel.setText(resourceMap.getString("vendorLabel.text")); // NOI18N
107:
108: appVendorLabel.setText(resourceMap
109: .getString("Application.vendor")); // NOI18N
110:
111: homepageLabel.setFont(homepageLabel.getFont()
112: .deriveFont(
113: homepageLabel.getFont().getStyle()
114: | java.awt.Font.BOLD));
115: homepageLabel.setText(resourceMap
116: .getString("homepageLabel.text")); // NOI18N
117:
118: appHomepageLabel.setText(resourceMap
119: .getString("Application.homepage")); // NOI18N
120:
121: appDescLabel
122: .setText(resourceMap.getString("appDescLabel.text")); // NOI18N
123:
124: imageLabel.setIcon(resourceMap.getIcon("imageLabel.icon")); // NOI18N
125:
126: org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(
127: getContentPane());
128: getContentPane().setLayout(layout);
129: layout
130: .setHorizontalGroup(layout
131: .createParallelGroup(
132: org.jdesktop.layout.GroupLayout.LEADING)
133: .add(
134: layout
135: .createSequentialGroup()
136: .add(imageLabel)
137: .add(18, 18, 18)
138: .add(
139: layout
140: .createParallelGroup(
141: org.jdesktop.layout.GroupLayout.TRAILING)
142: .add(
143: org.jdesktop.layout.GroupLayout.LEADING,
144: layout
145: .createSequentialGroup()
146: .add(
147: layout
148: .createParallelGroup(
149: org.jdesktop.layout.GroupLayout.LEADING)
150: .add(
151: versionLabel)
152: .add(
153: vendorLabel)
154: .add(
155: homepageLabel))
156: .addPreferredGap(
157: org.jdesktop.layout.LayoutStyle.RELATED)
158: .add(
159: layout
160: .createParallelGroup(
161: org.jdesktop.layout.GroupLayout.LEADING)
162: .add(
163: appVersionLabel)
164: .add(
165: appVendorLabel)
166: .add(
167: appHomepageLabel)))
168: .add(
169: org.jdesktop.layout.GroupLayout.LEADING,
170: appTitleLabel)
171: .add(
172: org.jdesktop.layout.GroupLayout.LEADING,
173: appDescLabel,
174: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
175: 266,
176: Short.MAX_VALUE)
177: .add(
178: closeButton))
179: .addContainerGap()));
180: layout
181: .setVerticalGroup(layout
182: .createParallelGroup(
183: org.jdesktop.layout.GroupLayout.LEADING)
184: .add(
185: imageLabel,
186: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
187: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
188: Short.MAX_VALUE)
189: .add(
190: layout
191: .createSequentialGroup()
192: .addContainerGap()
193: .add(appTitleLabel)
194: .addPreferredGap(
195: org.jdesktop.layout.LayoutStyle.RELATED)
196: .add(appDescLabel)
197: .addPreferredGap(
198: org.jdesktop.layout.LayoutStyle.RELATED)
199: .add(
200: layout
201: .createParallelGroup(
202: org.jdesktop.layout.GroupLayout.BASELINE)
203: .add(
204: versionLabel)
205: .add(
206: appVersionLabel))
207: .addPreferredGap(
208: org.jdesktop.layout.LayoutStyle.RELATED)
209: .add(
210: layout
211: .createParallelGroup(
212: org.jdesktop.layout.GroupLayout.BASELINE)
213: .add(
214: vendorLabel)
215: .add(
216: appVendorLabel))
217: .addPreferredGap(
218: org.jdesktop.layout.LayoutStyle.RELATED)
219: .add(
220: layout
221: .createParallelGroup(
222: org.jdesktop.layout.GroupLayout.BASELINE)
223: .add(
224: homepageLabel)
225: .add(
226: appHomepageLabel))
227: .add(19, 19, Short.MAX_VALUE)
228: .add(closeButton)
229: .addContainerGap()));
230:
231: pack();
232: }// </editor-fold>//GEN-END:initComponents
233:
234: // Variables declaration - do not modify//GEN-BEGIN:variables
235: private javax.swing.JButton closeButton;
236: // End of variables declaration//GEN-END:variables
237:
238: }
|