001: /*
002: * $RCSfile: VAIBuilderFrame.java,v $
003: * @modification $Date: 2001/09/28 19:35:30 $
004: * @version $Id: VAIBuilderFrame.java,v 1.1 2001/09/28 19:35:30 hfalk Exp $
005: *
006: */
007:
008: package com.memoire.vainstall.builder.gui;
009:
010: import com.memoire.vainstall.VAGlobals;
011:
012: import java.awt.*;
013:
014: import javax.swing.*;
015: import javax.swing.border.*;
016: import javax.swing.event.*;
017: import javax.swing.tree.*;
018:
019: /**
020: * This is the builder main window
021: *
022: * @see javax.swing.JFrame
023: *
024: * @author Henrik Falk
025: * @version $Id: VAIBuilderFrame.java,v 1.1 2001/09/28 19:35:30 hfalk Exp $
026: */
027: public class VAIBuilderFrame extends JFrame {
028:
029: private final static Border loweredBorder = new SoftBevelBorder(
030: BevelBorder.LOWERED);
031: private final static Border raisedBorder = new SoftBevelBorder(
032: BevelBorder.RAISED);
033:
034: JPanel allPanel;
035:
036: JDesktopPane paneJDesktopPane = null;
037:
038: JLabel informationLabel = new JLabel();
039:
040: public VAIBuilderFrame() {
041: super ("");
042:
043: setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
044:
045: // create the all panel
046: allPanel = new JPanel(new BorderLayout());
047:
048: allPanel.add(getDesktopPane(), BorderLayout.CENTER);
049:
050: GridBagLayout informationLayout = new GridBagLayout();
051: GridBagConstraints informationContraint = new GridBagConstraints();
052:
053: JPanel informationPanel = new JPanel();
054: informationPanel.setLayout(informationLayout);
055: informationPanel.setBackground(Color.lightGray);
056: informationPanel.setBorder(raisedBorder);
057:
058: informationLabel.setBorder(loweredBorder);
059: informationContraint.fill = GridBagConstraints.HORIZONTAL;
060: informationContraint.anchor = GridBagConstraints.WEST;
061: informationContraint.gridx = 0;
062: informationContraint.gridy = 0;
063: informationContraint.gridwidth = 3;
064: informationContraint.gridheight = 1;
065: informationContraint.weightx = 1;
066: informationContraint.weighty = 0;
067: informationLayout.setConstraints(informationLabel,
068: informationContraint);
069: informationPanel.add(informationLabel);
070:
071: // add to main panel
072: allPanel.add(informationPanel, BorderLayout.SOUTH);
073:
074: // insert the all panel into the application frame window
075: this .getContentPane().add("Center", allPanel);
076:
077: }
078:
079: public void center() {
080: Dimension dimScreen = Toolkit.getDefaultToolkit()
081: .getScreenSize();
082: setLocation((dimScreen.width - this .getSize().width) / 2,
083: (dimScreen.height - this .getSize().height) / 2);
084: }
085:
086: public JLabel getInformationLabel() {
087: return informationLabel;
088: }
089:
090: public JDesktopPane getDesktopPane() {
091:
092: if (paneJDesktopPane == null) {
093: paneJDesktopPane = new JDesktopPane();
094: paneJDesktopPane.setBackground(Color.lightGray);
095: }
096: return paneJDesktopPane;
097: }
098:
099: public void setJToolBar(JToolBar toolBar) {
100:
101: JPanel toolBarPanel = new JPanel();
102: toolBarPanel.setLayout(new BoxLayout(toolBarPanel,
103: BoxLayout.X_AXIS));
104: toolBarPanel.add(Box.createRigidArea(new Dimension(10, 10)));
105: toolBarPanel.setBackground(Color.lightGray);
106: toolBarPanel.setBorder(raisedBorder);
107: toolBarPanel.add("Center", toolBar);
108:
109: // add to main panel
110: allPanel.add(toolBarPanel, BorderLayout.NORTH);
111: }
112: }
|