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


Java ButtonBarFactory类代码示例

本文整理汇总了Java中com.jgoodies.forms.factories.ButtonBarFactory的典型用法代码示例。如果您正苦于以下问题:Java ButtonBarFactory类的具体用法?Java ButtonBarFactory怎么用?Java ButtonBarFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: layoutComponents

import com.jgoodies.forms.factories.ButtonBarFactory; //导入依赖的package包/类
private void layoutComponents() {
    JPanel buttons = ButtonBarFactory.buildRightAlignedBar(startButton, stopButton);

    FormLayout layout = new FormLayout("right:d, 6dlu, max(d;30dlu):grow");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout, this);
    builder.append("Service status", statusTextField);
    builder.append("", buttons);
    builder.appendParagraphGapRow();
    builder.nextRow();
    builder.append("Started on", startedTextField);
    builder.append("Memory used", memoryTextField);
    builder.append("Error message", errorTextField);
    builder.append("Server address", urlButton);

    setBorder(Borders.DIALOG_BORDER);
}
 
开发者ID:sindremehus,项目名称:subsonic,代码行数:17,代码来源:StatusPanel.java

示例2: layoutComponents

import com.jgoodies.forms.factories.ButtonBarFactory; //导入依赖的package包/类
private void layoutComponents() {
    FormLayout layout = new FormLayout("d, 6dlu, max(d;30dlu):grow");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.append("Port number", portTextField);
    builder.append(httpsPortCheckBox, httpsPortTextField);
    builder.append("Memory limit (MB)", memoryTextField);
    builder.append("Context path", contextPathComboBox);

    setBorder(Borders.DIALOG_BORDER);

    setLayout(new BorderLayout(12, 12));
    add(builder.getPanel(), BorderLayout.CENTER);
    add(ButtonBarFactory.buildCenteredBar(defaultButton, saveButton), BorderLayout.SOUTH);
}
 
开发者ID:sindremehus,项目名称:subsonic,代码行数:15,代码来源:SettingsPanel.java

示例3: layoutComponents

import com.jgoodies.forms.factories.ButtonBarFactory; //导入依赖的package包/类
private void layoutComponents() {
    tabbedPane.add("Status", statusPanel);
    tabbedPane.add("Settings", settingsPanel);

    JPanel pane = (JPanel) getContentPane();
    pane.setLayout(new BorderLayout(10, 10));
    pane.add(tabbedPane, BorderLayout.CENTER);
    pane.add(ButtonBarFactory.buildCloseBar(closeButton), BorderLayout.SOUTH);

    pane.setBorder(Borders.TABBED_DIALOG_BORDER);
}
 
开发者ID:sindremehus,项目名称:subsonic,代码行数:12,代码来源:SubsonicFrame.java

示例4: layoutComponents

import com.jgoodies.forms.factories.ButtonBarFactory; //导入依赖的package包/类
private void layoutComponents() {
    JPanel pane = (JPanel) getContentPane();
    pane.setLayout(new BorderLayout(10, 10));
    pane.add(statusPanel, BorderLayout.CENTER);
    pane.add(ButtonBarFactory.buildRightAlignedBar(hideButton, exitButton), BorderLayout.SOUTH);

    pane.setBorder(Borders.DIALOG_BORDER);
}
 
开发者ID:sindremehus,项目名称:subsonic,代码行数:9,代码来源:SubsonicFrame.java

示例5: CommonWordsFinderPanel

import com.jgoodies.forms.factories.ButtonBarFactory; //导入依赖的package包/类
public CommonWordsFinderPanel(final MatchMakerSwingSession session, SPDataSource defaultConnection) {
    this.session = session;
    DataSourceCollection dataSources = session.getContext().getPlDotIni();
    final JComboBox connectionChooser = new JComboBox(new ConnectionComboBoxModel(dataSources));
    connectionChooser.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            try {
                JDBCDataSource ds = (JDBCDataSource) connectionChooser.getSelectedItem();

                // Gets the session's shared SQLDatabase for this data source
                SQLDatabase db = session.getDatabase(ds);
                
                // XXX don't know if this is going to reparent the shared database in a bad way!
                SQLObjectRoot root = new SQLObjectRoot();
                
                root.addChild(db);
                DBTreeModel model = new DBTreeModel(root);
                columnPicker.setModel(model);
            } catch (SQLObjectException ex) {
                throw new RuntimeException(ex);
            }
        }
    });
    columnPicker = new JTree();

    DefaultFormBuilder builder = new DefaultFormBuilder(
            new FormLayout("pref:grow"));
    builder.append("Choose a column to analyze for frequently-occurring words:");
    builder.append(connectionChooser);
    builder.append(new JScrollPane(columnPicker));

    JDefaultButton okButton = new JDefaultButton("Start");
    JButton cancelButton = new JButton("Cancel");
    builder.append(ButtonBarFactory.buildOKCancelBar(okButton, cancelButton));
    panel = builder.getPanel();
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:37,代码来源:CommonWordsFinderPanel.java

示例6: actionPerformed

import com.jgoodies.forms.factories.ButtonBarFactory; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
		try {
			dialog = SPSUtils.makeOwnedDialog(getPanel(), "Select Graph Display Values");
if (chooser == null) {
				chooser = new DisplayedNodeValueChooser((SourceTableNodeRenderer) graph.getNodeRenderer(), project, displayColumns);
			}

revertList = chooser.getChosenColumns();

JDefaultButton okButton = new JDefaultButton(okAction);
JPanel buttonPanelRight = ButtonBarFactory.buildOKCancelBar(okButton, new JButton(cancelAction));
JPanel buttonPanelLeft = ButtonBarFactory.buildLeftAlignedBar(new JButton(selectAction), 
		new JButton(deselectAction));
            JPanel buttonPanel = new JPanel(new BorderLayout());
            buttonPanel.add(buttonPanelLeft, BorderLayout.WEST);
            buttonPanel.add(buttonPanelRight, BorderLayout.EAST);
JPanel panel = new JPanel(new BorderLayout());
panel.add(chooser.makeGUI(), BorderLayout.CENTER);
panel.add(buttonPanel, BorderLayout.SOUTH);
dialog.getContentPane().add(panel);
			dialog.pack();
            dialog.getRootPane().setDefaultButton(okButton);
            SPSUtils.makeJDialogCancellable(dialog, cancelAction, false);
			dialog.setLocationRelativeTo((Component) e.getSource());
			dialog.setVisible(true);
		} catch (SQLObjectException ex) {
			MMSUtils.showExceptionDialog((Component) e.getSource(), ex.getMessage(), ex);
		}
	}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:30,代码来源:MatchResultVisualizer.java

示例7: buildUI

import com.jgoodies.forms.factories.ButtonBarFactory; //导入依赖的package包/类
public void buildUI() {
    FormLayout layout = new FormLayout("4dlu, pref, 4dlu", 
            "4dlu,pref,4dlu,pref,4dlu, pref,4dlu,pref,4dlu");
            //1    2    3    4    5     6    7   8    9 
    CellConstraints cc = new CellConstraints();
    PanelBuilder pb = new PanelBuilder(layout);        
    deleteAll = new JRadioButton("Delete all content");        
    moveContent = new JRadioButton("Move to:");
    // default to move the contents
    moveContent.setSelected(true);
    moveTo = new JComboBox();
    List<PlFolder> folders = new ArrayList<PlFolder>();
    folders.addAll(session.getCurrentFolderParent().getChildren(PlFolder.class));
    folders.remove(folder);
    moveTo.setModel(new DefaultComboBoxModel(folders.toArray()));
    moveTo.setRenderer(new MatchMakerObjectComboBoxCellRenderer());
    okButton = new JButton(okAction);
    cancelButton = new JButton(cancelAction);
    
    group = new ButtonGroup();
    group.add(deleteAll);
    group.add(moveContent);
    pb.add(deleteAll, cc.xy(2,2));
    pb.add(moveContent, cc.xy(2,4));
    pb.add(moveTo, cc.xy(2,6));
    
    if (folders.size() == 0) {
    	moveContent.setEnabled(false);
    	moveTo.setEnabled(false);
    	deleteAll.setSelected(true);
    }
    
    pb.add(ButtonBarFactory.buildOKCancelBar(okButton, cancelButton), cc.xy(2,8));
    
    dialog = new JDialog(parent,"Delete " + folder.getName() + " folder");
    pb.setBorder(new EmptyBorder(10,10,10,10));
    dialog.setContentPane(pb.getPanel());
    
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:40,代码来源:DeleteFolderDialog.java

示例8: buildUI

import com.jgoodies.forms.factories.ButtonBarFactory; //导入依赖的package包/类
@Override
protected JPanel buildUI() {
	addInputButton = new JButton(new AddInputAction("Add Input"));
	removeInputsButton = new JButton(new RemoveUnusedInputAction("Clean Up"));

	return ButtonBarFactory.buildAddRemoveBar(addInputButton, removeInputsButton);
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:8,代码来源:MungeResultMungeComponent.java

示例9: createSingleButtonDataEntryPanelDialog

import com.jgoodies.forms.factories.ButtonBarFactory; //导入依赖的package包/类
/**
 * Build a JDialog around an object that implements DataEntryPanel, to
 * provide consistent behaviours such as Cancel button, <ESC> to close, and
 * so on.
 * XXX Worry about modal vs non-modal
 * XXX This is not called by anything 
 * @param dataEntry
 *            The DataEntryPanel implementation
 * @param dialogParent
 *            A Window object to be the dialog's parent
 * @param dialogTitle
 *            The dialog title.
 * @param actionButtonTitle
 *            The label text for the OK button
 * @param okAction Action to be invoked when the OK/action button is
 *  pressed; does NOT need to dismiss the dialog (we do that if applyChanges() returns true).
 * @return The new JDialog, which has the panel in it along with OK and Cancel buttons
 */
public static JDialog createSingleButtonDataEntryPanelDialog(
        final DataEntryPanel dataEntry,
        final Component dialogParent,
        final String dialogTitle,
        final String actionButtonTitle,
        final Action okAction ) {

	final JDialog d = createDialog(dialogParent, dialogTitle);
    JComponent panel = dataEntry.getPanel();


    
    JButton okButton = new JDefaultButton(okAction);
    okButton.setText(actionButtonTitle);
    // In all cases we have to close the dialog.
    Action closeAction = new CommonCloseAction(d);
    okButton.addActionListener(closeAction);
    SPSUtils.makeJDialogCancellable(d, closeAction);
    okButton.addActionListener(new CommonCloseAction(d));

    // Handle if the user presses Enter in the dialog - do OK action
    d.getRootPane().setDefaultButton(okButton);


    // Now build the GUI.
    JPanel cp = new JPanel(new BorderLayout());
    cp.setBorder(BorderFactory.createEmptyBorder(12,12,12,12));
    cp.add(panel, BorderLayout.CENTER);

    cp.add(ButtonBarFactory.buildCenteredBar(okButton),
            BorderLayout.SOUTH);
    cp.setBorder(Borders.DIALOG_BORDER);

    //d.add(cp);
    d.setContentPane(cp);

    // XXX maybe pass yet another argument for this?
    // d.setLocationRelativeTo(someFrame);

    d.pack();
    return d;
}
 
开发者ID:SQLPower,项目名称:sqlpower-library,代码行数:61,代码来源:DataEntryPanelBuilder.java

示例10: buildPanel

import com.jgoodies.forms.factories.ButtonBarFactory; //导入依赖的package包/类
/**
 * Genereate an instance of the UI's JPanel.
 * 
 * @return The JPanel for the UI.
 */
public JComponent buildPanel ()
{
    
    // Create all UI elements
    initComponents();
    
    // Create a reusable cell constraints object
    CellConstraints cc = new CellConstraints();
    
    // Prepare master layout
    FormLayout layout = new FormLayout (
        "right:pref, 4dlu, pref:grow, 4dlu, pref, 4dlu, right:pref, 4dlu, pref:grow, 4dlu, pref", 
        "");
    
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();
    
    // Add elements to master layout
    builder.appendSeparator("General");
    builder.append("Scenario Name:", scenarioName, 9);
    builder.nextLine();
    
    builder.appendSeparator("Total Volume");
    builder.append("Minimum:", minVolume, minVolumeUnits);
    builder.append("Maximum:", maxVolume, maxVolumeUnits);
    builder.nextLine();
    
    builder.appendSeparator("Delivery Schedule");
    builder.append("Volume:", deliveryVolume, deliveryVolumeUnits);
    builder.nextLine();
    builder.append("Minimum Interval:", deliveryMinIntervals, 3);
    builder.append("Maximum Interval:", deliveryMaxIntervals, 3);
    builder.nextLine();
    
    builder.appendSeparator("Users");
    builder.append("Minimum Users:", minUsers, 3);
    builder.append("Maximum Users:", maxUsers, 3);
    builder.nextLine();
    builder.append("Minimum Types:", minUserTypes, 3);
    builder.append("Maximum Types:", maxUserTypes, 3);
    builder.nextLine();
    
    builder.appendSeparator("Network Properties");
    builder.append("Geographic Distribution:", geographicDistribution, 3);
    builder.append("Access Policy:", accessPolicy, 3);
    builder.nextLine();
    
    builder.appendSeparator("Perfomance Requirements");
    builder.append("Consistency:", consistency, 3);
    builder.append("Dependability:", dependability, 3);
    builder.append("Scalability:", scalability, 3);
    builder.append("Efficiency:", efficiency, 3);
    builder.nextLine();
    
    builder.appendSeparator("Data Types");
    builder.append("Data:", dataTypesData, 3);
    builder.nextLine();
    builder.append("Metadata:", dataTypesMetadata, 3);
    
    builder.nextLine();
    builder.append(ButtonBarFactory.buildOKCancelBar(save, cancel), 11);
    
    return builder.getPanel();
}
 
开发者ID:chrismattmann,项目名称:disco,代码行数:70,代码来源:ScenarioEditorView.java

示例11: createCommandButtonRow

import com.jgoodies.forms.factories.ButtonBarFactory; //导入依赖的package包/类
/**
 * Make a horizontal row of buttons of equal size, whch are equally spaced,
 * and aligned on the right.
 * 
 * <P>
 * The returned component has border spacing only on the top (of the size
 * recommended by the Look and Feel Design Guidelines). All other spacing
 * must be applied elsewhere ; usually, this will only mean that the
 * dialog's top-level panel should use {@link #buildStandardBorder}.
 * 
 * @param buttons
 *            contains <code>JButton</code> objects.
 * @return A row displaying the buttons horizontally.
 */
public static JComponent createCommandButtonRow(JButton[] buttons) {
    return ButtonBarFactory.buildRightAlignedBar(buttons);
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:18,代码来源:GuiStandardUtils.java


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