001: package com.silvermindsoftware.hitch.sample;
002:
003: /**
004: * Copyright 2007 Brandon Goodin
005: *
006: * Licensed under the Apache License, Version 2.0 (the "License");
007: * you may not use this file except in compliance with the License.
008: * You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: */
018:
019: import java.awt.*;
020: import java.awt.event.*;
021: import javax.swing.*;
022:
023: /**
024: * @author Brandon Goodin
025: */
026: public class Main extends JFrame {
027: public Main() {
028: initComponents();
029: setVisible(true);
030: }
031:
032: private void annotationExampleActionPerformed() {
033: this .getContentPane().add(new PersonAnnotationFormPanel(),
034: BorderLayout.CENTER, 0);
035: validate();
036: }
037:
038: private void binderExampleActionPerformed() {
039: this .getContentPane().add(new PersonBinderConfigFormPanel(),
040: BorderLayout.CENTER, 0);
041: validate();
042: }
043:
044: private void emptyAnnotationExampleActionPerformed() {
045: this .getContentPane().add(new EmptyPersonAnnotationFormPanel(),
046: BorderLayout.CENTER, 0);
047: validate();
048: }
049:
050: private void emptyBinderExampleActionPerformed() {
051: this .getContentPane().add(
052: new EmptyPersonBinderConfigFormPanel(),
053: BorderLayout.CENTER, 0);
054: validate();
055: }
056:
057: private void initComponents() {
058: // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
059: appMenuBar = new JMenuBar();
060: sampleApps = new JMenu();
061: annotationExample = new JMenuItem();
062: emptyAnnotationExample = new JMenuItem();
063: binderExample = new JMenuItem();
064: emptyBinderExample = new JMenuItem();
065:
066: //======== this ========
067: Container contentPane = getContentPane();
068: contentPane.setLayout(new BorderLayout());
069:
070: //======== appMenuBar ========
071: {
072:
073: //======== sampleApps ========
074: {
075: sampleApps.setText("Sample Apps");
076:
077: //---- annotationExample ----
078: annotationExample.setText("Annotation Example");
079: annotationExample
080: .addActionListener(new ActionListener() {
081: public void actionPerformed(ActionEvent e) {
082: annotationExampleActionPerformed();
083: }
084: });
085: sampleApps.add(annotationExample);
086:
087: //---- emptyAnnotationExample ----
088: emptyAnnotationExample
089: .setText("Empty Annotation Example");
090: emptyAnnotationExample
091: .addActionListener(new ActionListener() {
092: public void actionPerformed(ActionEvent e) {
093: emptyAnnotationExampleActionPerformed();
094: }
095: });
096: sampleApps.add(emptyAnnotationExample);
097:
098: //---- binderExample ----
099: binderExample.setText("Binder Example");
100: binderExample.addActionListener(new ActionListener() {
101: public void actionPerformed(ActionEvent e) {
102: binderExampleActionPerformed();
103: }
104: });
105: sampleApps.add(binderExample);
106:
107: //---- emptyBinderExample ----
108: emptyBinderExample.setText("Empty Binder Example");
109: emptyBinderExample
110: .addActionListener(new ActionListener() {
111: public void actionPerformed(ActionEvent e) {
112: emptyBinderExampleActionPerformed();
113: }
114: });
115: sampleApps.add(emptyBinderExample);
116: }
117: appMenuBar.add(sampleApps);
118: }
119: setJMenuBar(appMenuBar);
120: setSize(800, 600);
121: setLocationRelativeTo(null);
122: // JFormDesigner - End of component initialization //GEN-END:initComponents
123: }
124:
125: // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
126: private JMenuBar appMenuBar;
127: private JMenu sampleApps;
128: private JMenuItem annotationExample;
129: private JMenuItem emptyAnnotationExample;
130: private JMenuItem binderExample;
131: private JMenuItem emptyBinderExample;
132:
133: // JFormDesigner - End of variables declaration //GEN-END:variables
134:
135: public static void main(String[] args) {
136: SwingUtilities.invokeLater(new Runnable() {
137: public void run() {
138: new Main();
139: }
140: });
141: }
142: }
|