Search in sources :

Example 46 with GridBagLayout

use of java.awt.GridBagLayout 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 47 with GridBagLayout

use of java.awt.GridBagLayout 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)

Example 48 with GridBagLayout

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

the class DependencyPane method $$$setupUI$$$.

/**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     */
private void $$$setupUI$$$() {
    contentPane = new JPanel();
    contentPane.setLayout(new BorderLayout(0, 0));
    splitPane = new JSplitPane();
    contentPane.add(splitPane, BorderLayout.CENTER);
    final JScrollPane scrollPane1 = new JScrollPane();
    splitPane.setLeftComponent(scrollPane1);
    fieldList = new JList();
    scrollPane1.setViewportView(fieldList);
    detailPane = new JPanel();
    detailPane.setLayout(new GridBagLayout());
    splitPane.setRightComponent(detailPane);
    detailPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8), null));
    final JLabel label1 = new JLabel();
    this.$$$loadLabelText$$$(label1, ResourceBundle.getBundle("org/qi4j/envisage/detail/DependencyPane").getString("CTL_ClassName.Text"));
    GridBagConstraints gbc;
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.EAST;
    detailPane.add(label1, gbc);
    final JPanel spacer1 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    detailPane.add(spacer1, gbc);
    final JPanel spacer2 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.fill = GridBagConstraints.VERTICAL;
    detailPane.add(spacer2, gbc);
    final JLabel label2 = new JLabel();
    this.$$$loadLabelText$$$(label2, ResourceBundle.getBundle("org/qi4j/envisage/detail/DependencyPane").getString("CTL_Optional.Text"));
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 2;
    gbc.anchor = GridBagConstraints.EAST;
    detailPane.add(label2, gbc);
    final JLabel label3 = new JLabel();
    this.$$$loadLabelText$$$(label3, ResourceBundle.getBundle("org/qi4j/envisage/detail/DependencyPane").getString("CTL_Annotation.Text"));
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 4;
    gbc.anchor = GridBagConstraints.EAST;
    detailPane.add(label3, gbc);
    final JPanel spacer3 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 3;
    gbc.fill = GridBagConstraints.VERTICAL;
    detailPane.add(spacer3, gbc);
    final JPanel spacer4 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 5;
    gbc.fill = GridBagConstraints.VERTICAL;
    detailPane.add(spacer4, gbc);
    final JPanel spacer5 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 9;
    gbc.fill = GridBagConstraints.VERTICAL;
    detailPane.add(spacer5, gbc);
    final JLabel label4 = new JLabel();
    this.$$$loadLabelText$$$(label4, ResourceBundle.getBundle("org/qi4j/envisage/detail/DependencyPane").getString("CTL_InjectionType.Text"));
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 10;
    gbc.anchor = GridBagConstraints.EAST;
    detailPane.add(label4, gbc);
    classNameLabel = new JLabel();
    classNameLabel.setText("none");
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 0;
    gbc.weightx = 1.0;
    gbc.anchor = GridBagConstraints.WEST;
    detailPane.add(classNameLabel, gbc);
    annotationLabel = new JLabel();
    annotationLabel.setText("none");
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 4;
    gbc.anchor = GridBagConstraints.WEST;
    detailPane.add(annotationLabel, gbc);
    injectionTypeLabel = new JLabel();
    injectionTypeLabel.setText("none");
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 10;
    gbc.anchor = GridBagConstraints.WEST;
    detailPane.add(injectionTypeLabel, gbc);
    optionalLabel = new JLabel();
    optionalLabel.setText("none");
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 2;
    gbc.anchor = GridBagConstraints.WEST;
    detailPane.add(optionalLabel, gbc);
    final JPanel spacer6 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 7;
    gbc.fill = GridBagConstraints.VERTICAL;
    detailPane.add(spacer6, gbc);
    final JLabel label5 = new JLabel();
    this.$$$loadLabelText$$$(label5, ResourceBundle.getBundle("org/qi4j/envisage/detail/DependencyPane").getString("CTL_Injection.Text"));
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 8;
    gbc.anchor = GridBagConstraints.WEST;
    detailPane.add(label5, gbc);
    final JScrollPane scrollPane2 = new JScrollPane();
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 12;
    gbc.weighty = 1.0;
    gbc.fill = GridBagConstraints.BOTH;
    detailPane.add(scrollPane2, gbc);
    injectedServiceList = new JList();
    scrollPane2.setViewportView(injectedServiceList);
    final JPanel spacer7 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 11;
    gbc.fill = GridBagConstraints.VERTICAL;
    detailPane.add(spacer7, gbc);
    final JLabel label6 = new JLabel();
    this.$$$loadLabelText$$$(label6, ResourceBundle.getBundle("org/qi4j/envisage/detail/DependencyPane").getString("CTL_InjectedServices.Text"));
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 12;
    gbc.anchor = GridBagConstraints.NORTHEAST;
    detailPane.add(label6, gbc);
    final JSeparator separator1 = new JSeparator();
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 6;
    gbc.gridwidth = 3;
    gbc.fill = GridBagConstraints.BOTH;
    detailPane.add(separator1, gbc);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) BorderLayout(java.awt.BorderLayout) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) JSplitPane(javax.swing.JSplitPane) JList(javax.swing.JList) JSeparator(javax.swing.JSeparator)

Example 49 with GridBagLayout

use of java.awt.GridBagLayout in project pcgen by PCGen.

the class InfoGuidePane method initComponents.

private void initComponents() {
    mainPanel = new JPanel();
    mainPanel.setBorder(BorderFactory.createTitledBorder(null, "", TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION, null));
    mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
    mainPanel.setPreferredSize(new Dimension(650, 450));
    setOpaque(false);
    JPanel sourcesPanel = new JPanel(new GridBagLayout());
    GridBagConstraints gbc1 = new GridBagConstraints();
    gbc1.anchor = GridBagConstraints.EAST;
    GridBagConstraints gbc2 = new GridBagConstraints();
    gbc2.gridwidth = GridBagConstraints.REMAINDER;
    gbc2.fill = GridBagConstraints.BOTH;
    sourcesPanel.add(new JLabel(LanguageBundle.getString("in_si_intro")), gbc2);
    sourcesPanel.add(new JLabel(LanguageBundle.getString("in_si_gamemode")), gbc1);
    sourcesPanel.add(gameModeLabel, gbc2);
    sourcesPanel.add(new JLabel(LanguageBundle.getString("in_si_sources")), gbc1);
    sourcesPanel.add(campaignList, gbc2);
    JEditorPane guidePane = createHtmlPane();
    guidePane.setText(LanguageBundle.getFormattedString("in_si_whatnext", Icons.New16.getImageIcon(), Icons.Open16.getImageIcon()));
    mainPanel.add(sourcesPanel);
    mainPanel.add(guidePane);
    mainPanel.add(tipPane);
    refreshDisplayedSources(null);
    JPanel outerPanel = new JPanel(new FlowLayout());
    outerPanel.add(mainPanel);
    setLayout(new BorderLayout());
    add(outerPanel, BorderLayout.CENTER);
    tipPane.setText(LanguageBundle.getFormattedString("in_si_tip", TipOfTheDayHandler.getInstance().getNextTip()));
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) FlowLayout(java.awt.FlowLayout) GridBagLayout(java.awt.GridBagLayout) BorderLayout(java.awt.BorderLayout) BoxLayout(javax.swing.BoxLayout) JEditorPane(javax.swing.JEditorPane) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension)

Example 50 with GridBagLayout

use of java.awt.GridBagLayout in project pcgen by PCGen.

the class SummaryInfoTab method initRightPanel.

private void initRightPanel(JPanel rightPanel) {
    rightPanel.setLayout(new GridBagLayout());
    /*
		 * initialize Components
		 */
    racePanel.setOpaque(false);
    classPanel.setOpaque(false);
    ageField.setHorizontalAlignment(SwingConstants.RIGHT);
    expField.setHorizontalAlignment(SwingConstants.RIGHT);
    nextlevelField.setHorizontalAlignment(SwingConstants.RIGHT);
    nextlevelField.setEnabled(false);
    expmodField.setHorizontalAlignment(SwingConstants.RIGHT);
    //$NON-NLS-1$
    raceComboBox.setPrototypeDisplayValue("PrototypeDisplayValue");
    //$NON-NLS-1$
    classComboBox.setPrototypeDisplayValue("PrototypeDisplayValue");
    expaddButton.setMargin(new Insets(0, 8, 0, 8));
    expsubtractButton.setMargin(new Insets(0, 8, 0, 8));
    hpButton.setMargin(new Insets(0, 0, 0, 0));
    JPanel expmodPanel = new JPanel(new GridBagLayout());
    JPanel levelPanel = new JPanel();
    //$NON-NLS-1$
    JLabel raceLabel = createLabel("in_sumRace");
    //$NON-NLS-1$
    JLabel ageLabel = createLabel("in_sumAge");
    //$NON-NLS-1$
    JLabel classLabel = createLabel("in_sumClass");
    //$NON-NLS-1$
    JLabel hpLabel = createLabel("in_sumTotalHP");
    //$NON-NLS-1$
    JLabel expLabel = createLabel("in_sumCurrentXp");
    //$NON-NLS-1$
    JLabel nextlevelLabel = createLabel("in_sumNextlevel");
    //$NON-NLS-1$
    JLabel xpTableLabel = createLabel("in_sumXpTable");
    //$NON-NLS-1$
    JLabel expmodLabel = createLabel("in_sumExpMod");
    expmodLabel.setHorizontalAlignment(SwingConstants.CENTER);
    initLevelPanel(levelPanel);
    /*
		 * initialize constant variables
		 */
    Insets racePanelInsets = racePanel.getInsets();
    Insets classPanelInsets = classPanel.getInsets();
    /*
		 * racePanel
		 */
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.BOTH;
    gbc.insets = new Insets(racePanelInsets.top, racePanelInsets.left, 0, 0);
    gbc.gridwidth = 2;
    rightPanel.add(raceLabel, gbc);
    gbc.insets = new Insets(racePanelInsets.top, 1, 1, racePanelInsets.right);
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    rightPanel.add(raceComboBox, gbc);
    gbc.insets = new Insets(0, racePanelInsets.left, 0, 1);
    gbc.gridwidth = 1;
    rightPanel.add(ageLabel, gbc);
    gbc.insets = new Insets(1, 1, 1, 1);
    rightPanel.add(ageField, gbc);
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbc.insets = new Insets(1, 1, 1, racePanelInsets.right);
    rightPanel.add(ageComboBox, gbc);
    gbc.insets = new Insets(1, racePanelInsets.left, racePanelInsets.bottom, racePanelInsets.right);
    rightPanel.add(createMonsterButton, gbc);
    /*
		 * classPanel
		 */
    gbc.gridwidth = 2;
    gbc.insets = new Insets(classPanelInsets.top, classPanelInsets.left, 0, 0);
    rightPanel.add(classLabel, gbc);
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbc.insets = new Insets(classPanelInsets.top, 0, 0, classPanelInsets.right);
    rightPanel.add(classComboBox, gbc);
    gbc.weighty = 1;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.insets = new Insets(7, classPanelInsets.left, 0, classPanelInsets.right);
    rightPanel.add(levelPanel, gbc);
    gbc.insets.top = 0;
    gbc.insets.bottom = 10;
    gbc.weighty = 0;
    {
        JPanel hpPanel = new JPanel(new FlowLayout());
        hpPanel.add(hpLabel);
        hpPanel.add(Box.createHorizontalStrut(3));
        hpPanel.add(totalHPLabel);
        hpPanel.add(hpButton);
        rightPanel.add(hpPanel, gbc);
    }
    gbc.insets.bottom = 0;
    //gbc.ipady = 20;
    GridBagConstraints leftgbc = new GridBagConstraints();
    leftgbc.insets = new Insets(0, classPanelInsets.left, 0, 0);
    leftgbc.gridwidth = 2;
    leftgbc.fill = GridBagConstraints.BOTH;
    GridBagConstraints rightgbc = new GridBagConstraints();
    rightgbc.insets = new Insets(0, 0, 0, classPanelInsets.right);
    rightgbc.gridwidth = GridBagConstraints.REMAINDER;
    rightgbc.fill = GridBagConstraints.BOTH;
    rightPanel.add(expLabel, leftgbc);
    rightPanel.add(expField, rightgbc);
    rightPanel.add(nextlevelLabel, leftgbc);
    rightPanel.add(nextlevelField, rightgbc);
    rightPanel.add(xpTableLabel, leftgbc);
    rightPanel.add(xpTableComboBox, rightgbc);
    gbc.insets.top = 10;
    rightPanel.add(expmodLabel, gbc);
    {
        GridBagConstraints gbc2 = new GridBagConstraints();
        gbc2.fill = GridBagConstraints.HORIZONTAL;
        gbc2.weightx = 1.0;
        gbc2.insets = new Insets(0, 1, 0, 1);
        expmodPanel.add(expaddButton, gbc2);
        expmodPanel.add(expsubtractButton, gbc2);
    }
    leftgbc.insets.bottom = classPanelInsets.bottom;
    leftgbc.weightx = 0.3;
    rightPanel.add(expmodPanel, leftgbc);
    rightgbc.insets.bottom = classPanelInsets.bottom;
    rightgbc.weightx = 0.7;
    rightPanel.add(expmodField, rightgbc);
    gbc = new GridBagConstraints();
    gbc.gridx = gbc.gridy = 0;
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbc.gridheight = 3;
    gbc.fill = GridBagConstraints.BOTH;
    rightPanel.add(racePanel, gbc);
    gbc.gridy = 3;
    gbc.gridheight = GridBagConstraints.REMAINDER;
    rightPanel.add(classPanel, gbc);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) FlowLayout(java.awt.FlowLayout) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel)

Aggregations

GridBagLayout (java.awt.GridBagLayout)739 GridBagConstraints (java.awt.GridBagConstraints)576 JPanel (javax.swing.JPanel)532 JLabel (javax.swing.JLabel)425 Insets (java.awt.Insets)409 Dimension (java.awt.Dimension)182 JScrollPane (javax.swing.JScrollPane)147 JButton (javax.swing.JButton)143 ActionEvent (java.awt.event.ActionEvent)136 ActionListener (java.awt.event.ActionListener)115 JTextField (javax.swing.JTextField)100 BorderLayout (java.awt.BorderLayout)96 JCheckBox (javax.swing.JCheckBox)79 BoxLayout (javax.swing.BoxLayout)66 ButtonGroup (javax.swing.ButtonGroup)56 TitledBorder (javax.swing.border.TitledBorder)48 JComboBox (javax.swing.JComboBox)46 FlowLayout (java.awt.FlowLayout)42 JRadioButton (javax.swing.JRadioButton)36 Color (java.awt.Color)34