当前位置: 首页>>代码示例>>Java>>正文


Java ButtonBarBuilder.addGlue方法代码示例

本文整理汇总了Java中com.jgoodies.forms.builder.ButtonBarBuilder.addGlue方法的典型用法代码示例。如果您正苦于以下问题:Java ButtonBarBuilder.addGlue方法的具体用法?Java ButtonBarBuilder.addGlue怎么用?Java ButtonBarBuilder.addGlue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jgoodies.forms.builder.ButtonBarBuilder的用法示例。


在下文中一共展示了ButtonBarBuilder.addGlue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createButtonBar

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
private JPanel createButtonBar()
	{
		_closeBtn.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent evt)
			{
				setVisible(false);
			}
		});

		final ButtonBarBuilder builder = new ButtonBarBuilder();
		builder.addGlue();
//		builder.addGridded(new JButton("Alter"));
//		builder.addRelatedGap();
		builder.addGridded(_closeBtn);

		return builder.getPanel();
	}
 
开发者ID:realxujiang,项目名称:bigtable-sql,代码行数:19,代码来源:AboutBoxDialog.java

示例2: displayTerms

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
private void displayTerms(ProtectedTermsList list) {
    // Make a dialog box to display the contents:
    final JDialog dd = new JDialog(diag, list.getDescription() + " - " + list.getLocation(), true);

    JTextArea ta = new JTextArea(list.getTermListing());
    ta.setEditable(false);
    JScrollPane sp = new JScrollPane(ta);
    sp.setPreferredSize(new Dimension(700, 500));
    dd.getContentPane().add(sp, BorderLayout.CENTER);
    JButton okButton = new JButton(Localization.lang("OK"));
    ButtonBarBuilder bb = new ButtonBarBuilder();
    bb.addGlue();
    bb.addButton(okButton);
    bb.addGlue();
    bb.getPanel().setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    dd.getContentPane().add(bb.getPanel(), BorderLayout.SOUTH);
    okButton.addActionListener(actionEvent -> dd.dispose());
    dd.pack();
    dd.setLocationRelativeTo(diag);
    dd.setVisible(true);
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:22,代码来源:ProtectedTermsDialog.java

示例3: displayStyle

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
private void displayStyle(OOBibStyle style) {
    // Make a dialog box to display the contents:
    final JDialog dd = new JDialog(diag, style.getName(), true);

    JTextArea ta = new JTextArea(style.getLocalCopy());
    ta.setEditable(false);
    JScrollPane sp = new JScrollPane(ta);
    sp.setPreferredSize(new Dimension(700, 500));
    dd.getContentPane().add(sp, BorderLayout.CENTER);
    JButton okButton = new JButton(Localization.lang("OK"));
    ButtonBarBuilder bb = new ButtonBarBuilder();
    bb.addGlue();
    bb.addButton(okButton);
    bb.addGlue();
    bb.getPanel().setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    dd.getContentPane().add(bb.getPanel(), BorderLayout.SOUTH);
    okButton.addActionListener(actionEvent -> dd.dispose());
    dd.pack();
    dd.setLocationRelativeTo(diag);
    dd.setVisible(true);
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:22,代码来源:StyleSelectDialog.java

示例4: buildWizardBar

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
public static JPanel buildWizardBar(JButton[] leftAlignedButtons, JButton back, JButton next, JButton overlaidFinish, JButton[] rightAlignedButtons)
{
  ButtonBarBuilder builder = new ButtonBarBuilder();
  if (leftAlignedButtons != null) {
    builder.addGriddedButtons(leftAlignedButtons);
    builder.addRelatedGap();
  }
  builder.addGlue();
  builder.addGridded(back);
  builder.addGridded(next);

  if (overlaidFinish != null) {
    builder.nextColumn(-1);
    builder.add(overlaidFinish);
    builder.nextColumn();
  }

  if (rightAlignedButtons != null) {
    builder.addRelatedGap();
    builder.addGriddedButtons(rightAlignedButtons);
  }
  return builder.getPanel();
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:24,代码来源:ButtonBarFactory.java

示例5: init

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
/**
 * Sets up the dialog
 */
private void init() {
    mergeEntries = new MergeEntries(this.originalEntry, this.fetchedEntry, Localization.lang("Original entry"),
            Localization.lang("Entry from %0", type), panel.getBibDatabaseContext().getMode());

    // Create undo-compound
    ce = new NamedCompound(Localization.lang("Merge entry with %0 information", type));

    FormLayout layout = new FormLayout("fill:700px:grow", "fill:400px:grow, 4px, p, 5px, p");
    this.setLayout(layout);

    this.add(mergeEntries.getMergeEntryPanel(), cc.xy(1, 1));
    this.add(new JSeparator(), cc.xy(1, 3));

    // Create buttons
    ButtonBarBuilder bb = new ButtonBarBuilder();
    bb.addGlue();

    JButton cancel = new JButton(new CancelAction());
    JButton replaceEntry = new JButton(new ReplaceAction());

    bb.addButton(replaceEntry, cancel);
    this.add(bb.getPanel(), cc.xy(1, 5));

    // Add some margin around the layout
    layout.appendRow(RowSpec.decode(MARGIN));
    layout.appendColumn(ColumnSpec.decode(MARGIN));
    layout.insertRow(1, RowSpec.decode(MARGIN));
    layout.insertColumn(1, ColumnSpec.decode(MARGIN));

    WindowLocation pw = new WindowLocation(this, JabRefPreferences.MERGEENTRIES_POS_X,
            JabRefPreferences.MERGEENTRIES_POS_Y, JabRefPreferences.MERGEENTRIES_SIZE_X,
            JabRefPreferences.MERGEENTRIES_SIZE_Y);
    pw.displayWindowAtStoredLocation();

}
 
开发者ID:JabRef,项目名称:jabref,代码行数:39,代码来源:MergeFetchedEntryDialog.java

示例6: WaitForSaveOperation

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
public WaitForSaveOperation(JabRefFrame frame) {
    this.frame = frame;

    JButton cancel = new JButton(Localization.lang("Cancel"));
    JProgressBar prog = new JProgressBar(0);
    prog.setIndeterminate(true);
    prog.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    diag = new JDialog(frame, Localization.lang("Please wait..."), true);

    ButtonBarBuilder bb = new ButtonBarBuilder();
    bb.addGlue();
    bb.addButton(cancel);
    bb.addGlue();
    cancel.addActionListener(e -> {
        canceled = true;
        t.stop();
        diag.dispose();
    });

    JLabel message = new JLabel(Localization.lang("Waiting for save operation to finish") + "...");
    message.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    diag.getContentPane().add(message, BorderLayout.NORTH);
    diag.getContentPane().add(bb.getPanel(), BorderLayout.SOUTH);
    diag.getContentPane().add(prog, BorderLayout.CENTER);
    diag.pack();
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:28,代码来源:WaitForSaveOperation.java

示例7: initButtonPanel

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
private void initButtonPanel() {
    okButton.addActionListener(event -> {
        okPressed = true;
        dispose();
    });
    cancelButton.addActionListener(event -> dispose());

    ButtonBarBuilder bb = new ButtonBarBuilder(buttons);
    buttons.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    bb.addGlue();
    bb.addButton(okButton);
    bb.addButton(parseWithFreeCiteButton);
    bb.addButton(cancelButton);
    bb.addGlue();
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:16,代码来源:TextInputDialog.java

示例8: createCancelButtonBarPanel

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
private JPanel createCancelButtonBarPanel() {
    JButton cancel = new JButton(Localization.lang("Cancel"));
    cancel.addActionListener(this);

    // Make ESC close dialog, equivalent to clicking Cancel.
    cancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(Globals.getKeyPrefs().getKey(KeyBinding.CLOSE_DIALOG), "close");
    cancel.getActionMap().put("close", cancelAction);

    JPanel buttons = new JPanel();
    ButtonBarBuilder bb = new ButtonBarBuilder(buttons);
    bb.addGlue();
    bb.addButton(cancel);
    bb.addGlue();
    return buttons;
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:16,代码来源:EntryTypeDialog.java

示例9: buildLeftAlignedBar

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
public static JPanel buildLeftAlignedBar(JButton[] buttons)
{
  ButtonBarBuilder builder = new ButtonBarBuilder();
  builder.addGriddedButtons(buttons);
  builder.addGlue();
  return builder.getPanel();
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:8,代码来源:ButtonBarFactory.java

示例10: buildCenteredBar

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
public static JPanel buildCenteredBar(JButton[] buttons)
{
  ButtonBarBuilder builder = new ButtonBarBuilder();
  builder.addGlue();
  builder.addGriddedButtons(buttons);
  builder.addGlue();
  return builder.getPanel();
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:9,代码来源:ButtonBarFactory.java

示例11: buildRightAlignedBar

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
public static JPanel buildRightAlignedBar(JButton[] buttons)
{
  ButtonBarBuilder builder = new ButtonBarBuilder();
  builder.addGlue();
  builder.addGriddedButtons(buttons);
  return builder.getPanel();
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:8,代码来源:ButtonBarFactory.java

示例12: buildHelpBar

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
public static JPanel buildHelpBar(JButton help, JButton[] buttons)
{
  ButtonBarBuilder builder = new ButtonBarBuilder();
  builder.addGridded(help);
  builder.addRelatedGap();
  builder.addGlue();
  builder.addGriddedButtons(buttons);
  return builder.getPanel();
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:10,代码来源:ButtonBarFactory.java

示例13: createButtonPanel

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
private JPanel createButtonPanel() {
	buttonBack.setIcon(ImageFactory.getIcon("back.png")); //$NON-NLS-1$
	ButtonBarBuilder bbbuilder = new ButtonBarBuilder();
	bbbuilder.addGlue();
	bbbuilder.addGriddedButtons(new JButton[] {buttonBack});
	FormLayout buttonLayout = new FormLayout("4dlu, default:grow, 4dlu", // columns //$NON-NLS-1$
                                                "6dlu, default, 6dlu, fill:default:grow, 6dlu"); // rows //$NON-NLS-1$
	CellConstraints ccbb = new CellConstraints();
	JPanel buttonPanel = new JPanel(buttonLayout);
	JSeparator separator = new JSeparator(SwingConstants.HORIZONTAL);
	buttonPanel.add(separator, ccbb.xy(2, 2));
	buttonPanel.add(bbbuilder.getPanel(), ccbb.xy(2, 4));
	return buttonPanel;
}
 
开发者ID:galan,项目名称:dub,代码行数:15,代码来源:SimpleContentPanel.java

示例14: ModalDialogListUserPrompter

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
public ModalDialogListUserPrompter(JFrame parentFrame, String question, List<T> responses, T defaultResponse) {
	this.parentFrame = parentFrame;
	this.defaultResponse = defaultResponse;
       applyToAll = new JCheckBox(Messages.getString("ModalDialogUserPrompter.applyToAllOption")); //$NON-NLS-1$
       
       confirmDialog = new JDialog(parentFrame);
       
       // FIXME the title needs to be configurable and/or set itself based on prompt type
       confirmDialog.setTitle(""); //$NON-NLS-1$
       
       // this is just filled with the message pattern template to help with sizing
       questionField = new JTextArea(question);
       questionField.setEditable(false);
       questionField.setBackground(null);
       
       questionFormat = new MessageFormat(question);
       
       JPanel confirmPanel = new JPanel();
       FormLayout formLayout = new FormLayout("pref:grow" //$NON-NLS-1$
                                               , ""); //$NON-NLS-1$
       
       optionBox = new JComboBox();
       for (T item : responses) {
       	optionBox.addItem(item);
       }
       
       optionBox.setSelectedItem(defaultResponse);
       DefaultFormBuilder builder = new DefaultFormBuilder(formLayout, confirmPanel);
       builder.setDefaultDialogBorder();
       
       builder.append(questionField);

       builder.nextLine();
       builder.append(optionBox);
       
       builder.nextLine();
       ButtonBarBuilder buttonBar = new ButtonBarBuilder();
       buttonBar.addGlue();
       JButton okButton = new JButton();
       okButton.setText("Ok");
       buttonBar.addGridded(okButton);
       buttonBar.addGlue();
       
       okButton.addActionListener(new ActionListener() {
		@SuppressWarnings("unchecked")
		public void actionPerformed(ActionEvent e) {
			responseButton = UserPromptResponse.OK;
               response = (T) optionBox.getSelectedItem();
               confirmDialog.dispose();
           }
       });
       builder.append(""); //$NON-NLS-1$
       builder.append(buttonBar.getPanel());
       builder.nextLine();
       
       builder.append(""); //$NON-NLS-1$
       builder.append(applyToAll);
       
       okButton.requestFocusInWindow();

       confirmDialog.setModal(true);
       confirmDialog.add(builder.getPanel());
}
 
开发者ID:SQLPower,项目名称:sqlpower-library,代码行数:64,代码来源:ModalDialogListUserPrompter.java

示例15: init

import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
/**
 * Sets up the dialog
 *
 * @param selected Selected BibtexEntries
 */
private void init(List<BibEntry> selected) {

    // Check if there are two entries selected
    if (selected.size() != 2) { // None selected. Inform the user to select entries first.
        JOptionPane.showMessageDialog(panel.frame(),
                Localization.lang("You have to choose exactly two entries to merge."),
                MERGE_ENTRIES, JOptionPane.INFORMATION_MESSAGE);
        this.dispose();
        return;
    }

    // Store the two entries
    BibEntry one = selected.get(0);
    BibEntry two = selected.get(1);

    MergeEntries mergeEntries = new MergeEntries(one, two, panel.getBibDatabaseContext().getMode());

    // Create undo-compound
    NamedCompound ce = new NamedCompound(MERGE_ENTRIES);

    FormLayout layout = new FormLayout("fill:700px:grow", "fill:400px:grow, 4px, p, 5px, p");
    this.setLayout(layout);

    this.add(mergeEntries.getMergeEntryPanel(), cc.xy(1, 1));
    this.add(new JSeparator(), cc.xy(1, 3));

    // Create buttons
    ButtonBarBuilder bb = new ButtonBarBuilder();
    bb.addGlue();
    JButton cancel = new JButton(Localization.lang("Cancel"));
    cancel.setActionCommand("cancel");
    cancel.addActionListener(e -> {
        panel.output(Localization.lang("Canceled merging entries"));
        dispose();
    });

    JButton replaceentries = new JButton(MERGE_ENTRIES);
    replaceentries.setActionCommand("replace");
    replaceentries.addActionListener(e -> {
        // Create a new entry and add it to the undo stack
        // Remove the other two entries and add them to the undo stack (which is not working...)
        BibEntry mergedEntry = mergeEntries.getMergeEntry();
        panel.insertEntry(mergedEntry);
        ce.addEdit(new UndoableInsertEntry(panel.getDatabase(), mergedEntry, panel));
        ce.addEdit(new UndoableRemoveEntry(panel.getDatabase(), one, panel));
        panel.getDatabase().removeEntry(one);
        ce.addEdit(new UndoableRemoveEntry(panel.getDatabase(), two, panel));
        panel.getDatabase().removeEntry(two);
        ce.end();
        panel.getUndoManager().addEdit(ce);
        panel.output(Localization.lang("Merged entries"));
        dispose();
    });

    bb.addButton(new JButton[] {replaceentries, cancel});
    this.add(bb.getPanel(), cc.xy(1, 5));

    // Add some margin around the layout
    layout.appendRow(RowSpec.decode(MARGIN));
    layout.appendColumn(ColumnSpec.decode(MARGIN));
    layout.insertRow(1, RowSpec.decode(MARGIN));
    layout.insertColumn(1, ColumnSpec.decode(MARGIN));

    WindowLocation pw = new WindowLocation(this, JabRefPreferences.MERGEENTRIES_POS_X,
            JabRefPreferences.MERGEENTRIES_POS_Y, JabRefPreferences.MERGEENTRIES_SIZE_X,
            JabRefPreferences.MERGEENTRIES_SIZE_Y);
    pw.displayWindowAtStoredLocation();

    // Show what we've got
    setVisible(true);
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:77,代码来源:MergeEntriesDialog.java


注:本文中的com.jgoodies.forms.builder.ButtonBarBuilder.addGlue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。