Package java.awt

Examples of java.awt.GridBagConstraints


   *
   * @return javax.swing.JPanel
   */
  private JPanel getJContentPane() {
    if (jContentPane == null) {
      GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
      gridBagConstraints1.gridx = 0;
      gridBagConstraints1.insets = new Insets(10, 5, 5, 5);
      gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
      gridBagConstraints1.weightx = 1.0;
      gridBagConstraints1.gridy = 1;
      GridBagConstraints gridBagConstraints = new GridBagConstraints();
      gridBagConstraints.gridx = 0;
      gridBagConstraints.gridy = 0;
      waitTextLabel = new JLabel();
      waitTextLabel.setText(waitText);
      jContentPane = new JPanel();
View Full Code Here


    //Construct language panel option.
    french = new JCheckBox(this.propertiesMgr.getValue("frenchOption"));
    english = new JCheckBox(this.propertiesMgr.getValue("englishOption"));
    languagePanel.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.weightx = 1;
    c.fill = GridBagConstraints.HORIZONTAL;
    languageGroup.add(french);
    languageGroup.add(english);
    c.gridy = 0;
View Full Code Here

        getRootPane().setLayout(new BorderLayout());
        getRootPane().add(panel, BorderLayout.CENTER);
       
        // Parameters
        JLabel nameLabel = new JLabel("Name");
        GridBagConstraints c = new GridBagConstraints();
        c.anchor = GridBagConstraints.WEST;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(nameLabel, c);
        String taskName = (String) workItem.getParameter("TaskName");
        JTextField nameField = new JTextField(
            taskName == null ? "" : taskName);
        nameField.setEditable(false);
        c = new GridBagConstraints();
        c.weightx = 1;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(nameField, c);
       
        JLabel priorityLabel = new JLabel("Priority");
        c = new GridBagConstraints();
        c.gridy = 1;
        c.anchor = GridBagConstraints.WEST;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(priorityLabel, c);
        String priority = (String) workItem.getParameter("Priority");
        JTextField priorityField = new JTextField(
            priority == null ? "" : priority);
        priorityField.setEditable(false);
        c = new GridBagConstraints();
        c.gridy = 1;
        c.weightx = 1;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(priorityField, c);
       
        JLabel commentLabel = new JLabel("Comment");
        c = new GridBagConstraints();
        c.gridy = 2;
        c.anchor = GridBagConstraints.WEST;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(commentLabel, c);
        String comment = (String) workItem.getParameter("Comment");
        JTextArea params = new JTextArea(
            comment == null ? "" : comment);
        params.setEditable(false);
        c = new GridBagConstraints();
        c.gridy = 2;
        c.weightx = 1;
        c.weighty = 1;
        c.fill = GridBagConstraints.BOTH;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(params, c);
       
        int additionalParameters = 0;
        for (Map.Entry<String, Object> entry: workItem.getParameters().entrySet()) {
            String name = entry.getKey();
            if (!"TaskName".equals(name)
                    && !"Priority".equals(name)
                    && !"Comment".equals(name)
                    && !"ActorId".equals(name)) {
                additionalParameters++;
                JLabel label = new JLabel(name);
                c = new GridBagConstraints();
                c.gridy = 2 + additionalParameters;
                c.anchor = GridBagConstraints.WEST;
                c.insets = new Insets(5, 5, 5, 5);
                panel.add(label, c);
                JTextField field = new JTextField(
                    workItem.getParameter(name).toString());
                field.setEditable(false);
                c = new GridBagConstraints();
                c.gridy = 2 + additionalParameters;
                c.weightx = 1;
                c.fill = GridBagConstraints.HORIZONTAL;
                c.insets = new Insets(5, 5, 5, 5);
                panel.add(field, c);
            }
        }
       
        // Result Panel
        JPanel resultPanel = new JPanel();
        resultPanel.setLayout(new GridBagLayout());
        resultPanel.setBorder(new TitledBorder("Results"));
       
        JLabel resultNameLabel = new JLabel("Name");
        c = new GridBagConstraints();
        c.insets = new Insets(5, 5, 5, 5);
        resultPanel.add(resultNameLabel, c);
        resultNameField = new JTextField();
        c = new GridBagConstraints();
        c.weightx = 1;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        resultPanel.add(resultNameField, c);
        JLabel resultValueLabel = new JLabel("Value");
        c = new GridBagConstraints();
        c.insets = new Insets(5, 5, 5, 5);
        resultPanel.add(resultValueLabel, c);
        resultValueField = new JTextField();
        c = new GridBagConstraints();
        c.weightx = 1;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        resultPanel.add(resultValueField, c);
        JButton addResultButton = new JButton("Add");
        addResultButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                addResult();
            }
        });
        c = new GridBagConstraints();
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        resultPanel.add(addResultButton, c);
       
        resultList = new JList();
        resultList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        resultList.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                removeResultButton.setEnabled(resultList.getSelectedIndex() != -1);
            }
        });
        c = new GridBagConstraints();
        c.gridy = 1;
        c.gridwidth = 4;
        c.weightx = 1;
        c.weighty = 1;
        c.fill = GridBagConstraints.BOTH;
        c.insets = new Insets(5, 5, 5, 5);
        JScrollPane scrollPane = new JScrollPane();
        scrollPane.setViewportView(resultList);
        resultPanel.add(scrollPane, c);
        removeResultButton = new JButton("Remove");
        removeResultButton.setEnabled(false);
        removeResultButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                removeResult();
            }
        });
        c = new GridBagConstraints();
        c.gridy = 1;
        c.anchor = GridBagConstraints.NORTH;
        c.insets = new Insets(5, 5, 5, 5);
        resultPanel.add(removeResultButton, c);
       
        c = new GridBagConstraints();
        c.gridy = 3 + additionalParameters;
        c.gridwidth = 2;
        c.weighty = 1;
        c.fill = GridBagConstraints.BOTH;
        panel.add(resultPanel, c);
       
       
        // Buttom Panel
        JPanel bottomPanel = new JPanel();
        bottomPanel.setLayout(new GridBagLayout());
        completeButton = new JButton("Complete");
        completeButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                complete();
            }
        });
        c = new GridBagConstraints();
        c.weightx = 1;
        c.anchor = GridBagConstraints.EAST;
        c.insets = new Insets(5, 5, 5, 5);
        bottomPanel.add(completeButton, c);

        abortButton = new JButton("Abort");
        abortButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                abort();
            }
        });
        c = new GridBagConstraints();
        c.insets = new Insets(5, 5, 5, 5);
        bottomPanel.add(abortButton, c);
       
        c = new GridBagConstraints();
        c.gridy = 4 + additionalParameters;
        c.gridwidth = 2;
        c.fill = GridBagConstraints.BOTH;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(bottomPanel, c);
View Full Code Here

        panel.setLayout(new GridBagLayout());
        getRootPane().setLayout(new BorderLayout());
        getRootPane().add(panel, BorderLayout.CENTER);
       
        JLabel label = new JLabel("Actor");
        GridBagConstraints c = new GridBagConstraints();
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(label, c);
        actorTextField = new JTextField();
        c = new GridBagConstraints();
        c.weightx = 1;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(actorTextField, c);
        JButton updateButton = new JButton("Update");
        updateButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                update();
            }
        });
        c = new GridBagConstraints();
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(updateButton, c);
       
        workItemsList = new JList();
        workItemsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        workItemsList.addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() == 2) {
                    select();
                }
            }
        });
        workItemsList.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                selectButton.setEnabled(getSelectedWorkItem() != null);
            }
        });
        c = new GridBagConstraints();
        c.gridy = 1;
        c.weightx = 1;
        c.weighty = 1;
        c.gridwidth = 3;
        c.fill = GridBagConstraints.BOTH;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(workItemsList, c);
       
        selectButton = new JButton("Select");
        selectButton.setEnabled(false);
        selectButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                select();
            }
        });
        c = new GridBagConstraints();
        c.gridy = 2;
        c.weightx = 1;
        c.gridwidth = 3;
        c.anchor = GridBagConstraints.EAST;
        c.insets = new Insets(5, 5, 5, 5);
View Full Code Here

            public void valueChanged(ListSelectionEvent e) {
                selectButton.setEnabled(getSelectedWorkItem() != null);
            }
        });
        reloadWorkItemsList();
        GridBagConstraints c = new GridBagConstraints();
        c.weightx = 1;
        c.weighty = 1;
        c.fill = GridBagConstraints.BOTH;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(workItemsList, c);
       
        selectButton = new JButton("Select");
        selectButton.setEnabled(false);
        selectButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                select();
            }
        });
        c = new GridBagConstraints();
        c.gridy = 1;
        c.weightx = 1;
        c.anchor = GridBagConstraints.EAST;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(selectButton, c);
View Full Code Here

        getRootPane().add(panel, BorderLayout.CENTER);
       
        JTextArea params = new JTextArea();
        params.setText(getParameters());
        params.setEditable(false);
        GridBagConstraints c = new GridBagConstraints();
        c.weightx = 1;
        c.weighty = 1;
        c.gridwidth = 5;
        c.fill = GridBagConstraints.BOTH;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(params, c);
       
        JLabel resultName = new JLabel("Result");
        c = new GridBagConstraints();
        c.gridy = 1;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(resultName, c);
        resultNameTextField = new JTextField();
        c = new GridBagConstraints();
        c.gridx = 1;
        c.gridy = 1;
        c.weightx = 0.3;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(resultNameTextField, c);
       
        JLabel resultValue = new JLabel("Value");
        c = new GridBagConstraints();
        c.gridx = 2;
        c.gridy = 1;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(resultValue, c);
        resultValueTextField = new JTextField();
        c = new GridBagConstraints();
        c.gridx = 3;
        c.gridy = 1;
        c.weightx = 0.7;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(resultValueTextField, c);
       
        addResultButton = new JButton("Add");
        addResultButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                addResult();
            }
        });
        c = new GridBagConstraints();
        c.gridx = 4;
        c.gridy = 1;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(addResultButton, c);
       
        completeButton = new JButton("Complete");
        completeButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                complete();
            }
        });
        c = new GridBagConstraints();
        c.gridy = 2;
        c.weightx = 1;
        c.gridwidth = 4;
        c.anchor = GridBagConstraints.EAST;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(completeButton, c);

        abortButton = new JButton("Abort");
        abortButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                abort();
            }
        });
        c = new GridBagConstraints();
        c.gridx = 4;
        c.gridy = 2;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(abortButton, c);
    }
View Full Code Here

/**
* Builds the panel.
*/
protected void buildPanel() {
    GridBagLayout bag = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    c.insets = new Insets(6, 6, 6, 6);
    panel = new JPanel();
    panel.setLayout(bag);
    if (border != null)
  panel.setBorder(border);
View Full Code Here

    setLayout(new GridBagLayout());
    parameterEditorFactory = new DefaultParameterComponentFactory();
    updateContext = new InternalParameterUpdateHandler();

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridy = 0;
    gbc.gridx = 0;
    gbc.gridwidth = 2;
    gbc.anchor = GridBagConstraints.WEST;
    add(globalErrorMessage, gbc);

    gbc = new GridBagConstraints();
    gbc.gridy = 1;
    gbc.gridx = 0;
    gbc.gridwidth = 2;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weightx = 1;
    gbc.weighty = 1;
    gbc.anchor = GridBagConstraints.WEST;
    final JScrollPane scrollPane = new JScrollPane(carrierPanel);
    scrollPane.getViewport().setBackground(carrierPanel.getBackground());
    add(scrollPane, gbc);

    final JPanel buttonPane = new JPanel();
    buttonPane.setLayout(new GridLayout(1, 1));
    buttonPane.add(updateButton);
    gbc = new GridBagConstraints();
    gbc.gridy = 2;
    gbc.gridx = 1;
    gbc.anchor = GridBagConstraints.EAST;
    add(buttonPane, gbc);

    final JPanel cbPane = new JPanel();
    cbPane.setLayout(new GridLayout(1, 1));
    cbPane.add(autoUpdateCheckbox);
    gbc = new GridBagConstraints();
    gbc.gridy = 2;
    gbc.gridx = 0;
    gbc.anchor = GridBagConstraints.WEST;
    add(cbPane, gbc);
View Full Code Here

  {
    final JLabel label = new JLabel(computeLabel(entry));
    final JLabel errorLabel = new JLabel();
    errorLabels.put(entry.getName(), errorLabel);

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridy = gridY;
    gbc.gridx = 0;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.weightx = 0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.insets = new Insets(5, 5, 0, 5);
    carrierPanel.add(label, gbc);


    if (entry.isMandatory())
    {
      gbc = new GridBagConstraints();
      gbc.gridy = gridY;
      gbc.gridx = 1;
      gbc.anchor = GridBagConstraints.WEST;
      gbc.insets = new Insets(5, 0, 0, 0);
      final JLabel mandatoryLabel = new JLabel("*");
      mandatoryLabel.setToolTipText(messages.getString("ParameterReportControllerPane.MandatoryParameter"));
      carrierPanel.add(mandatoryLabel, gbc);
    }

    gbc = new GridBagConstraints();
    gbc.gridy = gridY;
    gbc.gridx = 2;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.weightx = 1;
    if (editor instanceof ButtonParameterComponent)
    {
      gbc.fill = GridBagConstraints.HORIZONTAL;
    }
    gbc.ipadx = 100;
    gbc.insets = new Insets(5, 0, 0, 0);
    carrierPanel.add(editor, gbc);

    gbc = new GridBagConstraints();
    gbc.gridy = gridY + 1;
    gbc.gridx = 1;
    gbc.anchor = GridBagConstraints.NORTH;
    gbc.weightx = 1;
    gbc.gridwidth = 2;
View Full Code Here

    scroller = new JScrollPane(backtraceArea);
    scroller.setVisible(false);

    final JPanel detailPane = new JPanel();
    detailPane.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.CENTER;
    gbc.fill = GridBagConstraints.NONE;
    gbc.weightx = 0;
    gbc.weighty = 0;
    gbc.gridx = 0;
    gbc.gridy = 0;
    final JLabel icon = new JLabel(UIManager.getDefaults().getIcon("OptionPane.errorIcon")); //$NON-NLS-1$
    icon.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    detailPane.add(icon, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.NONE;
    gbc.weightx = 1;
    gbc.weighty = 1;
    gbc.gridx = 1;
    gbc.gridy = 0;
    detailPane.add(messageLabel);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.SOUTH;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 0;
    gbc.weighty = 0;
    gbc.gridx = 0;
    gbc.gridy = 2;
    gbc.gridwidth = 2;
    detailPane.add(createButtonPane(), gbc);

    filler = new JPanel();
    filler.setPreferredSize(new Dimension(0, 0));
    filler.setBackground(Color.green);
    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.NORTH;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 1;
    gbc.weighty = 5;
    gbc.gridx = 0;
    gbc.gridy = 3;
    gbc.gridwidth = 2;
    detailPane.add(filler, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.SOUTHWEST;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weightx = 1;
    gbc.weighty = 5;
    gbc.gridx = 0;
View Full Code Here

TOP

Related Classes of java.awt.GridBagConstraints

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.