Search in sources :

Example 86 with Box

use of javax.swing.Box in project knime-core by knime.

the class ScatterSettingsDialog method createBoxes.

/**
 * @param cont
 * @param okButton
 * @param cancelButton
 */
private void createBoxes(final Container cont, final JButton okButton, final JButton cancelButton) {
    // arrange them
    Box infoBox = Box.createHorizontalBox();
    Box iBox = Box.createVerticalBox();
    iBox.add(new JLabel("To change the set of displayed data rows"));
    iBox.add(new JLabel("please open the node's dialog and re-execute."));
    infoBox.add(Box.createGlue());
    infoBox.add(iBox);
    infoBox.add(Box.createGlue());
    Box xBox = Box.createHorizontalBox();
    xBox.add(Box.createGlue());
    xBox.add(m_xColName);
    xBox.add(Box.createHorizontalStrut(10));
    xBox.add(new JLabel("X Range from"));
    xBox.add(Box.createHorizontalStrut(2));
    Box xminBox = Box.createVerticalBox();
    xminBox.add(Box.createHorizontalStrut(50));
    xminBox.add(m_xMin);
    xBox.add(xminBox);
    xBox.add(Box.createHorizontalStrut(2));
    xBox.add(new JLabel("to"));
    xBox.add(Box.createHorizontalStrut(2));
    Box xmaxBox = Box.createVerticalBox();
    xmaxBox.add(Box.createHorizontalStrut(50));
    xmaxBox.add(m_xMax);
    xBox.add(xmaxBox);
    Box yBox = Box.createHorizontalBox();
    yBox.add(Box.createGlue());
    yBox.add(m_yColName);
    yBox.add(Box.createHorizontalStrut(10));
    yBox.add(new JLabel("Y Range from"));
    yBox.add(Box.createHorizontalStrut(2));
    Box yminBox = Box.createVerticalBox();
    yminBox.add(Box.createHorizontalStrut(50));
    yminBox.add(m_yMin);
    yBox.add(yminBox);
    yBox.add(Box.createHorizontalStrut(2));
    yBox.add(new JLabel("to"));
    yBox.add(Box.createHorizontalStrut(2));
    Box ymaxBox = Box.createVerticalBox();
    ymaxBox.add(Box.createHorizontalStrut(50));
    ymaxBox.add(m_yMax);
    yBox.add(ymaxBox);
    Box sizeBox = Box.createHorizontalBox();
    sizeBox.add(Box.createHorizontalStrut(20));
    sizeBox.add(new JLabel("Dot size:"));
    sizeBox.add(Box.createHorizontalStrut(2));
    sizeBox.add(m_dotSize);
    sizeBox.add(Box.createGlue());
    sizeBox.add(Box.createGlue());
    Box byeBox = Box.createHorizontalBox();
    byeBox.add(Box.createGlue());
    byeBox.add(Box.createGlue());
    byeBox.add(okButton);
    byeBox.add(cancelButton);
    JPanel rangePanel = new JPanel();
    rangePanel.setLayout(new BoxLayout(rangePanel, BoxLayout.Y_AXIS));
    rangePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Range Settings"));
    rangePanel.add(xBox);
    rangePanel.add(yBox);
    // add them to the dialog
    cont.add(infoBox);
    cont.add(rangePanel);
    cont.add(sizeBox);
    cont.add(byeBox);
}
Also used : JPanel(javax.swing.JPanel) BoxLayout(javax.swing.BoxLayout) JLabel(javax.swing.JLabel) Box(javax.swing.Box)

Example 87 with Box

use of javax.swing.Box in project vcell by virtualcell.

the class Wizard method initComponents.

/**
 * This method initializes the components for the wizard dialog: it creates a JDialog
 * as a CardLayout panel , as well as three buttons at the bottom.
 */
private void initComponents() {
    wizardModel.addPropertyChangeListener(this);
    wizardController = new WizardController(this);
    wizardDialog.getContentPane().setLayout(new BorderLayout());
    wizardDialog.addWindowListener(this);
    // Create the outer wizard panel, which is responsible for three buttons:
    // Next, Back, and Cancel. It is also responsible a JPanel above them that
    // uses a CardLayout layout manager to display multiple panels in the
    // same spot.
    JPanel buttonPanel = new JPanel();
    JSeparator separator = new JSeparator();
    Box buttonBox = new Box(BoxLayout.X_AXIS);
    cardPanel = new JPanel();
    cardPanel.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10)));
    cardLayout = new CardLayout();
    cardPanel.setLayout(cardLayout);
    backButton = new JButton();
    nextButton = new JButton();
    cancelButton = new JButton();
    backButton.setActionCommand(BACK_BUTTON_ACTION_COMMAND);
    nextButton.setActionCommand(NEXT_BUTTON_ACTION_COMMAND);
    cancelButton.setActionCommand(CANCEL_BUTTON_ACTION_COMMAND);
    backButton.addActionListener(wizardController);
    nextButton.addActionListener(wizardController);
    cancelButton.addActionListener(wizardController);
    // Create the buttons with a separator above them, then put them
    // on the east side of the panel with a small amount of space between
    // the back and the next button, and a larger amount of space between
    // the next button and the cancel button.
    buttonPanel.setLayout(new BorderLayout());
    buttonPanel.add(separator, BorderLayout.NORTH);
    buttonBox.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10)));
    buttonBox.add(backButton);
    buttonBox.add(Box.createHorizontalStrut(10));
    buttonBox.add(nextButton);
    buttonBox.add(Box.createHorizontalStrut(30));
    buttonBox.add(cancelButton);
    buttonPanel.add(buttonBox, java.awt.BorderLayout.EAST);
    wizardDialog.getContentPane().add(buttonPanel, java.awt.BorderLayout.SOUTH);
    wizardDialog.getContentPane().add(cardPanel, java.awt.BorderLayout.CENTER);
}
Also used : JPanel(javax.swing.JPanel) CardLayout(java.awt.CardLayout) Insets(java.awt.Insets) BorderLayout(java.awt.BorderLayout) JButton(javax.swing.JButton) Box(javax.swing.Box) EmptyBorder(javax.swing.border.EmptyBorder) JSeparator(javax.swing.JSeparator)

Example 88 with Box

use of javax.swing.Box in project vcell by virtualcell.

the class ServerManageConsole method getConfigPage.

/**
 * Return the ServicePage property value.
 * @return javax.swing.JPanel
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JPanel getConfigPage() {
    if (ivjConfigPage == null) {
        try {
            ivjConfigPage = new javax.swing.JPanel();
            ivjConfigPage.setName("ConfigurationPage");
            ivjConfigPage.setLayout(new BorderLayout());
            JPanel panel = new JPanel();
            panel.setLayout(new FlowLayout(FlowLayout.LEFT));
            JLabel label = new JLabel("Total services : ");
            label.setForeground(Color.red);
            panel.add(label);
            panel.add(getNumConfigsLabel());
            ivjConfigPage.add(panel, "North");
            ivjConfigPage.add(getConfigTable().getEnclosingScrollPane(), "Center");
            Box box = Box.createHorizontalBox();
            box.add(Box.createHorizontalGlue());
            box.add(getNewServiceButton());
            box.add(getModifyServiceButton());
            box.add(getDeleteServiceButton());
            box.add(Box.createHorizontalGlue());
            box.add(getRefreshServerManagerButton());
            ivjConfigPage.add(box, "South");
        // user code begin {1}
        // user code end
        } catch (java.lang.Throwable ivjExc) {
            // user code begin {2}
            // user code end
            handleException(ivjExc);
        }
    }
    return ivjConfigPage;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) JLabel(javax.swing.JLabel) Box(javax.swing.Box) JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel)

Example 89 with Box

use of javax.swing.Box in project vcell by virtualcell.

the class ServerManageConsole method getJFrameContentPane.

/**
 * Return the JFrameContentPane property value.
 * @return javax.swing.JPanel
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JPanel getJFrameContentPane() {
    if (ivjJFrameContentPane == null) {
        try {
            ivjJFrameContentPane = new javax.swing.JPanel();
            ivjJFrameContentPane.setName("JFrameContentPane");
            ivjJFrameContentPane.setLayout(new java.awt.BorderLayout());
            getJFrameContentPane().add(getTabbedPane(), "Center");
            JPanel panel = new javax.swing.JPanel();
            panel.setLayout(new FlowLayout(FlowLayout.LEFT));
            panel.add(getExitButton());
            panel.add(getRefreshButton(), getRefreshButton().getName());
            final JLabel timeLabel = new JLabel("      ");
            timeLabel.setFont(new Font(timeLabel.getFont().getName(), Font.BOLD, timeLabel.getFont().getSize()));
            Box box = Box.createHorizontalBox();
            box.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(), BorderFactory.createLoweredBevelBorder()));
            box.add(panel);
            box.add(Box.createHorizontalGlue());
            box.add(timeLabel);
            box.add(Box.createHorizontalGlue());
            box.add(getProgressBar());
            final DateFormat df = new SimpleDateFormat("HH:mm:ss    EEEE    MMM dd, yyyy");
            new Timer(1000, new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    timeLabel.setText(df.format(new Date()));
                }
            }).start();
            getJFrameContentPane().add(box, "North");
        // user code begin {1}
        // user code end
        } catch (java.lang.Throwable ivjExc) {
            // user code begin {2}
            // user code end
            handleException(ivjExc);
        }
    }
    return ivjJFrameContentPane;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) ActionEvent(java.awt.event.ActionEvent) JLabel(javax.swing.JLabel) Box(javax.swing.Box) JCheckBox(javax.swing.JCheckBox) Font(java.awt.Font) Date(java.util.Date) Timer(javax.swing.Timer) ActionListener(java.awt.event.ActionListener) DateFormat(java.text.DateFormat) SimpleDateFormat(java.text.SimpleDateFormat) BorderLayout(java.awt.BorderLayout) SimpleDateFormat(java.text.SimpleDateFormat) JPanel(javax.swing.JPanel)

Example 90 with Box

use of javax.swing.Box in project processdash by dtuma.

the class TimeCardDialog method buildTopPanel.

private Component buildTopPanel() {
    Box result = Box.createHorizontalBox();
    result.add(new JLabel(resources.getString("Time_Card.Month_Label") + " "));
    // We have to build our own month name array because the "official"
    // one contains 13 month names, the last one empty for Gregorian
    // Calendars
    String[] monthNames = new String[12];
    String[] officialMonthNames = (new DateFormatSymbols()).getMonths();
    for (int i = 12; i-- > 0; ) monthNames[i] = officialMonthNames[i];
    monthField = new JComboBox(monthNames);
    dontGrow(monthField);
    monthField.setSelectedIndex(model.getMonth() - Calendar.JANUARY);
    monthField.setMaximumRowCount(12);
    result.add(monthField);
    monthField.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            recalc();
        }
    });
    yearField = new JTextField(5);
    dontGrow(yearField);
    yearField.setText(Integer.toString(model.getYear()));
    result.add(yearField);
    yearField.getDocument().addDocumentListener(new DocumentListener() {

        public void insertUpdate(DocumentEvent e) {
            recalc();
        }

        public void removeUpdate(DocumentEvent e) {
            recalc();
        }

        public void changedUpdate(DocumentEvent e) {
            recalc();
        }
    });
    result.add(Box.createHorizontalGlue());
    result.add(new JLabel(resources.getString("Time_Format.Label") + " "));
    formatType = new JComboBox();
    formatType.addItem(format(75, HOURS_MINUTES));
    formatType.addItem(format(75, HOURS));
    formatType.addItem(format(75, MINUTES));
    dontGrow(formatType);
    result.add(formatType);
    formatType.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            redraw();
        }
    });
    result.add(Box.createHorizontalGlue());
    hideColumns = new JCheckBox();
    result.add(new JLabel(" " + resources.getString("Time_Card.Hide_Empty_Columns_Label") + " "));
    result.add(hideColumns);
    hideColumns.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            resizeColumns();
        }
    });
    result.add(Box.createHorizontalGlue());
    JButton closeButton = new JButton(resources.getString("Close"));
    dontGrow(closeButton);
    result.add(Box.createVerticalStrut(closeButton.getPreferredSize().height + 4));
    result.add(closeButton);
    closeButton.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            frame.setVisible(false);
        }
    });
    return result;
}
Also used : DocumentListener(javax.swing.event.DocumentListener) JComboBox(javax.swing.JComboBox) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) JComboBox(javax.swing.JComboBox) Box(javax.swing.Box) JCheckBox(javax.swing.JCheckBox) JTextField(javax.swing.JTextField) DocumentEvent(javax.swing.event.DocumentEvent) JCheckBox(javax.swing.JCheckBox) ActionListener(java.awt.event.ActionListener) DateFormatSymbols(java.text.DateFormatSymbols)

Aggregations

Box (javax.swing.Box)192 JCheckBox (javax.swing.JCheckBox)95 JLabel (javax.swing.JLabel)93 JPanel (javax.swing.JPanel)87 Dimension (java.awt.Dimension)65 BorderLayout (java.awt.BorderLayout)51 JButton (javax.swing.JButton)48 JComboBox (javax.swing.JComboBox)46 JScrollPane (javax.swing.JScrollPane)42 BoxLayout (javax.swing.BoxLayout)38 ActionEvent (java.awt.event.ActionEvent)31 ActionListener (java.awt.event.ActionListener)28 JTextField (javax.swing.JTextField)25 EmptyBorder (javax.swing.border.EmptyBorder)19 Insets (java.awt.Insets)17 SearchFilterPanel (pcgen.gui2.filter.SearchFilterPanel)14 FlippingSplitPane (pcgen.gui2.tools.FlippingSplitPane)14 TitledBorder (javax.swing.border.TitledBorder)13 FilterBar (pcgen.gui2.filter.FilterBar)13 GridBagConstraints (java.awt.GridBagConstraints)12