Search in sources :

Example 46 with GridBagConstraints

use of java.awt.GridBagConstraints in project OpenNotebook by jaltekruse.

the class ObjectPropertiesFrame method createExpressionModifier.

private JPanel createExpressionModifier() {
    JPanel newPanel = new JPanel();
    newPanel.setLayout(new GridBagLayout());
    ImageIcon pic;
    new OCButton(ExpressionObject.SUB_IN_VALUE, 4, 1, 0, 0, newPanel) {

        public void associatedAction() {
            buttonAction(ExpressionObject.SUB_IN_VALUE);
        }
    };
    new OCButton(ExpressionObject.MODIFY_EXPRESSION, 4, 1, 0, 1, newPanel) {

        public void associatedAction() {
            buttonAction(ExpressionObject.MODIFY_EXPRESSION);
        }
    };
    new OCButton(ExpressionObject.MANUALLY_TYPE_STEP, 4, 1, 0, 2, newPanel) {

        public void associatedAction() {
            buttonAction(ExpressionObject.MANUALLY_TYPE_STEP);
        }
    };
    new OCButton(ExpressionObject.UNDO_STEP, 4, 1, 0, 3, newPanel) {

        public void associatedAction() {
            buttonAction(ExpressionObject.UNDO_STEP);
        }
    };
    GridBagConstraints con = new GridBagConstraints();
    con.fill = GridBagConstraints.HORIZONTAL;
    con.gridx = 0;
    con.gridy = 4;
    con.gridwidth = 4;
    con.weightx = 1;
    con.weighty = .02;
    newPanel.add(new JLabel("Apply to both sides"), con);
    createButton(ExpressionObject.ADD_TO_BOTH_SIDES, 1, 1, 0, 5, newPanel);
    createButton(ExpressionObject.SUBTRACT_FROM_BOTH_SIDES, 1, 1, 1, 5, newPanel);
    createButton(ExpressionObject.MULTIPLY_BOTH_SIDES, 1, 1, 2, 5, newPanel);
    createButton(ExpressionObject.DIVIDE_BOTH_SIDES, 1, 1, 3, 5, newPanel);
    new OCButton(ExpressionObject.OTHER_OPERATIONS, 4, 1, 0, 6, newPanel) {

        public void associatedAction() {
            buttonAction(ExpressionObject.OTHER_OPERATIONS);
        }
    };
    return newPanel;
}
Also used : JPanel(javax.swing.JPanel) ImageIcon(javax.swing.ImageIcon) GridBagConstraints(java.awt.GridBagConstraints) OCButton(doc_gui.OCButton) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel)

Example 47 with GridBagConstraints

use of java.awt.GridBagConstraints in project OpenNotebook by jaltekruse.

the class ObjectPropertiesFrame method generatePanel.

public JPanel generatePanel(Document doc, DocViewerPanel docPanel) {
    JPanel panel = new JPanel();
    if (doc != null) {
        panel.setLayout(new GridBagLayout());
        GridBagConstraints con = new GridBagConstraints();
        con.fill = GridBagConstraints.BOTH;
        con.weightx = 1;
        con.weighty = 1;
        con.insets = new Insets(2, 0, 2, 0);
        con.gridx = 0;
        con.gridy = 0;
        for (MathObjectAttribute mAtt : doc.getAttributes()) {
            if (docPanel.isInStudentMode() && mAtt.isStudentEditable() || !docPanel.isInStudentMode()) {
                // only show editing dialog if in teacher mode (not student)
                //or if the attribute has been left student editable
                panel.add(getAdjuster(mAtt, notebookPanel, panel), con);
                con.gridy++;
            }
        }
    }
    return panel;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) MathObjectAttribute(doc.attributes.MathObjectAttribute) GridBagLayout(java.awt.GridBagLayout)

Example 48 with GridBagConstraints

use of java.awt.GridBagConstraints in project groovy by apache.

the class TableLayout method addCell.

/**
     * Adds a new cell to the current grid
     * @param cell the td component
     */
public void addCell(TableLayoutCell cell) {
    GridBagConstraints constraints = cell.getConstraints();
    constraints.insets = new Insets(cellpadding, cellpadding, cellpadding, cellpadding);
    add(cell.getComponent(), constraints);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets)

Example 49 with GridBagConstraints

use of java.awt.GridBagConstraints in project jreversepro by akkumar.

the class CustomListPanel method addComponents.

/**
   * Adds the components.
   **/
private void addComponents() {
    // GridBagLayout grid = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    c.gridwidth = GridBagConstraints.REMAINDER;
    add(mLblList, c);
    c.gridwidth = 1;
    add(mLblGoto, c);
    add(mTxtIndex, c);
    c.gridwidth = GridBagConstraints.REMAINDER;
    add(mBtnGoto, c);
    c.gridwidth = 1;
    add(mTxtSearch, c);
    add(mChooseType, c);
    c.gridwidth = GridBagConstraints.REMAINDER;
    add(mBtnFind, c);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints)

Example 50 with GridBagConstraints

use of java.awt.GridBagConstraints in project qi4j-sdk by Qi4j.

the class EntityViewer method $$$setupUI$$$.

/**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     */
private void $$$setupUI$$$() {
    mainPane = new JPanel();
    mainPane.setLayout(new BorderLayout(0, 0));
    splitPane = new JSplitPane();
    mainPane.add(splitPane, BorderLayout.CENTER);
    propertiesAreaPane = new JPanel();
    propertiesAreaPane.setLayout(new BorderLayout(0, 0));
    splitPane.setRightComponent(propertiesAreaPane);
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridBagLayout());
    propertiesAreaPane.add(panel1, BorderLayout.NORTH);
    entitiesCombo = new JComboBox();
    GridBagConstraints gbc;
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 0;
    gbc.gridwidth = 3;
    gbc.weightx = 0.3;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(entitiesCombo, gbc);
    final JLabel label1 = new JLabel();
    label1.setText("Entity");
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.WEST;
    panel1.add(label1, gbc);
    final JPanel spacer1 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(spacer1, gbc);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) BorderLayout(java.awt.BorderLayout) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) JLabel(javax.swing.JLabel) JSplitPane(javax.swing.JSplitPane)

Aggregations

GridBagConstraints (java.awt.GridBagConstraints)807 GridBagLayout (java.awt.GridBagLayout)585 Insets (java.awt.Insets)520 JPanel (javax.swing.JPanel)472 JLabel (javax.swing.JLabel)412 Dimension (java.awt.Dimension)156 JButton (javax.swing.JButton)131 ActionEvent (java.awt.event.ActionEvent)123 JScrollPane (javax.swing.JScrollPane)119 ActionListener (java.awt.event.ActionListener)116 JTextField (javax.swing.JTextField)99 BorderLayout (java.awt.BorderLayout)98 JCheckBox (javax.swing.JCheckBox)84 TitledBorder (javax.swing.border.TitledBorder)57 ButtonGroup (javax.swing.ButtonGroup)48 JComboBox (javax.swing.JComboBox)45 Color (java.awt.Color)41 FlowLayout (java.awt.FlowLayout)37 Font (java.awt.Font)36 Border (javax.swing.border.Border)35