Java Code Examples for javax.swing.GroupLayout#createSequentialGroup()
The following examples show how to use
javax.swing.GroupLayout#createSequentialGroup() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FormLayoutHelper.java From netbeans with Apache License 2.0 | 6 votes |
public FormLayoutHelper(JPanel panel, Column... columns) { this.panel = panel; layout = new GroupLayout(panel); panel.setLayout(layout); horizontalGroup = layout.createSequentialGroup(); verticalGroup = layout.createSequentialGroup(); this.columns = columns; columnGroups = new Group[columns.length]; for (int i = 0; i < columns.length; i++) { Group columnGroup = columns[i].createParallelGroup(layout); columnGroups[i] = columnGroup; horizontalGroup.addGroup(columnGroup); } layout.setHorizontalGroup(horizontalGroup); layout.setVerticalGroup(verticalGroup); }
Example 2
Source File: OperationDescriptionPanel.java From netbeans with Apache License 2.0 | 6 votes |
private GroupLayout.ParallelGroup getVerticalGroup (GroupLayout layout, boolean hasPrimary, boolean hasRequired) { GroupLayout.ParallelGroup res = layout.createParallelGroup (/* XXX huh? GroupLayout.PREFERRED_SIZE*/); GroupLayout.SequentialGroup seq = layout.createSequentialGroup (); if (hasPrimary) { seq.addComponent (tpPrimaryTitle, GroupLayout.DEFAULT_SIZE, 40, 40) .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED) .addComponent (tpPrimaryPlugins, GroupLayout.PREFERRED_SIZE, tpPrimaryPlugins.getPreferredSize ().height, GroupLayout.PREFERRED_SIZE) .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED) .addGap (0, 30, 30); } if (hasRequired) { seq.addComponent (tpDependingTitle, GroupLayout.DEFAULT_SIZE, 80, 80) .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED) .addComponent (tpDependingPlugins, GroupLayout.PREFERRED_SIZE, tpDependingPlugins.getPreferredSize ().height, GroupLayout.PREFERRED_SIZE) .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED); } res.addGroup (seq); return res; }
Example 3
Source File: CssPrepOptionsPanel.java From netbeans with Apache License 2.0 | 6 votes |
private void init() { errorLabel.setText(" "); // NOI18N GroupLayout containerPanelLayout = new GroupLayout(containerPanel); containerPanel.setLayout(containerPanelLayout); GroupLayout.ParallelGroup horizontalGroup = containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING); GroupLayout.SequentialGroup verticalGroup = containerPanelLayout.createSequentialGroup(); containerPanelLayout.setHorizontalGroup(horizontalGroup); containerPanelLayout.setVerticalGroup( containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(verticalGroup) ); for (CssPreprocessorUIImplementation.Options options : allOptions) { JComponent component = options.getComponent(); Parameters.notNull("component", component); // NOI18N horizontalGroup.addComponent(component, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE); verticalGroup.addComponent(component, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED); } }
Example 4
Source File: StockpileDialog.java From jeveassets with GNU General Public License v2.0 | 6 votes |
private void updatePanels() { jFiltersPanel.removeAll(); GroupLayout groupLayout = new GroupLayout(jFiltersPanel); jFiltersPanel.setLayout(groupLayout); groupLayout.setAutoCreateGaps(true); groupLayout.setAutoCreateContainerGaps(false); ParallelGroup horizontalGroup = groupLayout.createParallelGroup(); SequentialGroup verticalGroup = groupLayout.createSequentialGroup(); for (LocationPanel locationPanel : locationPanels) { horizontalGroup.addComponent(locationPanel.getPanel()); verticalGroup.addComponent(locationPanel.getPanel()); } jFiltersPanel.setVisible(!locationPanels.isEmpty()); groupLayout.setHorizontalGroup(horizontalGroup); groupLayout.setVerticalGroup(verticalGroup); autoValidate(); this.getDialog().pack(); }
Example 5
Source File: CollapsibleSectionPanel.java From netbeans with Apache License 2.0 | 5 votes |
public ActionsBuilder (JPanel panel, FocusListener listener) { this.focusListener = listener; panel.removeAll(); GroupLayout layout = (GroupLayout) panel.getLayout(); horizontalSeqGroup = layout.createSequentialGroup(); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(horizontalSeqGroup) ); verticalParallelGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(verticalParallelGroup) ); }
Example 6
Source File: SectionPanel.java From netbeans with Apache License 2.0 | 5 votes |
public ActionsBuilder (JPanel panel) { panel.removeAll(); GroupLayout layout = (GroupLayout) panel.getLayout(); horizontalSeqGroup = layout.createSequentialGroup(); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(horizontalSeqGroup) ); verticalParallelGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(verticalParallelGroup) ); }
Example 7
Source File: StockpileDialog.java From jeveassets with GNU General Public License v2.0 | 5 votes |
private void doLayout() { autoValidate(); jFilters.removeAll(); GroupLayout layout = new GroupLayout(jFilters); jFilters.setLayout(layout); layout.setAutoCreateGaps(true); layout.setAutoCreateContainerGaps(false); ParallelGroup horizontalGroup = layout.createParallelGroup(); SequentialGroup verticalGroup = layout.createSequentialGroup(); for (FilterPanel ownerPanel : ownerPanels) { horizontalGroup.addComponent(ownerPanel.getPanel()); verticalGroup.addComponent(ownerPanel.getPanel()); } for (FilterPanel flagPanel : flagPanels) { horizontalGroup.addComponent(flagPanel.getPanel()); verticalGroup.addComponent(flagPanel.getPanel()); } for (FilterPanel containerPanel : containerPanels) { horizontalGroup.addComponent(containerPanel.getPanel()); verticalGroup.addComponent(containerPanel.getPanel()); } if (singletonPanel != null) { horizontalGroup.addComponent(singletonPanel.getPanel()); verticalGroup.addComponent(singletonPanel.getPanel()); } layout.setVerticalGroup(verticalGroup); layout.setHorizontalGroup(horizontalGroup); getDialog().pack(); }
Example 8
Source File: OptionsDialog.java From CQL with GNU Affero General Public License v3.0 | 4 votes |
/** * Creates a JPanel with the specified options. Interal use only. * * @param opts the options * @return a jpanel */ private static JPanel optionsPanel(final List<Option> opts) { final JPanel options = new JPanel(); final GroupLayout gl = new GroupLayout(options); options.setLayout(gl); gl.setAutoCreateGaps(true); gl.setAutoCreateContainerGaps(true); final GroupLayout.ParallelGroup labels = gl.createParallelGroup(); final GroupLayout.ParallelGroup values = gl.createParallelGroup(); final GroupLayout.ParallelGroup titles = gl.createParallelGroup(); final GroupLayout.ParallelGroup horiz = gl.createParallelGroup(); final GroupLayout.SequentialGroup cols = gl.createSequentialGroup(); final GroupLayout.SequentialGroup rows = gl.createSequentialGroup(); cols.addGroup(labels); cols.addGroup(values); horiz.addGroup(cols); horiz.addGroup(titles); for (final Option o : opts) { final JLabel l = o.getLabel(); final JComponent c = o.getComponent(); if (c == null) { // This is a label-only row, allowed to take up the whole row titles.addComponent(l); rows.addComponent(l); } else { if (l.getBorder() == null) { l.setBorder(new EmptyBorder(3, 0, 0, 0)); } if (l.getLabelFor() == null) { l.setLabelFor(c); } labels.addComponent(l); values.addComponent(c); final GroupLayout.ParallelGroup row = gl.createParallelGroup(GroupLayout.Alignment.BASELINE); row.addComponent(l); row.addComponent(c); rows.addGroup(row); } } gl.setHorizontalGroup(horiz); gl.setVerticalGroup(rows); return options; }
Example 9
Source File: I18nPanel.java From netbeans with Apache License 2.0 | 4 votes |
/** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the FormEditor. */ // <editor-fold defaultstate="collapsed" desc="UI Initialization Code"> private void initComponents() { contentsPanelPlaceholder = new JPanel(cardLayout); if (withButtons) { replaceButton = new JButton(); skipButton = new JButton(); ignoreButton = new JButton(); infoButton = new JButton(); cancelButton = new JButton(); helpButton = new JButton(); Mnemonics.setLocalizedText(replaceButton, bundle.getString("CTL_ReplaceButton")); // NOI18N Mnemonics.setLocalizedText(skipButton, bundle.getString("CTL_SkipButton")); // NOI18N Mnemonics.setLocalizedText(ignoreButton, bundle.getString("CTL_IgnoreButton")); // NOI18N Mnemonics.setLocalizedText(infoButton, bundle.getString("CTL_InfoButton")); // NOI18N Mnemonics.setLocalizedText(cancelButton, bundle.getString("CTL_CloseButton")); // NOI18N Mnemonics.setLocalizedText(helpButton, bundle.getString("CTL_HelpButton")); // NOI18N helpButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { helpButtonActionPerformed(evt); } }); } GroupLayout layout; setLayout (layout = new GroupLayout(this)); GroupLayout.SequentialGroup horizGroup = layout.createSequentialGroup(); horizGroup.addContainerGap(); if (withButtons) { horizGroup.addGroup( layout.createParallelGroup(TRAILING) .addComponent(contentsPanelPlaceholder) .addGroup(layout.createSequentialGroup() .addComponent(replaceButton) .addPreferredGap(RELATED) .addComponent(skipButton) .addPreferredGap(RELATED) .addComponent(ignoreButton) .addPreferredGap(RELATED) .addComponent(infoButton) .addPreferredGap(RELATED) .addComponent(cancelButton) .addPreferredGap(RELATED) .addComponent(helpButton))); layout.linkSize(SwingConstants.HORIZONTAL, cancelButton, helpButton, infoButton, replaceButton, ignoreButton, skipButton); } else { horizGroup.addComponent(contentsPanelPlaceholder); } horizGroup.addContainerGap(); layout.setHorizontalGroup(horizGroup); GroupLayout.SequentialGroup vertGroup = layout.createSequentialGroup(); vertGroup.addContainerGap(); vertGroup.addComponent(contentsPanelPlaceholder); if (withButtons) { vertGroup .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(BASELINE) .addComponent(helpButton) .addComponent(cancelButton) .addComponent(infoButton) .addComponent(skipButton) .addComponent(ignoreButton) .addComponent(replaceButton)); } vertGroup.addContainerGap(); layout.setVerticalGroup(vertGroup); }
Example 10
Source File: CustomizerTesting.java From netbeans with Apache License 2.0 | 4 votes |
@NbBundle.Messages("CustomizerTesting.testingProviders.noneInstalled=No PHP testing provider found, install one via Plugins (e.g. PHPUnit).") private void initProvidersPanel() { List<PhpTestingProvider> allTestingProviders = PhpTesting.getTestingProviders(); if (allTestingProviders.isEmpty()) { category.setErrorMessage(Bundle.CustomizerTesting_testingProviders_noneInstalled()); category.setValid(true); return; } List<String> currentTestingProviders = uiProps.getTestingProviders(); GroupLayout providersPanelLayout = new GroupLayout(providersPanel); GroupLayout.ParallelGroup horizontalGroup = providersPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING); GroupLayout.SequentialGroup verticalGroup = providersPanelLayout.createSequentialGroup(); boolean first = true; final Collator collator = Collator.getInstance(); Collections.sort(allTestingProviders, new Comparator<PhpTestingProvider>() { @Override public int compare(PhpTestingProvider provider1, PhpTestingProvider provider2) { return collator.compare(provider1.getDisplayName(), provider2.getDisplayName()); } }); for (PhpTestingProvider testingProvider : allTestingProviders) { String identifier = testingProvider.getIdentifier(); JCheckBox checkBox = new JCheckBox(testingProvider.getDisplayName()); checkBox.addItemListener(new TestingProviderListener(identifier)); if (currentTestingProviders.contains(identifier)) { checkBox.setSelected(true); } horizontalGroup.addComponent(checkBox); verticalGroup.addComponent(checkBox); if (first) { first = false; } else { verticalGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED); } } providersPanel.setLayout(providersPanelLayout); providersPanelLayout.setHorizontalGroup( providersPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(providersPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(horizontalGroup) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); providersPanelLayout.setVerticalGroup( providersPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(verticalGroup) ); // set initial message (if any) validateAndStore(); }
Example 11
Source File: CommentsPanel.java From netbeans with Apache License 2.0 | 4 votes |
void setIssue(BugzillaIssue issue, List<BugzillaIssue.Attachment> attachments) { removeAll(); this.issue = issue; initCollapsedComments(); this.attachments = attachments; this.attachmentIds = getAttachmentIds(attachments); BugzillaIssue.Comment[] comments = issue.getComments(); this.sections = new ArrayList<>(comments.length + 1); GroupLayout layout = new GroupLayout(this); GroupLayout.ParallelGroup horizontalGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING); layout.setHorizontalGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(horizontalGroup) .addContainerGap()); GroupLayout.SequentialGroup verticalGroup = layout.createSequentialGroup(); verticalGroup.addContainerGap(); layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(verticalGroup)); DateFormat format = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.SHORT); String creationTxt = issue.getFieldValue(IssueField.CREATION); try { if (!creationTxt.isEmpty()) { Date creation = dateTimeFormat.parse(creationTxt); creationTxt = format.format(creation); } } catch (ParseException pex) { Bugzilla.LOG.log(Level.INFO, null, pex); } sections.add(addSection(layout, new Long(0), issue.getFieldValue(IssueField.DESCRIPTION), issue.getFieldValue(IssueField.REPORTER), issue.getFieldValue(IssueField.REPORTER_NAME), creationTxt, horizontalGroup, verticalGroup, true)); for (BugzillaIssue.Comment comment : comments) { String when = format.format(comment.getWhen()); sections.add(addSection(layout, comment.getNumber(), comment.getText(), comment.getAuthor(), comment.getAuthorName(), when, horizontalGroup, verticalGroup, false)); } verticalGroup.addContainerGap(); setLayout(layout); }
Example 12
Source File: CELabelsPanel.java From open-ig with GNU Lesser General Public License v3.0 | 4 votes |
/** * Update the controls of the detail panel. */ void updateDetails() { bottomPanel.removeAll(); GroupLayout gl = (GroupLayout)bottomPanel.getLayout(); ParallelGroup c1 = gl.createParallelGroup(); ParallelGroup c2 = gl.createParallelGroup(); SequentialGroup r1 = gl.createSequentialGroup(); c1.addComponent(keyLabel); c2.addComponent(keyField); r1.addGroup( gl.createParallelGroup(Alignment.BASELINE) .addComponent(keyLabel) .addComponent(keyField, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) ); textAreas.clear(); for (final String lang : context.dataManager().languages()) { JLabel lbl = new JLabel(lang); JTextArea ta = new JTextArea(); final CEValueBox<JTextArea> vta = CEValueBox.of("", ta); vta.validator = new Action1<JTextArea>() { @Override public void invoke(JTextArea value) { validateLabelField(vta); } }; textAreas.put(lang, vta); c1.addComponent(lbl); c2.addComponent(vta); r1.addGroup( gl.createParallelGroup(Alignment.BASELINE) .addComponent(lbl) .addComponent(vta, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) ); } gl.setHorizontalGroup( gl.createSequentialGroup() .addGroup(c1) .addGroup(c2) ); gl.setVerticalGroup( r1 ); }
Example 13
Source File: CEDefinitionPanel.java From open-ig with GNU Lesser General Public License v3.0 | 4 votes |
/** @return The referenced main data files panel. */ JPanel createReferencesPanel() { JPanel p = new JPanel(); GroupLayout gl = new GroupLayout(p); p.setLayout(gl); gl.setAutoCreateContainerGaps(true); gl.setAutoCreateGaps(true); SequentialGroup rows = gl.createSequentialGroup(); ParallelGroup col1 = gl.createParallelGroup(); ParallelGroup col2 = gl.createParallelGroup(); ParallelGroup col3 = gl.createParallelGroup(); for (String a : ELEMENT_NAMES) { JLabel indicator = new JLabel(); JLabel caption = new JLabel(get("definition.ref_" + a)); JTextField textField = new JTextField(); indicators.put(a, indicator); fields.put(a, textField); ParallelGroup pg = gl.createParallelGroup(Alignment.BASELINE); col1.addComponent(caption); col2.addComponent(textField); col3.addComponent(indicator, 20, 20, 20); pg.addComponent(caption); pg.addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE); pg.addComponent(indicator, 20, 20, 20); rows.addGroup(pg); } gl.setHorizontalGroup( gl.createSequentialGroup() .addGroup(col1) .addGroup(col2) .addGroup(col3) ); gl.setVerticalGroup(rows); return p; }
Example 14
Source File: CEDefinitionPanel.java From open-ig with GNU Lesser General Public License v3.0 | 4 votes |
/** * @return the properties listing panel */ JPanel createPropertiesPanel() { JPanel p = new JPanel(); GroupLayout gl = new GroupLayout(p); p.setLayout(gl); gl.setAutoCreateContainerGaps(true); gl.setAutoCreateGaps(true); SequentialGroup rows = gl.createSequentialGroup(); ParallelGroup col1 = gl.createParallelGroup(); ParallelGroup col2 = gl.createParallelGroup(); ParallelGroup col3 = gl.createParallelGroup(); for (String a : PARAM_NAMES) { JLabel indicator = new JLabel(); JLabel caption = new JLabel(get("definition.refprop_" + a)); JTextField textField = new JTextField(10); textField.setHorizontalAlignment(JTextField.RIGHT); caption.setToolTipText(get("definition.refprop_" + a + ".tip")); textField.setToolTipText(get("definition.refprop_" + a + ".tip")); indicators.put(a, indicator); fields.put(a, textField); ParallelGroup pg = gl.createParallelGroup(Alignment.BASELINE); col1.addComponent(caption); col2.addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE); col3.addComponent(indicator, 20, 20, 20); pg.addComponent(caption); pg.addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE); pg.addComponent(indicator, 20, 20, 20); rows.addGroup(pg); } gl.setHorizontalGroup( gl.createSequentialGroup() .addGroup(col1) .addGroup(col2) .addGroup(col3) ); gl.setVerticalGroup(rows); return p; }