Logo Search packages:      
Sourcecode: pcalendar version File versions  Download package

net::sf::linuxorg::pcal::bbtgui::PCaBBTDialog::PCaBBTDialog (  ) [inline]

Create the dialog with initial layout

Definition at line 72 of file PCaBBTDialog.java.

References net::sf::linuxorg::pcal::MainWindow::createResoruceIcon(), net::sf::linuxorg::pcal::bbtgui::BBTPrefsWidget::getBBTPreferences(), net::sf::linuxorg::pcal::bbtgui::BBTWidget::getBBTWidget(), net::sf::linuxorg::pcal::MainWindow::getFrame(), and net::sf::linuxorg::pcal::MainWindow::loadFrameBounds().

                            {
            super(PCalendar.mainWindow.getFrame(), Messages.getString("PCaBBTDialog.0"), true);  //$NON-NLS-1$

            addWindowListener(new WindowAdapter() {
                  @Override
                  public void windowClosing(WindowEvent we) {
                        actionPerformed(null);
                  }
            });

            setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);

            setLayout(new GridBagLayout());
            GridBagConstraints c = new GridBagConstraints();

            // OK Button
            JButton b = new JButton(
                        Messages.getString("PCaBBTDialog.1"), MainWindow.createResoruceIcon("16x16/ok.png"));   //$NON-NLS-1$//$NON-NLS-2$
            b.addActionListener(this);
            c.anchor = GridBagConstraints.EAST;
            c.gridx = 1;
            c.gridy = 1;
            c.gridwidth = 1;        
            c.insets.top = 5;
            c.insets.right = 5;
            c.insets.bottom = 5;
            add(b, c);
            JRootPane rootPane = getRootPane();
            rootPane.setDefaultButton(b);

            tabbedPane = new JTabbedPane();
                        
            c.weightx = 1.0;
            c.weighty = 1.0;
            c.fill = GridBagConstraints.BOTH;
            c.gridx = 0;
            c.gridy = 0;
            c.gridwidth = 2;
            c.insets.right = 0;

            add(tabbedPane, c);
            
            // the colors legend
            JPanel p = new JPanel(new GridLayout(2, 4, 5, 1));
            for(int i=0; i<legendLabels.length; i++) {
                  legendLabels[i].setOpaque(true);
                  p.add(legendLabels[i]);
            }
            
            c.weightx = 1.0;
            c.weighty = 0.0;
            c.fill = GridBagConstraints.BOTH;
            c.gridx = 0;
            c.gridy = 1;
            c.gridwidth = 1;
            c.insets.left = 5;
            c.insets.top = 2;
            c.insets.right = 10;
            c.insets.bottom = 2;
            add(p, c);

            bbtPrefsWidget = new BBTPrefsWidget();
            bbtWidget = new BBTWidget();
            
            tabbedPane.addTab(Messages.getString("PCaBBTDialog.2"), bbtWidget.getBBTWidget()); //$NON-NLS-1$
            tabbedPane.setMnemonicAt(0, KeyEvent.VK_D);
            tabbedPane.addTab(Messages.getString("PCaBBTDialog.3"), bbtPrefsWidget.getBBTPreferences()); //$NON-NLS-1$
            tabbedPane.setMnemonicAt(1, KeyEvent.VK_P);
            
            tabbedPane.addChangeListener(getTabChangeListener());

            pack();

            // Restore the frame position and size
            final Rectangle DEFAULT_BOUNDS = new Rectangle(200, 200, 380, 450);           
            Rectangle bounds = MainWindow.loadFrameBounds(BBTWINDOW, DEFAULT_BOUNDS); 
            setBounds(bounds);

            // load the preferences splitter position
            Preferences windowPrefsNode = PCalendar.settings.node(BBTWINDOW); //$NON-NLS-1$
            bbtPrefsWidget.prefsSplitPane.setDividerLocation(windowPrefsNode.getInt(SPLITTER_POS, 150)); //$NON-NLS-1$

      }

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index