Example usage for java.awt Insets Insets

List of usage examples for java.awt Insets Insets

Introduction

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

Prototype

public Insets(int top, int left, int bottom, int right) 

Source Link

Document

Creates and initializes a new Insets object with the specified top, left, bottom, and right insets.

Usage

From source file:de.juwimm.cms.gui.admin.PanUnitGroupPerUser.java

void jbInit() throws Exception {
    this.setLayout(new GridBagLayout());

    this.unitPickData = new PickListData();
    this.unitPickData.setLeftLabel(rb.getString("panel.admin.tab.units.assigned"));
    this.unitPickData.setRightLabel(rb.getString("panel.admin.tab.units.all"));
    this.groupPickData = new PickListData();
    this.groupPickData.setLeftLabel(rb.getString("panel.admin.tab.groups.assigned"));
    this.groupPickData.setRightLabel(rb.getString("panel.admin.tab.groups.all"));
    this.panUnitPick = new PickListPanel(this.unitPickData);
    this.panGroupPick = new PickListPanel(this.groupPickData);
    this.btnSave.setText(rb.getString("dialog.save"));
    this.lblUser.setText(rb.getString("panel.login.username"));

    this.btnSave.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            save();//from   w  ww  . ja  v  a 2s.c om
        }
    });

    this.tblUser = new JTable();
    JScrollPane scrollUser = new NoResizeScrollPane(tblUser);

    this.add(lblUser, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST,
            GridBagConstraints.HORIZONTAL, new Insets(10, 10, 5, 0), 0, 0));
    this.add(scrollUser, new GridBagConstraints(0, 1, 1, 2, 1.0, 1.0, GridBagConstraints.NORTHWEST,
            GridBagConstraints.BOTH, new Insets(0, 10, 0, 0), 0, 0));
    this.add(btnSave, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.SOUTHWEST,
            GridBagConstraints.NONE, new Insets(10, 10, 10, 0), 0, 0));
    this.add(this.panUnitPick, new GridBagConstraints(1, 0, 1, 2, 2.0, 1.0, GridBagConstraints.NORTHWEST,
            GridBagConstraints.BOTH, new Insets(0, 10, 0, 10), 0, 0));
    this.add(this.panGroupPick, new GridBagConstraints(1, 2, 1, 1, 2.0, 1.0, GridBagConstraints.NORTHWEST,
            GridBagConstraints.BOTH, new Insets(0, 10, 0, 10), 0, 0));
}

From source file:Applet.EmbeddedChart.java

public synchronized void updateInfo(String[] legends, List<double[][]> yVals, boolean gofr) {
    removeAll();/*from www.  java  2 s .c  o  m*/
    GridBagLayout gbl = new GridBagLayout();
    gbl.columnWidths = new int[] { 10, 0, 0 };
    gbl.rowHeights = new int[] { 0, 0, 0 };
    gbl.columnWeights = new double[] { 0.0, 1.0, 1.0 };
    gbl.rowWeights = new double[] { 1.0, 1.0, 0.0 };
    setLayout(gbl);

    this.legends = legends;
    this.yvals = yVals;
    this.gofr = gofr;

    XYDataset dataset = createDataset(gofr, legends, yVals);
    JFreeChart chart = createChart(dataset, title, gofr);
    chartPanel = new ChartPanel(chart);
    chartPanel.setMinimumDrawWidth(0);
    chartPanel.setMinimumDrawHeight(0);
    chartPanel.setMaximumDrawWidth(2000);
    chartPanel.setMaximumDrawHeight(2000);
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.white);
    chartPanel.getChart().setBackgroundPaint(null);
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.gridwidth = 2;
    gbc.gridheight = 2;
    gbc.fill = GridBagConstraints.BOTH;
    add(chartPanel, gbc);

    GridBagConstraints gbcX1 = new GridBagConstraints();
    GridBagConstraints gbcX2 = new GridBagConstraints();
    GridBagConstraints gbcY1 = new GridBagConstraints();
    GridBagConstraints gbcY2 = new GridBagConstraints();
    GridBagConstraints gbcButton = new GridBagConstraints();
    final NumberAxis domain = (NumberAxis) ((XYPlot) chartPanel.getChart().getPlot()).getDomainAxis();
    final NumberAxis range = (NumberAxis) ((XYPlot) chartPanel.getChart().getPlot()).getRangeAxis();

    if (gofr) {
        domain.setLowerBound(over.gr_xMin);
        domain.setUpperBound(over.gr_xMax);
        range.setLowerBound(over.gr_yMin);
        range.setUpperBound(over.gr_yMax);
    } else {
        domain.setLowerBound(over.pot_xMin);
        domain.setUpperBound(over.pot_xMax);
        range.setLowerBound(over.pot_yMin);
        range.setUpperBound(over.pot_yMax);
    }

    gbcX2.gridx = 2;
    gbcX2.gridy = 2;
    gbcX2.anchor = GridBagConstraints.EAST;
    gbcX2.insets = new Insets(0, 0, 0, 12);
    final JTextField xMax = new JTextField(5);
    xMax.setMinimumSize(new Dimension(50, 20));
    xMax.setText("" + domain.getUpperBound());
    // gbcX2.fill = GridBagConstraints.VERTICAL;
    add(xMax, gbcX2);
    final boolean gr = gofr;
    xMax.addFocusListener(new FocusListener() {

        @Override
        public void focusLost(FocusEvent e) {
            if (gr) {
                over.gr_xMax = Double.parseDouble(xMax.getText());
                domain.setRange(over.gr_xMin, over.gr_xMax);
            } else {
                over.pot_xMax = Double.parseDouble(xMax.getText());
                domain.setRange(over.pot_xMin, over.pot_xMax);
            }
        }

        @Override
        public void focusGained(FocusEvent e) {
        }
    });

    gbcX1.gridx = 1;
    gbcX1.gridy = 2;
    gbcX1.anchor = GridBagConstraints.WEST;
    gbcX1.insets = new Insets(0, 70, 0, 0);
    final JTextField xMin = new JTextField(5);
    xMin.setMinimumSize(new Dimension(50, 20));
    xMin.setText("" + domain.getLowerBound());
    // gbcX1.fill = GridBagConstraints.VERTICAL;
    add(xMin, gbcX1);
    xMin.addFocusListener(new FocusListener() {

        @Override
        public void focusLost(FocusEvent e) {
            x1 = Double.parseDouble(xMin.getText());
            domain.setRange(x1, x2);
            if (gr) {
                over.gr_xMin = Double.parseDouble(xMin.getText());
                domain.setRange(over.gr_xMin, over.gr_xMax);
            } else {
                over.pot_xMin = Double.parseDouble(xMin.getText());
                domain.setRange(over.pot_xMin, over.pot_xMax);
            }
        }

        @Override
        public void focusGained(FocusEvent e) {
        }
    });

    gbcY1.gridx = 0;
    gbcY1.gridy = 1;
    gbcY1.anchor = GridBagConstraints.SOUTH;
    gbcY1.insets = new Insets(0, 0, 45, 0);
    final JTextField yMin = new JTextField(5);
    yMin.setMinimumSize(new Dimension(50, 20));
    yMin.setText("" + range.getLowerBound());
    // gbcY1.fill = GridBagConstraints.BOTH;
    add(yMin, gbcY1);
    yMin.addFocusListener(new FocusListener() {

        @Override
        public void focusLost(FocusEvent e) {
            if (gr) {
                over.gr_yMin = Double.parseDouble(yMin.getText());
                range.setRange(over.gr_yMin, over.gr_yMax);
            } else {
                over.pot_yMin = Double.parseDouble(yMin.getText());
                range.setRange(over.pot_yMin, over.pot_yMax);
            }

        }

        @Override
        public void focusGained(FocusEvent e) {
        }
    });

    gbcY2.gridx = 0;
    gbcY2.gridy = 0;
    gbcY2.anchor = GridBagConstraints.NORTH;
    gbcY2.insets = new Insets(10, 0, 0, 0);
    final JTextField yMax = new JTextField(5);
    yMax.setMinimumSize(new Dimension(50, 20));
    yMax.setText("" + range.getUpperBound());
    // gbcY2.fill = GridBagConstraints.BOTH;
    add(yMax, gbcY2);
    yMax.addFocusListener(new FocusListener() {

        @Override
        public void focusLost(FocusEvent e) {
            if (gr) {
                over.gr_yMax = Double.parseDouble(yMax.getText());
                range.setRange(over.gr_yMin, over.gr_yMax);
            } else {
                over.pot_yMax = Double.parseDouble(yMax.getText());
                range.setRange(over.pot_yMin, over.pot_yMax);
            }
        }

        @Override
        public void focusGained(FocusEvent e) {
        }
    });

}

From source file:com.diversityarrays.kdxplore.field.PlotIdTrialLayoutPane.java

public PlotIdTrialLayoutPane() {
    super(new BorderLayout());

    /*/*from  w  w  w .  j av a2  s . c om*/
     *  *  .--->           <---.
     *  |    (o)      (o)   |
     *  v                   v
     *   (o)             (o)
     *   
     *                            
     *   (o)             (o)
     *  ^                   ^ 
     *  |    (o)      (o)   |
     *  `--->           <---'
     *  
     *  Traversal: (o) 1-w  (o) 2-w
     *  
     *  (above is in odtPanel)
     *  ---------------------------
     *  
     *  Run Length:     [         ]
     *  Origin Plot Id: [         ]
     */

    JPanel top = new JPanel();

    GBH gbh = new GBH(top);
    int y = 0;

    gbh.add(0, y, 1, 1, GBH.NONE, 1, 1, GBH.EAST, "Plot Ids:");
    gbh.add(1, y, 3, 1, GBH.HORZ, 1, 1, GBH.WEST, plotIdentInfo);
    ++y;

    // - - - - - - -

    JPanel bottom = new JPanel();
    GBH rgbh = new GBH(bottom);
    y = 0;

    rgbh.add(0, y, 1, 1, GBH.NONE, 1, 1, GBH.EAST, "Run Length:");
    rgbh.add(1, y, 1, 1, GBH.HORZ, 1, 1, GBH.CENTER, runLengthSpinner);
    ++y;
    rgbh.add(0, y, 1, 1, GBH.NONE, 1, 1, GBH.EAST, "Origin Plot Id:");
    rgbh.add(1, y, 1, 1, GBH.HORZ, 1, 1, GBH.CENTER, plotSpinner);
    ++y;

    // - - - - - - -
    Box main = Box.createVerticalBox();
    main.add(top);
    main.add(withInsets(new JSeparator(JSeparator.HORIZONTAL), new Insets(0, 20, 0, 20)));
    main.add(odtPanel);
    main.add(withInsets(new JSeparator(JSeparator.HORIZONTAL), new Insets(0, 20, 0, 20)));

    main.add(bottom);

    add(main, BorderLayout.CENTER);

    //         crb_ll_right.doClick();

    ChangeListener changeListener = new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            if (initialised) {
                firePropertyChange(PROP_LAYOUT_CHANGED, false, true);
            }
        }
    };
    runLengthModel.addChangeListener(changeListener);
    plotIdModel.addChangeListener(changeListener);

    initialised = true;
}

From source file:coolmap.canvas.datarenderer.renderer.impl.NumberComposite.java

public NumberComposite() {

    setName("Number to Composite");
    //        System.out.println("Created a new NumberComposite");
    setDescription("A renderer that can be used to assign renderers to different aggregations");

    configUI.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.gridx = 0;//from  ww  w .j  a  v a  2 s .  c  o  m
    c.gridy = 0;
    c.ipadx = 5;
    c.ipady = 5;
    c.insets = new Insets(2, 2, 2, 2);
    c.gridwidth = 1;

    //This combo box will need to be able to add registered
    singleComboBox = new JComboBox();
    rowComboBox = new JComboBox();
    columnComboBox = new JComboBox();
    rowColumnComboBox = new JComboBox();

    singleLegend = new JLabel();
    rowLegend = new JLabel();
    columnLegend = new JLabel();
    rowColumnLegend = new JLabel();

    singleLegend.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    rowLegend.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    columnLegend.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    rowColumnLegend.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));

    //Add them
    JLabel label = new JLabel("Default:");
    label.setToolTipText("Default renderer");
    c.gridx = 0;
    c.gridy++;
    configUI.add(label, c);
    c.gridx = 1;
    configUI.add(singleComboBox, c);
    singleComboBox.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                updateRenderer();
            }
        }
    });

    c.gridx = 2;
    JButton config = new JButton(UI.getImageIcon("gear"));
    configUI.add(config, c);
    config.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (singleRenderer == null) {
                return;
            }
            //                JOptionPane.showmess
            int returnVal = JOptionPane.showConfirmDialog(CoolMapMaster.getCMainFrame(),
                    singleRenderer.getConfigUI(), "Default Renderer Config", JOptionPane.OK_CANCEL_OPTION,
                    JOptionPane.PLAIN_MESSAGE, null);
            if (returnVal == JOptionPane.OK_OPTION) {
                updateRenderer();
            }
        }
    });

    c.gridx = 1;
    c.gridy++;
    c.gridwidth = 1;
    configUI.add(singleLegend, c);

    //////////////////////////////////////////////////////////////
    c.gridx = 0;
    c.gridy++;
    c.gridwidth = 1;
    label = new JLabel("Row Group:");
    label.setToolTipText("Renderer for row ontology nodes");
    configUI.add(label, c);
    c.gridx = 1;
    configUI.add(rowComboBox, c);
    c.gridx++;
    config = new JButton(UI.getImageIcon("gear"));
    configUI.add(config, c);
    config.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (rowGroupRenderer == null) {
                return;
            }
            //                JOptionPane.showmess
            int returnVal = JOptionPane.showConfirmDialog(CoolMapMaster.getCMainFrame(),
                    rowGroupRenderer.getConfigUI(), "Row Group Renderer Config", JOptionPane.OK_CANCEL_OPTION,
                    JOptionPane.PLAIN_MESSAGE, null);
            if (returnVal == JOptionPane.OK_OPTION) {
                updateRenderer();
            }

        }
    });
    rowComboBox.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                updateRenderer();
            }
        }
    });

    c.gridx = 1;
    c.gridy++;
    c.gridwidth = 1;
    configUI.add(rowLegend, c);

    c.gridx = 0;
    c.gridy++;
    c.gridwidth = 1;
    label = new JLabel("Column Group:");
    label.setToolTipText("Renderer for column ontology nodes");
    configUI.add(label, c);
    c.gridx = 1;
    configUI.add(columnComboBox, c);
    c.gridx++;
    config = new JButton(UI.getImageIcon("gear"));
    configUI.add(config, c);
    config.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (columnGroupRenderer == null) {
                return;
            }
            //                JOptionPane.showmess
            int returnVal = JOptionPane.showConfirmDialog(CoolMapMaster.getCMainFrame(),
                    columnGroupRenderer.getConfigUI(), "Column Group Renderer Config",
                    JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null);
            if (returnVal == JOptionPane.OK_OPTION) {
                updateRenderer();
            }
        }
    });

    c.gridx = 1;
    c.gridy++;
    c.gridwidth = 1;
    configUI.add(columnLegend, c);
    columnComboBox.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                updateRenderer();
            }
        }
    });

    c.gridx = 0;
    c.gridy++;
    c.gridwidth = 1;
    label = new JLabel("Row & Column Group:");
    label.setToolTipText("Renderer for row and column ontology nodes");
    configUI.add(label, c);
    c.gridx = 1;
    configUI.add(rowColumnComboBox, c);
    c.gridx++;
    config = new JButton(UI.getImageIcon("gear"));
    configUI.add(config, c);
    config.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (rowColumnGroupRenderer == null) {
                return;
            }
            //                JOptionPane.showmess
            int returnVal = JOptionPane.showConfirmDialog(CoolMapMaster.getCMainFrame(),
                    rowColumnGroupRenderer.getConfigUI(), "Row + Column Group Renderer Config",
                    JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null);
            if (returnVal == JOptionPane.OK_OPTION) {
                updateRenderer();
            }
        }
    });
    rowColumnComboBox.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                updateRenderer();
            }
        }
    });

    c.gridx = 1;
    c.gridy++;
    c.gridwidth = 1;
    configUI.add(rowColumnLegend, c);

    JButton button = new JButton("Apply Changes", UI.getImageIcon("refresh"));
    button.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            updateRenderer();
        }
    });

    c.gridx = 0;
    c.gridy++;
    c.gridwidth = 2;
    configUI.add(button, c);

    singleComboBox.setRenderer(new ComboRenderer());
    rowComboBox.setRenderer(new ComboRenderer());
    columnComboBox.setRenderer(new ComboRenderer());
    rowColumnComboBox.setRenderer(new ComboRenderer());

    _updateLists();

}

From source file:com.choicemaker.cm.modelmaker.gui.panels.StatisticsHistogramPanel.java

private void layoutPanel() {
    GridBagLayout layout = new GridBagLayout();
    setLayout(layout);//from w  w w  .  ja  v a 2s .  c  o m
    GridBagConstraints c = new GridBagConstraints();
    c.insets = new Insets(2, 10, 5, 10);

    //Row 0..........................................................
    //histo
    c.gridy = 0;
    c.gridx = 0;
    c.gridwidth = 5;
    c.weightx = 1;
    c.weighty = 1;
    c.fill = GridBagConstraints.BOTH;
    add(histoPanel, c);

    //Row 1..........................................................
    //binWidthLabel
    c.gridy = 1;
    c.gridx = 1;
    c.gridwidth = 1;
    c.weightx = 0;
    c.weighty = 0;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.EAST;
    layout.setConstraints(binWidthLabel, c);
    add(binWidthLabel);
    //binWidthField
    c.gridx = 2;
    c.ipadx = 10;
    c.fill = GridBagConstraints.NONE;
    c.anchor = GridBagConstraints.WEST;
    layout.setConstraints(binWidthField, c);
    add(binWidthField);
}

From source file:com.sec.ose.osi.ui.dialog.setting.JPanProxySetting.java

private JPanel getJPanelValue() {
    if (jPanelValue == null) {

        GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
        gridBagConstraints3.gridx = 1;//from w ww. j  a v a2  s  . com
        gridBagConstraints3.weighty = 1.0;
        gridBagConstraints3.weightx = 0.0;
        gridBagConstraints3.gridy = 4;
        jLabelEmpty = new JLabel();
        jLabelEmpty.setText("");
        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
        gridBagConstraints2.gridx = 0;
        gridBagConstraints2.gridy = 3;
        jPanelValue = new JPanel();
        jPanelValue.setLayout(new GridBagLayout());
        jPanelValue.setBorder(BorderFactory.createTitledBorder(null, "", TitledBorder.DEFAULT_JUSTIFICATION,
                TitledBorder.DEFAULT_POSITION, new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51)));
        jPanelValue.setPreferredSize(new Dimension(400, 200));
        jPanelValue.add(jLabelEmpty, gridBagConstraints3);

        JLabel jLabelProxyHost = new JLabel("Proxy Host : ", JLabel.RIGHT);
        GridBagConstraints gridBagConstraintsjLabelProxyHost = new GridBagConstraints();
        gridBagConstraintsjLabelProxyHost.gridx = 0;
        gridBagConstraintsjLabelProxyHost.insets = new Insets(10, 20, 5, 0);
        gridBagConstraintsjLabelProxyHost.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraintsjLabelProxyHost.weightx = 0.0;
        gridBagConstraintsjLabelProxyHost.weighty = 0.0;
        gridBagConstraintsjLabelProxyHost.gridy = 1;
        jPanelValue.add(jLabelProxyHost, gridBagConstraintsjLabelProxyHost);

        GridBagConstraints gridBagConstraintsgetJTextFieldProxyHost = new GridBagConstraints();
        gridBagConstraintsgetJTextFieldProxyHost.gridx = 1;
        gridBagConstraintsgetJTextFieldProxyHost.weightx = 1.0;
        gridBagConstraintsgetJTextFieldProxyHost.fill = GridBagConstraints.BOTH;
        gridBagConstraintsgetJTextFieldProxyHost.insets = new Insets(10, 5, 5, 100);
        gridBagConstraintsgetJTextFieldProxyHost.gridwidth = 2;
        gridBagConstraintsgetJTextFieldProxyHost.gridy = 1;
        jPanelValue.add(getJTextFieldProxyHost(), gridBagConstraintsgetJTextFieldProxyHost);

        JLabel jLabelProxyPort = new JLabel("Proxy Port : ", JLabel.RIGHT);
        GridBagConstraints gridBagConstraintsjLabelProxyPort = new GridBagConstraints();
        gridBagConstraintsjLabelProxyPort.gridx = 0;
        gridBagConstraintsjLabelProxyPort.insets = new Insets(0, 20, 0, 0);
        gridBagConstraintsjLabelProxyPort.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraintsjLabelProxyPort.weighty = 0.0;
        gridBagConstraintsjLabelProxyPort.gridy = 2;
        jPanelValue.add(jLabelProxyPort, gridBagConstraintsjLabelProxyPort);

        GridBagConstraints gridBagConstraintsgetJTextFieldProxyPort = new GridBagConstraints();
        gridBagConstraintsgetJTextFieldProxyPort.gridx = 1;
        gridBagConstraintsgetJTextFieldProxyPort.weightx = 1.0;
        gridBagConstraintsgetJTextFieldProxyPort.fill = GridBagConstraints.BOTH;
        gridBagConstraintsgetJTextFieldProxyPort.insets = new Insets(5, 5, 5, 220);
        gridBagConstraintsgetJTextFieldProxyPort.weighty = 0.0;
        gridBagConstraintsgetJTextFieldProxyPort.anchor = GridBagConstraints.CENTER;
        gridBagConstraintsgetJTextFieldProxyPort.gridy = 2;
        jPanelValue.add(getJTextFieldProxyPort(), gridBagConstraintsgetJTextFieldProxyPort);

        JLabel jLabelProxyBypass = new JLabel("Proxy Bypass : ", JLabel.RIGHT);
        GridBagConstraints gridBagConstraintsjLabelProxyBypass = new GridBagConstraints();
        gridBagConstraintsjLabelProxyBypass.gridx = 0;
        gridBagConstraintsjLabelProxyBypass.insets = new Insets(0, 20, 0, 0);
        gridBagConstraintsjLabelProxyBypass.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraintsjLabelProxyBypass.weighty = 0.0;
        gridBagConstraintsjLabelProxyBypass.gridy = 3;
        jPanelValue.add(jLabelProxyBypass, gridBagConstraintsjLabelProxyBypass);

        GridBagConstraints gridBagConstraintsgetJTextFieldProxyBypass = new GridBagConstraints();
        gridBagConstraintsgetJTextFieldProxyBypass.gridx = 1;
        gridBagConstraintsgetJTextFieldProxyBypass.weightx = 1.0;
        gridBagConstraintsgetJTextFieldProxyBypass.fill = GridBagConstraints.BOTH;
        gridBagConstraintsgetJTextFieldProxyBypass.insets = new Insets(5, 5, 5, 100);
        gridBagConstraintsgetJTextFieldProxyBypass.weighty = 0.0;
        gridBagConstraintsgetJTextFieldProxyBypass.anchor = GridBagConstraints.CENTER;
        gridBagConstraintsgetJTextFieldProxyBypass.gridy = 3;
        jPanelValue.add(getJTextFieldProxyBypass(), gridBagConstraintsgetJTextFieldProxyBypass);

        //jPanelValue.add(getJPanel(), gridBagConstraints2);

    }
    return jPanelValue;
}

From source file:com.vgi.mafscaling.OpenLoop.java

private void createRunTables(JPanel dataRunPanel) {
    GridBagConstraints gbc_run = new GridBagConstraints();
    gbc_run.anchor = GridBagConstraints.PAGE_START;
    gbc_run.insets = new Insets(0, 2, 0, 2);
    for (int i = 0; i < RunCount; ++i) {
        runTables[i] = new JTable();
        JTable table = runTables[i];
        table.getTableHeader().setReorderingAllowed(false);
        table.setModel(new DefaultTableModel(RunRowsCount, 3));
        table.setColumnSelectionAllowed(true);
        table.setCellSelectionEnabled(true);
        table.setBorder(new LineBorder(new Color(0, 0, 0)));
        table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        table.getColumnModel().getColumn(0)
                .setHeaderValue("<html><center>Engine<br>Speed<br>(RPM)<br></center></html>");
        table.getColumnModel().getColumn(1)
                .setHeaderValue("<html><center>MAF<br>Sensor<br>Voltage<br></center></html>");
        table.getColumnModel().getColumn(2)
                .setHeaderValue("<html><center>AFR<br>Error<br>%<br></center></html>");
        Utils.initializeTable(table, ColumnWidth);
        excelAdapter.addTable(table, true, false);

        gbc_run.gridx = i;//from  www  .  j av a2  s.  c  o  m
        gbc_run.gridy = 0;
        dataRunPanel.add(table.getTableHeader(), gbc_run);
        gbc_run.gridy = 1;
        dataRunPanel.add(table, gbc_run);
    }
}

From source file:gdt.jgui.entity.webset.JWeblinkEditor.java

/**
 * The default constructor./* w w w.j  a v a2  s. c  o m*/
 */
public JWeblinkEditor() {
    GridBagLayout gridBagLayout = new GridBagLayout();
    gridBagLayout.rowHeights = new int[] { 0, 0, 0, 0, 0 };
    gridBagLayout.columnWeights = new double[] { 0.0, 1.0 };
    gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0 };
    setLayout(gridBagLayout);

    String icon$ = Support.readHandlerIcon(null, JEntitiesPanel.class, "globe.png");
    byte[] ba = Base64.decodeBase64(icon$);
    ImageIcon icon = new ImageIcon(ba);
    Image image = icon.getImage().getScaledInstance(24, 24, 0);
    icon.setImage(image);
    JLabel iconLabel = new JLabel("Icon");
    c = new GridBagConstraints();
    c.insets = new Insets(5, 5, 5, 5);
    c.anchor = GridBagConstraints.FIRST_LINE_START;
    c.weighty = 0;
    c.gridx = 0;
    c.gridy = 0;
    add(iconLabel, c);
    iconLabel.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            showIconMenu(e);
        }
    });
    iconIcon = new JLabel();
    iconIcon.setIcon(icon);
    c_0 = new GridBagConstraints();
    c_0.anchor = GridBagConstraints.WEST;
    c_0.insets = new Insets(0, 5, 5, 0);
    c.anchor = GridBagConstraints.WEST;
    c_0.gridx = 1;
    c_0.gridy = 0;
    add(iconIcon, c_0);
    iconIcon.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            showIconMenu(e);
        }
    });
    JLabel lblName = new JLabel("Name");
    c_1 = new GridBagConstraints();
    c_1.insets = new Insets(5, 5, 5, 5);
    c_1.fill = GridBagConstraints.HORIZONTAL;
    c_1.gridx = 0;
    c_1.gridy = 1;
    add(lblName, c_1);

    nameField = new JTextField();
    c_2 = new GridBagConstraints();
    c_2.insets = new Insets(0, 5, 5, 0);
    c_2.fill = GridBagConstraints.HORIZONTAL;
    c_2.gridx = 1;
    c_2.gridy = 1;
    add(nameField, c_2);

    JLabel lblUrl = new JLabel("Address");
    c_3 = new GridBagConstraints();
    c_3.insets = new Insets(5, 5, 5, 5);
    c_3.fill = GridBagConstraints.HORIZONTAL;
    c_3.gridx = 0;
    c_3.gridy = 2;
    add(lblUrl, c_3);

    addressField = new JTextField();
    c_4 = new GridBagConstraints();
    c_4.insets = new Insets(0, 5, 5, 0);
    c_4.fill = GridBagConstraints.HORIZONTAL;
    c_4.gridx = 1;
    c_4.gridy = 2;
    add(addressField, c_4);

    JLabel lblLogin = new JLabel("Login");
    c_5 = new GridBagConstraints();
    c_5.insets = new Insets(5, 5, 5, 5);
    c_5.fill = GridBagConstraints.HORIZONTAL;
    c_5.gridx = 0;
    c_5.gridy = 3;
    add(lblLogin, c_5);
    lblLogin.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            showLoginMenu(e);
        }
    });
    loginField = new JTextField();
    c_6 = new GridBagConstraints();
    c_6.insets = new Insets(0, 5, 5, 0);
    c_6.fill = GridBagConstraints.HORIZONTAL;
    c_6.gridx = 1;
    c_6.gridy = 3;
    add(loginField, c_6);

    JLabel lblPassword = new JLabel("Password");
    c_7 = new GridBagConstraints();
    c_7.insets = new Insets(5, 5, 5, 5);
    c_7.fill = GridBagConstraints.HORIZONTAL;
    c_7.gridx = 0;
    c_7.gridy = 4;
    add(lblPassword, c_7);
    lblPassword.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            showPasswordMenu(e);
        }
    });

    passwordField = new JTextField();
    c_8 = new GridBagConstraints();
    c_8.insets = new Insets(0, 5, 5, 0);
    c_8.fill = GridBagConstraints.HORIZONTAL;
    c_8.gridx = 1;
    c_8.gridy = 4;
    add(passwordField, c_8);

    JPanel bottom = new JPanel();
    c_9 = new GridBagConstraints();
    c_9.weighty = 1;
    c_9.fill = GridBagConstraints.VERTICAL;
    c_9.gridx = 0;
    c_9.gridy = 5;
    add(bottom, c_9);
}

From source file:fr.eurecom.hybris.demogui.HybrisDemoGui.java

private void initializeGUI() {
    frame = new JFrame("Hybris Demo GUI");
    frame.setIconImage(new ImageIcon(getClass().getResource("/clouds.png")).getImage());
    frame.setBounds(100, 100, 650, 500);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().setLayout(new GridBagLayout());

    JPanel cloudParentPanel = new JPanel(new GridLayout(1, 2, 10, 10));
    JPanel hybrisPanel = new JPanel(new GridBagLayout());
    JPanel cloudsPanel = new JPanel(new GridBagLayout());

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.weightx = 1.0;//w  ww .j a  va 2  s.c  o m
    gbc.weighty = 1.0;
    gbc.insets = new Insets(5, 5, 5, 5);

    gbc.anchor = GridBagConstraints.NORTH;
    gbc.fill = GridBagConstraints.BOTH;

    gbc.gridwidth = 3;
    gbc.gridheight = 1;
    gbc.gridx = 0;
    gbc.gridy = 0;
    hybrisPanel.add(new JLabel("<html><b>Hybris</b></html>"), gbc);

    gbc.gridwidth = 3;
    gbc.gridheight = 3;
    gbc.gridx = 0;
    gbc.gridy = 1;

    lstHybris = new JList<String>(lmHybris);
    lstHybris.setPreferredSize(new java.awt.Dimension(100, 500));
    lstHybris.setMinimumSize(new java.awt.Dimension(100, 440));
    hybrisPanel.add(lstHybris, gbc);

    gbc.anchor = GridBagConstraints.SOUTH;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridwidth = 1;
    gbc.gridx = 0;
    gbc.gridy = 4;
    btnPut = new JButton("Put");
    hybrisPanel.add(btnPut, gbc);
    gbc.gridx = 1;
    gbc.gridy = 4;
    btnGet = new JButton("Get");
    hybrisPanel.add(btnGet, gbc);
    gbc.gridx = 2;
    gbc.gridy = 4;
    btnDelete = new JButton("Delete");
    hybrisPanel.add(btnDelete, gbc);

    gbc.fill = GridBagConstraints.BOTH;
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    cloudsPanel.add(new JLabel("<html><b>Amazon S3</b></html>"), gbc);

    gbc.gridheight = 2;
    gbc.gridy = 1;
    lstAmazon = new JList<String>(lmAmazon);
    lstAmazon.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    lstAmazon.setPreferredSize(new java.awt.Dimension(100, 100));
    cloudsPanel.add(lstAmazon, gbc);

    gbc.gridy = 3;
    gbc.gridheight = 1;
    cloudsPanel.add(new JLabel("<html><b>Microsoft Azure</b></html>"), gbc);

    gbc.gridheight = 2;
    gbc.gridy = 4;
    lstAzure = new JList<String>(lmAzure);
    lstAzure.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    lstAzure.setPreferredSize(new java.awt.Dimension(100, 100));
    cloudsPanel.add(lstAzure, gbc);

    gbc.gridy = 6;
    gbc.gridheight = 1;
    cloudsPanel.add(new JLabel("<html><b>Google Cloud Storage</b></html>"), gbc);

    gbc.gridheight = 2;
    gbc.gridy = 7;
    lstGoogle = new JList<String>(lmGoogle);
    lstGoogle.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    lstGoogle.setPreferredSize(new java.awt.Dimension(100, 100));
    cloudsPanel.add(lstGoogle, gbc);

    gbc.gridy = 9;
    gbc.gridheight = 1;
    cloudsPanel.add(new JLabel("<html><b>Rackspace Cloud Files</b></html>"), gbc);

    gbc.gridheight = 2;
    gbc.gridy = 10;
    lstRackspace = new JList<String>(lmRackspace);
    lstRackspace.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    lstRackspace.setPreferredSize(new java.awt.Dimension(100, 100));
    cloudsPanel.add(lstRackspace, gbc);

    cloudParentPanel.add(hybrisPanel);
    cloudParentPanel.add(cloudsPanel);

    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    frame.add(cloudParentPanel, gbc);

    gbc.gridx = 0;
    gbc.gridy = 1;
    JTextArea jt = new JTextArea(10, 30);
    JScrollPane scrollPane = new JScrollPane(jt);
    frame.add(scrollPane, gbc);

    PrintStream printStream = new PrintStream(new CustomOutputStream(jt));
    System.setOut(printStream);
    System.setErr(printStream);

    frame.pack();
    frame.setSize(550, 800);
    frame.setResizable(false);

    lstAmazon.addKeyListener(this);
    lstAzure.addKeyListener(this);
    lstGoogle.addKeyListener(this);
    lstRackspace.addKeyListener(this);
    lstHybris.addKeyListener(this);

    lstAmazon.setCellRenderer(this.new MyListRenderer("amazon"));
    lstGoogle.setCellRenderer(this.new MyListRenderer("google"));
    lstAzure.setCellRenderer(this.new MyListRenderer("azure"));
    lstRackspace.setCellRenderer(this.new MyListRenderer("rackspace"));

    btnGet.addActionListener(this);
    btnPut.addActionListener(this);
    btnDelete.addActionListener(this);
}

From source file:de.codesourcery.jasm16.ide.ui.utils.UIUtils.java

/**
 * //  ww w  .j a  va 2  s  .  com
 * @param parent
 * @param title
 * @param message
 * @return <code>true</code> if project should also be physically deleted,
 * <code>false</code> is project should be deleted but all files should be left alone,
 * <code>null</code> if user cancelled the dialog/project should not be deleted
 */
public static Boolean showDeleteProjectDialog(IAssemblyProject project) {
    final JDialog dialog = new JDialog((Window) null, "Delete project " + project.getName());

    dialog.setModal(true);

    final JTextArea message = createMultiLineLabel(
            "Do you really want to delete project '" + project.getName() + " ?");
    final JCheckBox checkbox = new JCheckBox("Delete project files");

    final DialogResult[] outcome = { DialogResult.CANCEL };

    final JButton yesButton = new JButton("Yes");
    yesButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            outcome[0] = DialogResult.YES;
            dialog.dispose();
        }
    });

    final JButton noButton = new JButton("No");
    noButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            outcome[0] = DialogResult.NO;
            dialog.dispose();
        }
    });
    final JButton cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            outcome[0] = DialogResult.CANCEL;
            dialog.dispose();
        }
    });

    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new FlowLayout());
    buttonPanel.add(yesButton);
    buttonPanel.add(noButton);
    buttonPanel.add(cancelButton);

    final JPanel messagePanel = new JPanel();
    messagePanel.setLayout(new GridBagLayout());

    GridBagConstraints cnstrs = constraints(0, 0, true, false, GridBagConstraints.NONE);
    cnstrs.gridwidth = GridBagConstraints.REMAINDER;
    cnstrs.weighty = 0;
    cnstrs.gridheight = 1;
    messagePanel.add(message, cnstrs);

    cnstrs = constraints(0, 1, true, true, GridBagConstraints.NONE);
    cnstrs.gridwidth = GridBagConstraints.REMAINDER;
    cnstrs.gridheight = 1;
    cnstrs.weighty = 0;
    messagePanel.add(checkbox, cnstrs);

    final JPanel panel = new JPanel();
    panel.setLayout(new GridBagLayout());

    cnstrs = constraints(0, 0, true, false, GridBagConstraints.NONE);
    cnstrs.gridwidth = GridBagConstraints.REMAINDER;
    cnstrs.gridheight = 1;
    cnstrs.weighty = 0;
    cnstrs.insets = new Insets(5, 2, 5, 2); // top,left,bottom,right         
    panel.add(messagePanel, cnstrs);

    cnstrs = constraints(0, 1, true, true, GridBagConstraints.HORIZONTAL);
    cnstrs.gridwidth = GridBagConstraints.REMAINDER;
    cnstrs.gridheight = 1;
    cnstrs.weighty = 0;
    cnstrs.insets = new Insets(0, 2, 10, 2); // top,left,bottom,right      
    panel.add(buttonPanel, cnstrs);

    dialog.getContentPane().add(panel);
    dialog.pack();
    dialog.setVisible(true);

    if (outcome[0] != DialogResult.YES) {
        return null;
    }
    return checkbox.isSelected();
}