Example usage for java.awt GridBagConstraints WEST

List of usage examples for java.awt GridBagConstraints WEST

Introduction

In this page you can find the example usage for java.awt GridBagConstraints WEST.

Prototype

int WEST

To view the source code for java.awt GridBagConstraints WEST.

Click Source Link

Document

Put the component on the left side of its display area, centered vertically.

Usage

From source file:org.pentaho.reporting.designer.extensions.pentaho.repository.dialogs.RepositoryOpenDialog.java

protected JPanel createLocationFieldPanel() {
    final GridBagConstraints c = new GridBagConstraints();
    final JPanel locationFieldPanel = new JPanel();
    locationFieldPanel.setLayout(new GridBagLayout());
    c.insets = new Insets(0, 5, 5, 0);
    c.gridx = 0;/* ww  w  .  java  2 s .co m*/
    c.gridy = 0;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1.0;
    c.anchor = GridBagConstraints.WEST;
    locationFieldPanel.add(locationCombo, c);

    c.insets = new Insets(5, 8, 5, 0);
    c.gridx = 1;
    c.gridy = 0;
    c.fill = GridBagConstraints.NONE;
    c.weightx = 0.0;
    c.anchor = GridBagConstraints.WEST;
    locationFieldPanel.add(new BorderlessButton(new LevelUpAction()), c);

    c.gridx = 2;
    c.gridy = 0;
    c.fill = GridBagConstraints.NONE;
    c.weightx = 0.0;
    c.anchor = GridBagConstraints.EAST;
    locationFieldPanel.add(new BorderlessButton(new BrowseRepositoryAction()), c);
    return locationFieldPanel;
}

From source file:net.sourceforge.squirrel_sql.client.preferences.UpdatePreferencesPanel.java

private JPanel createAutoUpdatePanel() {
    JPanel pnl = new JPanel(new GridBagLayout());
    pnl.setBorder(BorderFactory.createTitledBorder(i18n.AUTO_BORDER_LABEL));

    final GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(4, 4, 4, 4);
    gbc.gridx = 0;//  w w  w  . j  a v  a  2 s .  c om
    gbc.gridy = 0;
    gbc.gridwidth = 2;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    pnl.add(_enableAutoUpdateChk, gbc);

    gbc.gridwidth = 1;

    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.weightx = 0;
    gbc.insets = new Insets(4, 20, 4, 10);
    pnl.add(new JLabel(i18n.AUTO_CHECK_FREQUENCY, JLabel.LEFT), gbc);

    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.weightx = 1;
    gbc.insets = new Insets(4, 0, 4, 0);
    gbc.fill = GridBagConstraints.NONE;
    pnl.add(this._updateCheckFrequency, gbc);

    return pnl;
}

From source file:com.microsoft.azure.hdinsight.spark.ui.SparkSubmissionContentPanel.java

private void addMainClassNameLineItem() {
    JLabel sparkMainClassLabel = new JLabel("Main class name");
    sparkMainClassLabel.setToolTipText("Application's java/spark main class");
    GridBagConstraints c31 = new GridBagConstraints();
    c31.gridx = 0;/*from  w  w w.j a va2s.  co m*/
    c31.gridy = 2;
    c31.insets = new Insets(margin, margin, margin, margin);
    add(sparkMainClassLabel, new GridBagConstraints(0, ++displayLayoutCurrentRow, 1, 1, 1, 0,
            GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(margin, margin, 0, 0), 0, 0));

    mainClassTextField = new TextFieldWithBrowseButton();
    mainClassTextField.setToolTipText("Application's java/spark main class");
    ManifestFileUtil.setupMainClassField(submitModel.getProject(), mainClassTextField);

    add(mainClassTextField,
            new GridBagConstraints(1, displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST,
                    GridBagConstraints.HORIZONTAL, new Insets(margin, margin, 0, margin), 0, 0));

    errorMessageLabels[ErrorMessageLabelTag.MainClass.ordinal()] = new JLabel(
            "Main Class Name should not be null");
    errorMessageLabels[ErrorMessageLabelTag.MainClass.ordinal()]
            .setForeground(DarkThemeManager.getInstance().getErrorMessageColor());
    errorMessageLabels[ErrorMessageLabelTag.MainClass.ordinal()].setVisible(true);

    mainClassTextField.getTextField().getDocument().addDocumentListener(new DocumentListener() {
        @Override
        public void insertUpdate(DocumentEvent e) {
            setVisibleForFixedErrorMessageLabel(3, e.getDocument().getLength() == 0);
        }

        @Override
        public void removeUpdate(DocumentEvent e) {
            setVisibleForFixedErrorMessageLabel(3, e.getDocument().getLength() == 0);
        }

        @Override
        public void changedUpdate(DocumentEvent e) {
        }
    });

    add(errorMessageLabels[ErrorMessageLabelTag.MainClass.ordinal()],
            new GridBagConstraints(1, ++displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST,
                    GridBagConstraints.HORIZONTAL, new Insets(0, margin, 0, margin), 0, 0));
}

From source file:org.jets3t.apps.cockpitlite.CockpitLite.java

/**
 * Initialises the application's GUI elements.
 *//* w ww  .  j a v  a2  s  .  c  o m*/
private void initGui() {
    // Initialise skins factory.
    skinsFactory = SkinsFactory.getInstance(cockpitLiteProperties.getProperties());

    // Set Skinned Look and Feel.
    LookAndFeel lookAndFeel = skinsFactory.createSkinnedMetalTheme("SkinnedLookAndFeel");
    try {
        UIManager.setLookAndFeel(lookAndFeel);
    } catch (UnsupportedLookAndFeelException e) {
        log.error("Unable to set skinned LookAndFeel", e);
    }

    // Primary panel that contains all other items.
    JPanel primaryPanel = skinsFactory.createSkinnedJPanel("PrimaryPanel");
    primaryPanel.setLayout(new GridBagLayout());
    this.getContentPane().add(primaryPanel);

    // Setup the stack panel, which contains all other panels as a stack.
    stackPanel = skinsFactory.createSkinnedJPanel("StackPanel");
    stackPanelCardLayout = new CardLayout();
    stackPanel.setLayout(stackPanelCardLayout);
    primaryPanel.add(stackPanel, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, insetsZero, 0, 0));

    // Progress notification panel
    progressNotificationPanel = skinsFactory.createSkinnedJPanel("ProgressNotificationPanel");
    progressNotificationPanel.setLayout(new GridBagLayout());
    primaryPanel.add(progressNotificationPanel, new GridBagConstraints(0, 1, 1, 1, 1, 0,
            GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 0, 5, 0), 0, 0));

    int row = 0;

    // Login panel.
    row = 0;
    loginPanel = skinsFactory.createSkinnedJPanel("LoginPanel");
    loginPanel.setLayout(new GridBagLayout());

    userInputFields = new UserInputFields(insetsDefault, null, skinsFactory);
    userInputFields.buildFieldsPanel(loginPanel, cockpitLiteProperties);

    loginButton = skinsFactory.createSkinnedJButton("LoginButton");
    loginButton.setText("Log me in");
    loginButton.addActionListener(this);
    loginPanel.add(loginButton, new GridBagConstraints(0, loginPanel.getComponentCount(), 1, 1, 0, 0,
            GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsDefault, 0, 0));

    // Filter panel.
    filterObjectsPanel = skinsFactory.createSkinnedJPanel("FilterPanel");
    filterObjectsPanel.setLayout(new GridBagLayout());
    filterObjectsPrefix = skinsFactory.createSkinnedJTextField("FilterPrefix");
    filterObjectsPrefix.setToolTipText("Only show files starting with this string");
    filterObjectsPrefix.addActionListener(this);
    filterObjectsPrefix.setActionCommand("RefreshObjects");
    JLabel filterPrefixLabel = skinsFactory.createSkinnedJHtmlLabel("FilterPrefixLable", this);
    filterPrefixLabel.setText("File name starts with: ");
    filterObjectsPanel.add(filterPrefixLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST,
            GridBagConstraints.NONE, insetsZero, 0, 0));
    filterObjectsPanel.add(filterObjectsPrefix, new GridBagConstraints(1, 0, 1, 1, 1, 0,
            GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
    filterObjectsPanel.setVisible(false);

    // Objects panel.
    row = 0;
    JPanel objectsPanel = skinsFactory.createSkinnedJPanel("ObjectsPanel");
    objectsPanel.setLayout(new GridBagLayout());
    filterObjectsCheckBox = skinsFactory.createSkinnedJCheckBox("FilterCheckbox");
    filterObjectsCheckBox.setText("Search files");
    filterObjectsCheckBox.setEnabled(true);
    filterObjectsCheckBox.addActionListener(this);
    filterObjectsCheckBox.setToolTipText("Check this option to search your files");
    objectsHeadingLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectsHeadingLabel", this);
    objectsHeadingLabel.setText("Not logged in");
    objectsPanel.add(objectsHeadingLabel, new GridBagConstraints(0, row, 1, 1, 1, 0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
    objectsPanel.add(filterObjectsCheckBox, new GridBagConstraints(1, row, 1, 1, 0, 0, GridBagConstraints.EAST,
            GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));

    JButton objectActionButton = skinsFactory.createSkinnedJButton("ObjectMenuButton");
    objectActionButton.setToolTipText("File actions menu");
    guiUtils.applyIcon(objectActionButton, "/images/nuvola/16x16/actions/misc.png");
    objectActionButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            JButton sourceButton = (JButton) e.getSource();
            objectActionMenu.show(sourceButton, 0, sourceButton.getHeight());
        }
    });
    objectsPanel.add(objectActionButton, new GridBagConstraints(2, row, 1, 1, 0, 0, GridBagConstraints.EAST,
            GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));

    objectsPanel.add(filterObjectsPanel, new GridBagConstraints(0, ++row, 3, 1, 0, 0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));

    objectsTable = skinsFactory.createSkinnedJTable("ObjectsTable");
    objectTableModel = new CLObjectTableModel();
    objectTableModelSorter = new TableSorter(objectTableModel);
    objectTableModelSorter.setTableHeader(objectsTable.getTableHeader());
    objectsTable.setModel(objectTableModelSorter);
    objectsTable.setDefaultRenderer(Long.class, new DefaultTableCellRenderer() {
        private static final long serialVersionUID = 7229656175879985698L;

        @Override
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                boolean hasFocus, int row, int column) {
            String formattedSize = byteFormatter.formatByteSize(((Long) value).longValue());
            return super.getTableCellRendererComponent(table, formattedSize, isSelected, hasFocus, row, column);
        }
    });
    objectsTable.setDefaultRenderer(Date.class, new DefaultTableCellRenderer() {
        private static final long serialVersionUID = -4983176028291916397L;

        @Override
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                boolean hasFocus, int row, int column) {
            Date date = (Date) value;
            return super.getTableCellRendererComponent(table, yearAndTimeSDF.format(date), isSelected, hasFocus,
                    row, column);
        }
    });
    objectsTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    objectsTable.getSelectionModel().addListSelectionListener(this);
    objectsTable.setShowHorizontalLines(true);
    objectsTable.setShowVerticalLines(true);
    objectsTable.addMouseListener(new ContextMenuListener());
    objectsTableSP = skinsFactory.createSkinnedJScrollPane("ObjectsTableSP", objectsTable);
    objectsPanel.add(objectsTableSP, new GridBagConstraints(0, ++row, 3, 1, 1, 1, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, insetsZero, 0, 0));
    objectsSummaryLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectsSummary", this);
    objectsSummaryLabel.setHorizontalAlignment(JLabel.CENTER);
    objectsSummaryLabel.setFocusable(false);
    objectsPanel.add(objectsSummaryLabel, new GridBagConstraints(0, ++row, 3, 1, 1, 0,
            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));

    // Object action menu.
    objectActionMenu = skinsFactory.createSkinnedJPopupMenu("ObjectPopupMenu");

    refreshObjectMenuItem = skinsFactory.createSkinnedJMenuItem("RefreshMenuItem");
    refreshObjectMenuItem.setText("Refresh file listing");
    refreshObjectMenuItem.setActionCommand("RefreshObjects");
    refreshObjectMenuItem.addActionListener(this);
    guiUtils.applyIcon(refreshObjectMenuItem, "/images/nuvola/16x16/actions/reload.png");
    objectActionMenu.add(refreshObjectMenuItem);

    viewObjectPropertiesMenuItem = skinsFactory.createSkinnedJMenuItem("PropertiesMenuItem");
    viewObjectPropertiesMenuItem.setText("View file properties...");
    viewObjectPropertiesMenuItem.setActionCommand("ViewObjectProperties");
    viewObjectPropertiesMenuItem.addActionListener(this);
    guiUtils.applyIcon(viewObjectPropertiesMenuItem, "/images/nuvola/16x16/actions/viewmag.png");
    objectActionMenu.add(viewObjectPropertiesMenuItem);

    downloadObjectMenuItem = skinsFactory.createSkinnedJMenuItem("DownloadMenuItem");
    downloadObjectMenuItem.setText("Download file(s)...");
    downloadObjectMenuItem.setActionCommand("DownloadObjects");
    downloadObjectMenuItem.addActionListener(this);
    guiUtils.applyIcon(downloadObjectMenuItem, "/images/nuvola/16x16/actions/1downarrow.png");
    objectActionMenu.add(downloadObjectMenuItem);

    uploadFilesMenuItem = skinsFactory.createSkinnedJMenuItem("UploadMenuItem");
    uploadFilesMenuItem.setText("Upload file(s)...");
    uploadFilesMenuItem.setActionCommand("UploadFiles");
    uploadFilesMenuItem.addActionListener(this);
    guiUtils.applyIcon(uploadFilesMenuItem, "/images/nuvola/16x16/actions/1uparrow.png");
    objectActionMenu.add(uploadFilesMenuItem);

    objectActionMenu.add(new JSeparator());

    togglePublicMenuItem = skinsFactory.createSkinnedJMenuItem("AclToggleMenuItem");
    togglePublicMenuItem.setText("Change privacy setting...");
    togglePublicMenuItem.setActionCommand("TogglePublicPrivate");
    togglePublicMenuItem.addActionListener(this);
    guiUtils.applyIcon(togglePublicMenuItem, "/images/nuvola/16x16/actions/encrypted.png");
    objectActionMenu.add(togglePublicMenuItem);

    generatePublicGetUrl = skinsFactory.createSkinnedJMenuItem("PublicUrlMenuItem");
    generatePublicGetUrl.setText("Public web link...");
    generatePublicGetUrl.setActionCommand("GeneratePublicGetURL");
    generatePublicGetUrl.addActionListener(this);
    guiUtils.applyIcon(generatePublicGetUrl, "/images/nuvola/16x16/actions/wizard.png");
    objectActionMenu.add(generatePublicGetUrl);

    objectActionMenu.add(new JSeparator());

    deleteObjectMenuItem = skinsFactory.createSkinnedJMenuItem("DeleteMenuItem");
    deleteObjectMenuItem.setText("Delete file(s)...");
    deleteObjectMenuItem.setActionCommand("DeleteObjects");
    deleteObjectMenuItem.addActionListener(this);
    guiUtils.applyIcon(deleteObjectMenuItem, "/images/nuvola/16x16/actions/cancel.png");
    objectActionMenu.add(deleteObjectMenuItem);

    viewObjectPropertiesMenuItem.setEnabled(false);
    refreshObjectMenuItem.setEnabled(false);
    togglePublicMenuItem.setEnabled(false);
    downloadObjectMenuItem.setEnabled(false);
    generatePublicGetUrl.setEnabled(false);
    deleteObjectMenuItem.setEnabled(false);

    // Card layout in stack panel
    stackPanel.add(loginPanel, "LoginPanel");
    stackPanel.add(objectsPanel, "ObjectsPanel");

    // Set preferred sizes
    int preferredWidth = 800;
    int preferredHeight = 600;
    this.setBounds(new Rectangle(new Dimension(preferredWidth, preferredHeight)));

    // Initialize drop target.
    initDropTarget(new JComponent[] { objectsPanel });
    objectsPanel.getDropTarget().setActive(true);
}

From source file:com.sec.ose.osi.ui.frm.main.identification.stringmatch.JPanStringMatchMain.java

/**
 * This method initializes jPanel2   //w w w.ja  va  2  s. com
 *    
 * @return javax.swing.JPanel   
 */
private JPanel getJPanel2() {

    if (jPanel2 == null) {
        GridBagConstraints gridBagConstraints15 = new GridBagConstraints();
        gridBagConstraints15.anchor = GridBagConstraints.WEST;
        gridBagConstraints15.gridy = 1;
        gridBagConstraints15.gridx = 0;
        GridBagConstraints gridBagConstraints14 = new GridBagConstraints();
        gridBagConstraints14.gridx = -1;
        gridBagConstraints14.gridy = -1;
        jPanel2 = new JPanel();
        jPanel2.setLayout(new GridBagLayout());
        jPanel2.add(jLabelNoticeForOpt1, gridBagConstraints14);
    }
    return jPanel2;
}

From source file:userinterface.properties.GUIGraphPicker.java

/** This method is called from within the constructor to
 * initialize the form.//from w  ww . ja v  a  2 s .  c  om
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    buttonGroup1 = new javax.swing.ButtonGroup();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    jPanel1 = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    jPanel5 = new javax.swing.JPanel();
    topComboLabel = new javax.swing.JLabel();
    jPanel6 = new javax.swing.JPanel();
    selectAxisConstantCombo = new javax.swing.JComboBox();
    jPanel7 = new javax.swing.JPanel();
    middleLabel = new javax.swing.JLabel();
    constantTablePanel = new javax.swing.JPanel();
    jPanel9 = new javax.swing.JPanel();
    jPanel10 = new javax.swing.JPanel();
    jLabel3 = new javax.swing.JLabel();
    newGraphRadio = new javax.swing.JRadioButton();
    existingGraphRadio = new javax.swing.JRadioButton();
    jPanel11 = new javax.swing.JPanel();
    existingGraphCombo = new javax.swing.JComboBox();
    jPanel12 = new javax.swing.JPanel();
    seriesNameLabel = new javax.swing.JLabel();
    seriesNameField = new javax.swing.JTextField();
    jPanel4 = new javax.swing.JPanel();
    lineOkayButton = new javax.swing.JButton();
    lineCancelButton = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();

    addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent evt) {
            closeDialog(evt);
        }
    });

    jTabbedPane1.setTabPlacement(javax.swing.JTabbedPane.LEFT);
    jPanel1.setLayout(new java.awt.BorderLayout());

    jPanel1.setBorder(new javax.swing.border.TitledBorder("Line Graph"));
    jPanel1.setFocusable(false);
    jPanel1.setEnabled(false);
    GridBagLayout gbl_jPanel3 = new GridBagLayout();
    gbl_jPanel3.rowWeights = new double[] { 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
    gbl_jPanel3.columnWeights = new double[] { 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0 };
    jPanel3.setLayout(gbl_jPanel3);

    lblPlotType = new JLabel("Plot type:");
    GridBagConstraints gbc_lblPlotType = new GridBagConstraints();
    gbc_lblPlotType.anchor = GridBagConstraints.WEST;
    gbc_lblPlotType.insets = new Insets(0, 0, 5, 5);
    gbc_lblPlotType.gridx = 1;
    gbc_lblPlotType.gridy = 0;
    jPanel3.add(lblPlotType, gbc_lblPlotType);

    panel = new JPanel();
    GridBagConstraints gbc_panel = new GridBagConstraints();
    gbc_panel.anchor = GridBagConstraints.WEST;
    gbc_panel.insets = new Insets(0, 0, 5, 5);
    gbc_panel.fill = GridBagConstraints.VERTICAL;
    gbc_panel.gridx = 3;
    gbc_panel.gridy = 0;
    jPanel3.add(panel, gbc_panel);

    plotType2d = new JRadioButton("2D");
    plotType2d.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {

            plotType2DRadioActionPerformed(e);

        }
    });
    panel.add(plotType2d);

    plotType3d = new JRadioButton("3D");
    plotType3d.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            plotType3DRadioActionPerformed(e);
        }
    });
    panel.add(plotType3d);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.insets = new Insets(0, 0, 5, 5);
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    jPanel3.add(jPanel5, gridBagConstraints);

    topComboLabel.setText("Select x axis constant:");
    gridBagConstraints_1 = new java.awt.GridBagConstraints();
    gridBagConstraints_1.insets = new Insets(0, 0, 5, 5);
    gridBagConstraints_1.gridx = 1;
    gridBagConstraints_1.gridy = 2;
    gridBagConstraints_1.anchor = java.awt.GridBagConstraints.WEST;
    jPanel3.add(topComboLabel, gridBagConstraints_1);

    gridBagConstraints_2 = new java.awt.GridBagConstraints();
    gridBagConstraints_2.insets = new Insets(0, 0, 5, 5);
    gridBagConstraints_2.gridx = 2;
    gridBagConstraints_2.gridy = 1;
    jPanel3.add(jPanel6, gridBagConstraints_2);

    selectAxisConstantCombo.setPreferredSize(new java.awt.Dimension(100, 24));
    selectAxisConstantCombo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            selectAxisConstantComboActionPerformed(evt);
        }
    });

    gridBagConstraints_3 = new java.awt.GridBagConstraints();
    gridBagConstraints_3.insets = new Insets(0, 0, 5, 5);
    gridBagConstraints_3.gridx = 3;
    gridBagConstraints_3.gridy = 2;
    gridBagConstraints_3.fill = java.awt.GridBagConstraints.HORIZONTAL;
    jPanel3.add(selectAxisConstantCombo, gridBagConstraints_3);

    gridBagConstraints_4 = new java.awt.GridBagConstraints();
    gridBagConstraints_4.insets = new Insets(0, 0, 5, 5);
    gridBagConstraints_4.gridx = 0;
    gridBagConstraints_4.gridy = 3;
    jPanel3.add(jPanel7, gridBagConstraints_4);

    lblSelectYAxis = new JLabel("Select y axis constant:");
    GridBagConstraints gbc_lblSelectYAxis = new GridBagConstraints();
    gbc_lblSelectYAxis.anchor = GridBagConstraints.WEST;
    gbc_lblSelectYAxis.insets = new Insets(0, 0, 5, 5);
    gbc_lblSelectYAxis.gridx = 1;
    gbc_lblSelectYAxis.gridy = 4;
    jPanel3.add(lblSelectYAxis, gbc_lblSelectYAxis);

    selectYaxisConstantCombo = new JComboBox();
    selectYaxisConstantCombo.setPreferredSize(new java.awt.Dimension(100, 24));
    selectYaxisConstantCombo.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            selectYAxisConstantComboActionPerformed(e);

        }
    });
    GridBagConstraints gbc_selectYaxisConstantCombo = new GridBagConstraints();
    gbc_selectYaxisConstantCombo.insets = new Insets(0, 0, 5, 5);
    gbc_selectYaxisConstantCombo.fill = GridBagConstraints.HORIZONTAL;
    gbc_selectYaxisConstantCombo.gridx = 3;
    gbc_selectYaxisConstantCombo.gridy = 4;
    jPanel3.add(selectYaxisConstantCombo, gbc_selectYaxisConstantCombo);

    panel_1 = new JPanel();
    GridBagConstraints gbc_panel_1 = new GridBagConstraints();
    gbc_panel_1.insets = new Insets(0, 0, 5, 5);
    gbc_panel_1.fill = GridBagConstraints.BOTH;
    gbc_panel_1.gridx = 1;
    gbc_panel_1.gridy = 5;
    jPanel3.add(panel_1, gbc_panel_1);

    middleLabel.setText("Define other constants:");
    gridBagConstraints_5 = new java.awt.GridBagConstraints();
    gridBagConstraints_5.insets = new Insets(0, 0, 5, 5);
    gridBagConstraints_5.gridx = 1;
    gridBagConstraints_5.gridy = 6;
    gridBagConstraints_5.anchor = java.awt.GridBagConstraints.WEST;
    jPanel3.add(middleLabel, gridBagConstraints_5);

    constantTablePanel.setLayout(new java.awt.BorderLayout());

    gridBagConstraints_6 = new java.awt.GridBagConstraints();
    gridBagConstraints_6.insets = new Insets(0, 0, 5, 5);
    gridBagConstraints_6.gridx = 3;
    gridBagConstraints_6.gridy = 6;
    gridBagConstraints_6.gridwidth = 3;
    gridBagConstraints_6.gridheight = 2;
    gridBagConstraints_6.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints_6.weightx = 1.0;
    gridBagConstraints_6.weighty = 1.0;
    jPanel3.add(constantTablePanel, gridBagConstraints_6);

    gridBagConstraints_7 = new java.awt.GridBagConstraints();
    gridBagConstraints_7.insets = new Insets(0, 0, 5, 0);
    gridBagConstraints_7.gridx = 6;
    gridBagConstraints_7.gridy = 1;
    jPanel3.add(jPanel9, gridBagConstraints_7);

    gridBagConstraints_8 = new java.awt.GridBagConstraints();
    gridBagConstraints_8.insets = new Insets(0, 0, 5, 5);
    gridBagConstraints_8.gridx = 0;
    gridBagConstraints_8.gridy = 8;
    jPanel3.add(jPanel10, gridBagConstraints_8);

    jLabel3.setText("Add Series to:");
    gridBagConstraints_9 = new java.awt.GridBagConstraints();
    gridBagConstraints_9.insets = new Insets(0, 0, 5, 5);
    gridBagConstraints_9.gridx = 1;
    gridBagConstraints_9.gridy = 9;
    gridBagConstraints_9.anchor = java.awt.GridBagConstraints.WEST;
    jPanel3.add(jLabel3, gridBagConstraints_9);

    newGraphRadio.setText("New Graph");
    buttonGroup1.add(newGraphRadio);
    newGraphRadio.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            newGraphRadioActionPerformed(evt);
        }
    });

    gridBagConstraints_10 = new java.awt.GridBagConstraints();
    gridBagConstraints_10.insets = new Insets(0, 0, 5, 5);
    gridBagConstraints_10.gridx = 3;
    gridBagConstraints_10.gridy = 9;
    gridBagConstraints_10.anchor = java.awt.GridBagConstraints.WEST;
    jPanel3.add(newGraphRadio, gridBagConstraints_10);

    existingGraphRadio.setText("Existing Graph");
    buttonGroup1.add(existingGraphRadio);
    existingGraphRadio.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            existingGraphRadioActionPerformed(evt);
        }
    });

    gridBagConstraints_11 = new java.awt.GridBagConstraints();
    gridBagConstraints_11.insets = new Insets(0, 0, 5, 5);
    gridBagConstraints_11.gridx = 3;
    gridBagConstraints_11.gridy = 10;
    gridBagConstraints_11.anchor = java.awt.GridBagConstraints.WEST;
    jPanel3.add(existingGraphRadio, gridBagConstraints_11);

    gridBagConstraints_12 = new java.awt.GridBagConstraints();
    gridBagConstraints_12.insets = new Insets(0, 0, 5, 5);
    gridBagConstraints_12.gridx = 4;
    gridBagConstraints_12.gridy = 1;
    jPanel3.add(jPanel11, gridBagConstraints_12);

    gridBagConstraints_13 = new java.awt.GridBagConstraints();
    gridBagConstraints_13.insets = new Insets(0, 0, 5, 5);
    gridBagConstraints_13.gridx = 5;
    gridBagConstraints_13.gridy = 10;
    gridBagConstraints_13.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints_13.anchor = java.awt.GridBagConstraints.WEST;
    jPanel3.add(existingGraphCombo, gridBagConstraints_13);

    gridBagConstraints_14 = new java.awt.GridBagConstraints();
    gridBagConstraints_14.insets = new Insets(0, 0, 5, 5);
    gridBagConstraints_14.gridx = 0;
    gridBagConstraints_14.gridy = 11;
    jPanel3.add(jPanel12, gridBagConstraints_14);

    seriesNameLabel.setText("Series name:");
    gridBagConstraints_15 = new java.awt.GridBagConstraints();
    gridBagConstraints_15.insets = new Insets(0, 0, 0, 5);
    gridBagConstraints_15.gridx = 1;
    gridBagConstraints_15.gridy = 12;
    gridBagConstraints_15.anchor = java.awt.GridBagConstraints.WEST;
    jPanel3.add(seriesNameLabel, gridBagConstraints_15);

    gridBagConstraints_16 = new java.awt.GridBagConstraints();
    gridBagConstraints_16.insets = new Insets(0, 0, 0, 5);
    gridBagConstraints_16.gridx = 3;
    gridBagConstraints_16.gridy = 12;
    gridBagConstraints_16.gridwidth = 3;
    gridBagConstraints_16.fill = java.awt.GridBagConstraints.HORIZONTAL;
    jPanel3.add(seriesNameField, gridBagConstraints_16);

    jPanel1.add(jPanel3, java.awt.BorderLayout.CENTER);

    jPanel4.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));

    lineOkayButton.setText("Okay");
    lineOkayButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            lineOkayButtonActionPerformed(evt);
        }
    });

    jPanel4.add(lineOkayButton);

    lineCancelButton.setText("Cancel");
    lineCancelButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            lineCancelButtonActionPerformed(evt);
        }
    });

    jPanel4.add(lineCancelButton);

    jPanel1.add(jPanel4, java.awt.BorderLayout.SOUTH);

    //jTabbedPane1.addTab("", GUIPrism.getIconFromImage("lineGraph.png"), jPanel1);

    jPanel2.setBorder(new javax.swing.border.TitledBorder("Bar Graph"));
    jPanel2.setEnabled(false);
    //jTabbedPane1.addTab("", GUIPrism.getIconFromImage("barGraph.png"), jPanel2);

    getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);

    pack();
}

From source file:pcgen.gui2.tabs.SummaryInfoTab.java

private void resetBasicsPanel() {
    basicsPanel.removeAll();/*w  ww.  j  a  va 2s  . c  om*/
    GridBagConstraints gbc = new GridBagConstraints();
    {
        JLabel label = createLabel("in_sumName"); //$NON-NLS-1$
        gbc.anchor = GridBagConstraints.WEST;
        gbc.insets = new Insets(0, 0, 3, 0);
        basicsPanel.add(label, gbc);

        random.setText(LanguageBundle.getString("in_randomButton")); //$NON-NLS-1$
        random.setMargin(new Insets(0, 0, 0, 0));
        gbc.insets = new Insets(0, 2, 3, 2);
        basicsPanel.add(random, gbc);

        gbc.insets = new Insets(0, 0, 3, 2);
        gbc.gridwidth = GridBagConstraints.REMAINDER;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.weightx = 1.0;
        basicsPanel.add(characterNameField, gbc);
    }
    Insets insets = new Insets(0, 0, 3, 2);
    Font labelFont = null;
    addGridBagLayer(basicsPanel, labelFont, insets, "in_sumCharType", characterTypeComboBox); //$NON-NLS-1$
    addGridBagLayer(basicsPanel, labelFont, insets, "in_sumPlayer", playerNameField); //$NON-NLS-1$
    addGridBagLayer(basicsPanel, labelFont, insets, "in_sumTabLabel", tabLabelField); //$NON-NLS-1$
    if (genderComboBox.getModel().getSize() != 0) {
        addGridBagLayer(basicsPanel, labelFont, insets, "in_sumGender", genderComboBox); //$NON-NLS-1$
    }
    if (handsComboBox.getModel().getSize() != 0) {
        addGridBagLayer(basicsPanel, labelFont, insets, "in_sumHanded", handsComboBox); //$NON-NLS-1$
    }
    if (alignmentComboBox.getModel().getSize() != 0) {
        addGridBagLayer(basicsPanel, labelFont, insets, "in_sumAlignment", alignmentComboBox); //$NON-NLS-1$
    }
    if (deityComboBox.getModel().getSize() != 0) {
        addGridBagLayer(basicsPanel, labelFont, insets, "in_domDeityLabel", deityComboBox); //$NON-NLS-1$
    }

    gbc = new GridBagConstraints();
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weighty = 1;
    gbc.insets = new Insets(6, 2, 2, 2);
    langScroll = new JScrollPane(languageTable);
    basicsPanel.add(langScroll, gbc);
    basicsPanel.revalidate();
}

From source file:mt.listeners.InteractiveRANSAC.java

public void CardTable() {
    this.lambdaSB = new Scrollbar(Scrollbar.HORIZONTAL, this.lambdaInt, 1, MIN_SLIDER, MAX_SLIDER + 1);

    maxSlopeSB.setValue(utility.Slicer.computeScrollbarPositionFromValue((float) maxSlope,
            (float) MIN_ABS_SLOPE, (float) MAX_ABS_SLOPE, scrollbarSize));

    maxDistSB.setValue(//www  .j  ava 2 s.  c o m
            utility.Slicer.computeScrollbarPositionFromValue(maxDist, MIN_Gap, MAX_Gap, scrollbarSize));

    minInliersSB.setValue(utility.Slicer.computeScrollbarPositionFromValue(minInliers, MIN_Inlier, MAX_Inlier,
            scrollbarSize));
    maxErrorSB.setValue(
            utility.Slicer.computeScrollbarPositionFromValue(maxError, MIN_ERROR, MAX_ERROR, scrollbarSize));

    minSlopeSB.setValue(utility.Slicer.computeScrollbarPositionFromValue((float) minSlope,
            (float) MIN_ABS_SLOPE, (float) MAX_ABS_SLOPE, scrollbarSize));

    lambdaLabel = new Label("Linearity (fraction) = " + new DecimalFormat("#.##").format(lambda), Label.CENTER);
    maxErrorLabel = new Label("Maximum Error (px) = " + new DecimalFormat("#.##").format(maxError) + "      ",
            Label.CENTER);
    minInliersLabel = new Label(
            "Minimum No. of timepoints (tp) = " + new DecimalFormat("#.##").format(minInliers), Label.CENTER);
    maxDistLabel = new Label("Maximum Gap (tp) = " + new DecimalFormat("#.##").format(maxDist), Label.CENTER);

    minSlopeLabel = new Label("Min. Segment Slope (px/tp) = " + new DecimalFormat("#.##").format(minSlope),
            Label.CENTER);
    maxSlopeLabel = new Label("Max. Segment Slope (px/tp) = " + new DecimalFormat("#.##").format(maxSlope),
            Label.CENTER);
    maxResLabel = new Label(
            "MT is rescued if the start of event# i + 1 > start of event# i by px =  " + this.restolerance,
            Label.CENTER);

    CardLayout cl = new CardLayout();
    Object[] colnames = new Object[] { "Track File", "Growth velocity", "Shrink velocity", "Growth events",
            "Shrink events", "fcat", "fres", "Error" };

    Object[][] rowvalues = new Object[0][colnames.length];

    if (inputfiles != null) {
        rowvalues = new Object[inputfiles.length][colnames.length];
        for (int i = 0; i < inputfiles.length; ++i) {

            rowvalues[i][0] = inputfiles[i].getName();
        }
    }

    table = new JTable(rowvalues, colnames);

    table.setFillsViewportHeight(true);

    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

    table.isOpaque();
    int size = 100;
    table.getColumnModel().getColumn(0).setPreferredWidth(size);
    table.getColumnModel().getColumn(1).setPreferredWidth(size);
    table.getColumnModel().getColumn(2).setPreferredWidth(size);
    table.getColumnModel().getColumn(3).setPreferredWidth(size);
    table.getColumnModel().getColumn(4).setPreferredWidth(size);
    table.getColumnModel().getColumn(5).setPreferredWidth(size);
    table.getColumnModel().getColumn(6).setPreferredWidth(size);
    table.getColumnModel().getColumn(7).setPreferredWidth(size);
    maxErrorField = new TextField(5);
    maxErrorField.setText(Float.toString(maxError));

    minInlierField = new TextField(5);
    minInlierField.setText(Float.toString(minInliers));

    maxGapField = new TextField(5);
    maxGapField.setText(Float.toString(maxDist));

    maxSlopeField = new TextField(5);
    maxSlopeField.setText(Float.toString(maxSlope));

    minSlopeField = new TextField(5);
    minSlopeField.setText(Float.toString(minSlope));

    maxErrorSB.setSize(new Dimension(SizeX, 20));
    minSlopeSB.setSize(new Dimension(SizeX, 20));
    minInliersSB.setSize(new Dimension(SizeX, 20));
    maxDistSB.setSize(new Dimension(SizeX, 20));
    maxSlopeSB.setSize(new Dimension(SizeX, 20));
    maxErrorField.setSize(new Dimension(SizeX, 20));
    minInlierField.setSize(new Dimension(SizeX, 20));
    maxGapField.setSize(new Dimension(SizeX, 20));
    minSlopeField.setSize(new Dimension(SizeX, 20));
    maxSlopeField.setSize(new Dimension(SizeX, 20));

    scrollPane = new JScrollPane(table);
    scrollPane.setMinimumSize(new Dimension(300, 200));
    scrollPane.setPreferredSize(new Dimension(300, 200));

    scrollPane.getViewport().add(table);
    scrollPane.setAutoscrolls(true);

    // Location
    panelFirst.setLayout(layout);
    panelSecond.setLayout(layout);
    PanelSavetoFile.setLayout(layout);
    PanelParameteroptions.setLayout(layout);
    Panelfunction.setLayout(layout);
    Panelslope.setLayout(layout);
    PanelCompileRes.setLayout(layout);
    PanelDirectory.setLayout(layout);

    panelCont.setLayout(cl);

    panelCont.add(panelFirst, "1");
    panelCont.add(panelSecond, "2");

    panelFirst.setName("Ransac fits for rates and frequency analysis");
    c.insets = new Insets(5, 5, 5, 5);
    c.anchor = GridBagConstraints.BOTH;
    c.ipadx = 35;

    inputLabelT = new Label("Compute length distribution at time: ");
    inputLabelTcont = new Label("(Press Enter to start computation) ");
    inputFieldT = new TextField(5);
    inputFieldT.setText("1");

    c.gridwidth = 10;
    c.gridheight = 10;
    c.gridy = 1;
    c.gridx = 0;

    String[] Method = { "Linear Function only", "Linearized Quadratic function", "Linearized Cubic function" };
    JComboBox<String> ChooseMethod = new JComboBox<String>(Method);

    final Checkbox findCatastrophe = new Checkbox("Detect Catastrophies", this.detectCatastrophe);
    final Checkbox findmanualCatastrophe = new Checkbox("Detect Catastrophies without fit",
            this.detectmanualCatastrophe);
    final Scrollbar minCatDist = new Scrollbar(Scrollbar.HORIZONTAL, this.minDistCatInt, 1, MIN_SLIDER,
            MAX_SLIDER + 1);
    final Scrollbar maxRes = new Scrollbar(Scrollbar.HORIZONTAL, this.restoleranceInt, 1, MIN_SLIDER,
            MAX_SLIDER + 1);
    final Label minCatDistLabel = new Label("Min. Catastrophy height (tp) = " + this.minDistanceCatastrophe,
            Label.CENTER);
    final Button done = new Button("Done");
    final Button batch = new Button("Save Parameters for Batch run");
    final Button cancel = new Button("Cancel");
    final Button Compile = new Button("Compute rates and freq. till current file");
    final Button AutoCompile = new Button("Auto Compute Velocity and Frequencies");
    final Button Measureserial = new Button("Select directory of MTrack generated files");
    final Button WriteLength = new Button("Compute length distribution at framenumber : ");
    final Button WriteStats = new Button("Compute lifetime and mean length distribution");
    final Button WriteAgain = new Button("Save Velocity and Frequencies to File");

    PanelDirectory.add(Measureserial, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));

    PanelDirectory.add(scrollPane, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));
    PanelDirectory.setBorder(selectdirectory);
    PanelDirectory.setPreferredSize(new Dimension(SizeX, SizeY));
    panelFirst.add(PanelDirectory, new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));

    SliderBoxGUI combomaxerror = new SliderBoxGUI(errorstring, maxErrorSB, maxErrorField, maxErrorLabel,
            scrollbarSize, maxError, MAX_ERROR);

    PanelParameteroptions.add(combomaxerror.BuildDisplay(), new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0,
            GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0));

    SliderBoxGUI combomininlier = new SliderBoxGUI(inlierstring, minInliersSB, minInlierField, minInliersLabel,
            scrollbarSize, minInliers, MAX_Inlier);

    PanelParameteroptions.add(combomininlier.BuildDisplay(), new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0,
            GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0));

    SliderBoxGUI combomaxdist = new SliderBoxGUI(maxgapstring, maxDistSB, maxGapField, maxDistLabel,
            scrollbarSize, maxDist, MAX_Gap);

    PanelParameteroptions.add(combomaxdist.BuildDisplay(), new GridBagConstraints(0, 3, 3, 1, 0.0, 0.0,
            GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0));

    PanelParameteroptions.add(ChooseMethod, new GridBagConstraints(0, 4, 3, 1, 0.0, 0.0,
            GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, insets, 0, 0));

    PanelParameteroptions.add(lambdaSB, new GridBagConstraints(0, 5, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));
    PanelParameteroptions.add(lambdaLabel, new GridBagConstraints(0, 6, 3, 1, 0.0, 0.0,
            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insets, 0, 0));

    PanelParameteroptions.setPreferredSize(new Dimension(SizeX, SizeY));
    PanelParameteroptions.setBorder(selectparam);
    panelFirst.add(PanelParameteroptions, new GridBagConstraints(3, 0, 3, 1, 0.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));

    SliderBoxGUI combominslope = new SliderBoxGUI(minslopestring, minSlopeSB, minSlopeField, minSlopeLabel,
            scrollbarSize, (float) minSlope, (float) MAX_ABS_SLOPE);

    Panelslope.add(combominslope.BuildDisplay(), new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0,
            GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0));

    SliderBoxGUI combomaxslope = new SliderBoxGUI(maxslopestring, maxSlopeSB, maxSlopeField, maxSlopeLabel,
            scrollbarSize, (float) maxSlope, (float) MAX_ABS_SLOPE);

    Panelslope.add(combomaxslope.BuildDisplay(), new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0,
            GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0));

    Panelslope.add(findCatastrophe, new GridBagConstraints(0, 4, 3, 1, 0.0, 0.0, GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));
    Panelslope.add(findmanualCatastrophe, new GridBagConstraints(4, 4, 3, 1, 0.0, 0.0, GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));
    Panelslope.add(minCatDist, new GridBagConstraints(0, 5, 3, 1, 0.0, 0.0, GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));
    Panelslope.add(minCatDistLabel, new GridBagConstraints(0, 6, 3, 1, 0.0, 0.0, GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));
    Panelslope.setBorder(selectslope);
    Panelslope.setPreferredSize(new Dimension(SizeX, SizeY));

    panelFirst.add(Panelslope, new GridBagConstraints(3, 1, 3, 1, 0.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));

    PanelCompileRes.add(AutoCompile, new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));

    PanelCompileRes.add(WriteLength, new GridBagConstraints(0, 1, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));

    PanelCompileRes.add(inputFieldT, new GridBagConstraints(3, 1, 3, 1, 0.1, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));

    PanelCompileRes.add(WriteStats, new GridBagConstraints(0, 4, 3, 1, 0.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));

    PanelCompileRes.setPreferredSize(new Dimension(SizeX, SizeY));

    PanelCompileRes.setBorder(compileres);

    panelFirst.add(PanelCompileRes, new GridBagConstraints(0, 1, 3, 1, 0.0, 0.0, GridBagConstraints.EAST,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));

    if (inputfiles != null) {

        table.addMouseListener(new MouseAdapter() {

            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() >= 1) {

                    if (!jFreeChartFrame.isVisible())
                        jFreeChartFrame = Tracking.display(chart, new Dimension(500, 500));
                    JTable target = (JTable) e.getSource();
                    row = target.getSelectedRow();
                    // do some action if appropriate column
                    if (row > 0)
                        displayclicked(row);
                    else
                        displayclicked(0);
                }
            }
        });
    }

    maxErrorSB.addAdjustmentListener(new ErrorListener(this, maxErrorLabel, errorstring, MIN_ERROR, MAX_ERROR,
            scrollbarSize, maxErrorSB));

    minInliersSB.addAdjustmentListener(new MinInlierListener(this, minInliersLabel, inlierstring, MIN_Inlier,
            MAX_Inlier, scrollbarSize, minInliersSB));

    maxDistSB.addAdjustmentListener(
            new MaxDistListener(this, maxDistLabel, maxgapstring, MIN_Gap, MAX_Gap, scrollbarSize, maxDistSB));

    ChooseMethod.addActionListener(new FunctionItemListener(this, ChooseMethod));
    lambdaSB.addAdjustmentListener(new LambdaListener(this, lambdaLabel, lambdaSB));
    minSlopeSB.addAdjustmentListener(new MinSlopeListener(this, minSlopeLabel, minslopestring,
            (float) MIN_ABS_SLOPE, (float) MAX_ABS_SLOPE, scrollbarSize, minSlopeSB));

    maxSlopeSB.addAdjustmentListener(new MaxSlopeListener(this, maxSlopeLabel, maxslopestring,
            (float) MIN_ABS_SLOPE, (float) MAX_ABS_SLOPE, scrollbarSize, maxSlopeSB));
    findCatastrophe.addItemListener(
            new CatastrophyCheckBoxListener(this, findCatastrophe, minCatDistLabel, minCatDist));
    findmanualCatastrophe.addItemListener(
            new ManualCatastrophyCheckBoxListener(this, findmanualCatastrophe, minCatDistLabel, minCatDist));
    minCatDist.addAdjustmentListener(new MinCatastrophyDistanceListener(this, minCatDistLabel, minCatDist));
    Measureserial.addActionListener(new MeasureserialListener(this));
    Compile.addActionListener(new CompileResultsListener(this));
    AutoCompile.addActionListener(new AutoCompileResultsListener(this));
    WriteLength.addActionListener(new WriteLengthListener(this));
    WriteStats.addActionListener(new WriteStatsListener(this));
    WriteAgain.addActionListener(new WriteRatesListener(this));
    done.addActionListener(new FinishButtonListener(this, false));
    batch.addActionListener(new RansacBatchmodeListener(this));
    cancel.addActionListener(new FinishButtonListener(this, true));
    inputFieldT.addTextListener(new LengthdistroListener(this));

    maxSlopeField.addTextListener(new MaxSlopeLocListener(this, false));
    minSlopeField.addTextListener(new MinSlopeLocListener(this, false));
    maxErrorField.addTextListener(new ErrorLocListener(this, false));
    minInlierField.addTextListener(new MinInlierLocListener(this, false));
    maxGapField.addTextListener(new MaxDistLocListener(this, false));

    panelFirst.setVisible(true);
    functionChoice = 0;

    cl.show(panelCont, "1");

    Cardframe.add(panelCont, BorderLayout.CENTER);

    setFunction();
    Cardframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    Cardframe.pack();
    Cardframe.setVisible(true);
    Cardframe.pack();

}

From source file:org.apache.taverna.activities.rest.ui.config.RESTActivityConfigurationPanel.java

private JPanel createAdvancedTab() {
    JPanel jpAdvanced = new JPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();

    c.gridx = 0;//from w  w w .  j a  v  a 2 s.  c o m
    c.gridy = 0;
    c.anchor = GridBagConstraints.WEST;
    c.fill = GridBagConstraints.BOTH;
    c.insets = new Insets(8, 10, 2, 4);
    JLabel jlExpectHeaderInfoIcon = new JLabel(infoIcon);
    jlExpectHeaderInfoIcon
            .setToolTipText("<html>Ticking this checkbox may significantly improve performance when<br>"
                    + "large volumes of data are sent to the remote server and a redirect<br>"
                    + "from the original URL to the one specified by the server is likely.<br>" + "<br>"
                    + "However, this checkbox <b>must not</b> be ticked to allow this activity<br>"
                    + "to post updates to Twitter.</html>");
    jpAdvanced.add(jlExpectHeaderInfoIcon, c);

    c.gridx++;
    c.weightx = 1.0;
    c.insets = new Insets(8, 0, 2, 8);
    cbSendHTTPExpectHeader = new JCheckBox("Send HTTP Expect request-header field");
    jpAdvanced.add(cbSendHTTPExpectHeader, c);

    c.gridx = 0;
    c.gridy++;
    c.weightx = 0;
    c.insets = new Insets(2, 10, 5, 4);
    JLabel jlShowRedirectionOutputPortInfoIcon = new JLabel(infoIcon);
    jlShowRedirectionOutputPortInfoIcon
            .setToolTipText("<html>\"Redirection\" output port displays the URL of the final redirect<br>"
                    + "that has yielded the output data on the \"Response Body\" port.</html>");
    jpAdvanced.add(jlShowRedirectionOutputPortInfoIcon, c);

    c.gridx++;
    c.weightx = 1.0;
    c.insets = new Insets(2, 0, 5, 8);
    cbShowRedirectionOutputPort = new JCheckBox("Show \"Redirection\" output port");
    jpAdvanced.add(cbShowRedirectionOutputPort, c);

    c.gridx = 0;
    c.gridy++;
    c.weightx = 0;
    c.insets = new Insets(2, 10, 5, 4);
    JLabel jlShowActualUrlPortInfoIcon = new JLabel(infoIcon);
    jlShowActualUrlPortInfoIcon
            .setToolTipText("<html>\"Actual URL\" output port displays the URL used by the REST service<br>"
                    + "with the actual parameter values.</html>");
    jpAdvanced.add(jlShowActualUrlPortInfoIcon, c);

    c.gridx++;
    c.weightx = 1.0;
    c.insets = new Insets(2, 0, 5, 8);
    cbShowActualUrlPort = new JCheckBox("Show \"Actual URL\" output port");
    jpAdvanced.add(cbShowActualUrlPort, c);

    c.gridx = 0;
    c.gridy++;
    c.weightx = 0;
    c.insets = new Insets(2, 10, 5, 4);
    JLabel jlShowResponseHeadersPortInfoIcon = new JLabel(infoIcon);
    jlShowResponseHeadersPortInfoIcon
            .setToolTipText("<html>\"Response headers\" output port displays the HTTP headers<br>"
                    + "received from the final (after redirection) HTTP call.</html>");
    jpAdvanced.add(jlShowResponseHeadersPortInfoIcon, c);

    c.gridx++;
    c.weightx = 1.0;
    c.insets = new Insets(2, 0, 5, 8);
    cbShowResponseHeadersPort = new JCheckBox("Show \"Response headers\" output port");
    jpAdvanced.add(cbShowResponseHeadersPort, c);

    c.gridx = 0;
    c.gridy++;
    c.weightx = 0;
    c.insets = new Insets(2, 10, 5, 4);
    JLabel jlEscapeParametersInfoIcon = new JLabel(infoIcon);
    jlEscapeParametersInfoIcon.setToolTipText("<html>Determines if parameters you pass to form the full URL<br>"
            + " of the REST service will be URL-escaped.</html>");
    jpAdvanced.add(jlEscapeParametersInfoIcon, c);

    c.gridx++;
    c.weightx = 1.0;
    c.insets = new Insets(2, 0, 5, 8);
    cbEscapeParameters = new JCheckBox("Escape URL parameter values");
    jpAdvanced.add(cbEscapeParameters, c);

    c.gridx = 0;
    c.gridy++;
    c.weightx = 0;
    c.anchor = GridBagConstraints.WEST;
    c.fill = GridBagConstraints.NONE;
    c.insets = new Insets(2, 10, 5, 4);
    JLabel jlHTTPHeadersInfoIcon = new JLabel(infoIcon);
    jlHTTPHeadersInfoIcon.setToolTipText("<html>Set additional HTTP headers</html>");
    jpAdvanced.add(jlHTTPHeadersInfoIcon, c);

    c.gridx = 1;
    c.weightx = 0;
    c.weighty = 0;
    c.anchor = GridBagConstraints.WEST;
    c.fill = GridBagConstraints.NONE;
    c.insets = new Insets(2, 10, 5, 4);
    addHeaderButton = new JButton("Add HTTP header");
    addHeaderButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            httpHeadersTableModel.addEmptyRow();
            httpHeadersTable.getSelectionModel().setSelectionInterval(httpHeadersTableModel.getRowCount() - 1,
                    httpHeadersTableModel.getRowCount() - 1);
        }
    });
    removeHeaderButton = new JButton("Remove HTTP header");
    removeHeaderButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            int row = httpHeadersTable.getSelectedRow();
            httpHeadersTableModel.removeRow(row);
        }
    });
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(addHeaderButton, FlowLayout.LEFT);
    buttonPanel.add(removeHeaderButton);
    jpAdvanced.add(buttonPanel, c);

    c.gridx = 1;
    c.gridy++;
    c.weightx = 0;
    c.weighty = 1.0;
    c.fill = GridBagConstraints.BOTH;
    c.insets = new Insets(2, 10, 5, 4);
    httpHeadersTableModel = new HTTPHeadersTableModel();
    httpHeadersTable = new JTable(httpHeadersTableModel);
    httpHeadersTable.setGridColor(Color.GRAY);
    httpHeadersTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    setVisibleRowCount(httpHeadersTable, 3);
    JScrollPane headersTableScrollPane = new JScrollPane(httpHeadersTable);
    jpAdvanced.add(headersTableScrollPane, c);

    return (jpAdvanced);
}

From source file:savant.view.dialog.LoadGenomeDialog.java

private void updateAuxiliaryList() {
    Genome curGenome = (Genome) genomesCombo.getSelectedItem();
    auxiliaryPanel.removeAll();//from   w  ww.  j a  v  a 2s  . c o  m
    Auxiliary[] auxes = curGenome.getAuxiliaries();
    if (auxes.length > 0) {
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridwidth = GridBagConstraints.REMAINDER;
        gbc.gridy = GridBagConstraints.RELATIVE;
        gbc.anchor = GridBagConstraints.WEST;
        gbc.weightx = 1.0;
        gbc.fill = GridBagConstraints.HORIZONTAL;
        for (Auxiliary aux : auxes) {
            JCheckBox cb = new JCheckBox(aux.toString());
            cb.setSelected(aux.type == AuxiliaryType.SEQUENCE); // Sequence track is checked by default.
            auxiliaryPanel.add(cb, gbc);
        }
    }
    pack();
}