當前位置: 首頁>>代碼示例>>Java>>正文


Java JToolBar.addSeparator方法代碼示例

本文整理匯總了Java中javax.swing.JToolBar.addSeparator方法的典型用法代碼示例。如果您正苦於以下問題:Java JToolBar.addSeparator方法的具體用法?Java JToolBar.addSeparator怎麽用?Java JToolBar.addSeparator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JToolBar的用法示例。


在下文中一共展示了JToolBar.addSeparator方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createFilterToolBarUI

import javax.swing.JToolBar; //導入方法依賴的package包/類
private void createFilterToolBarUI(JToolBar toolbar, FiltersDescriptor filtersDesc) {
    toolbar.removeAll();
    // create toggle buttons
    int filterCount = filtersDesc.getFilterCount();
    ArrayList<JToggleButton> toggles = new ArrayList<JToggleButton>(filterCount);
    JToggleButton toggleButton = null;

    for (int i = 0; i < filterCount; i++) {
        toggleButton = createToggle(filtersDesc, i);
        toggles.add(toggleButton);
    }

    // add toggle buttons
    for (int i = 0; i < toggles.size(); i++) {
        JToggleButton curToggle = toggles.get(i);
        curToggle.addActionListener(new ToggleButtonActionListener(i));
        toolbar.add(curToggle);
        if (i != toggles.size() - 1) {
            toolbar.addSeparator(new Dimension(3, 0));
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:23,代碼來源:InfoPanel.java

示例2: fillToolBar

import javax.swing.JToolBar; //導入方法依賴的package包/類
private void fillToolBar(JToolBar result) {
    result.removeAll();
    result.add(getActions().getExplorationDialogAction());
    result.addSeparator();
    result.add(getActions().getStartSimulationAction());
    result.add(getActions().getApplyMatchAction());
    result.add(getActions().getAnimateAction());
    result.add(getActions().getExploreAction());
    result.addSeparator();
    result.add(getActions().getBackAction());
    result.add(getActions().getForwardAction());
    result.addSeparator();
    result.add(getJGraph().getModeButton(JGraphMode.SELECT_MODE));
    result.add(getJGraph().getModeButton(JGraphMode.PAN_MODE));
    result.addSeparator();
    result.add(getFilterPanel());
    result.add(getBoundSpinnerPanel());
    result.add(Box.createGlue());
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:20,代碼來源:LTSDisplay.java

示例3: createToolBar

import javax.swing.JToolBar; //導入方法依賴的package包/類
@Override
protected JToolBar createToolBar() {
    JToolBar result = super.createToolBar();
    result.addSeparator();
    result.add(getJGraph().getModeButton(EDIT_MODE));
    result.add(getJGraph().getModeButton(PREVIEW_MODE));
    result.addSeparator();
    result.add(getUndoAction());
    result.add(getRedoAction());
    result.addSeparator();
    result.add(getCopyAction());
    result.add(getPasteAction());
    result.add(getCutAction());
    result.add(getDeleteAction());
    result.addSeparator();
    result.add(getSnapToGridButton());
    processToolBar(result);
    return result;
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:20,代碼來源:GraphEditorTab.java

示例4: createToolBar

import javax.swing.JToolBar; //導入方法依賴的package包/類
public JToolBar createToolBar() {
    JToolBar bar = new JToolBar();

    for (Action action : getActions()) {
        if (action != null) {
            String command = (String) action
                    .getValue(Action.ACTION_COMMAND_KEY);
            JButton button = bar.add(action);
            button.setFocusable(false);
            if (action.getValue(Action.SHORT_DESCRIPTION) == null) {
                String text = null;
                StringGetter getter = (StringGetter) action
                        .getValue(StringGetter.ACTION_STRING_GETTER);
                if (getter != null)
                    text = getter.getString(command);
                else
                    text = GlobalResourcesManager.getString(command);
                if (text != null)
                    button.setToolTipText(text);
            }
        } else
            bar.addSeparator();
    }

    return bar;
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:27,代碼來源:SelectableTableView.java

示例5: createToolBar

import javax.swing.JToolBar; //導入方法依賴的package包/類
private JToolBar createToolBar(final Object[] os) {
    final JToolBar res = new JToolBar();
    for (final Object o : os) {
        if (o == null)
            res.addSeparator();
        else
            res.add((Action) o);
    }
    desableFocus(res);
    return res;
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:12,代碼來源:MainFrame.java

示例6: createToolbarPresenter

import javax.swing.JToolBar; //導入方法依賴的package包/類
/** Create the default toolbar representation of an array of actions.
* Null items in the array will add a separator to the toolbar.
*
* @param actions actions to show in the generated toolbar
* @return a toolbar instance displaying them
*/
public static JToolBar createToolbarPresenter(SystemAction[] actions) {
    JToolBar p = new JToolBar();
    for (SystemAction action : actions) {
        if (action == null) {
            p.addSeparator();
        } else if (action instanceof Presenter.Toolbar) {
            p.add(((Presenter.Toolbar) action).getToolbarPresenter());
        }
    }
    return p;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:SystemAction.java

示例7: createToolBar

import javax.swing.JToolBar; //導入方法依賴的package包/類
private Component createToolBar() {
    JToolBar bar = new JToolBar();
    bar.setFloatable(false);
    for (Action action : getActions())
        if (action == null)
            bar.addSeparator();
        else
            bar.add(action).setFocusable(false);
    return bar;
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:11,代碼來源:ModelPropertiesDialog.java

示例8: createToolBar

import javax.swing.JToolBar; //導入方法依賴的package包/類
private Component createToolBar(Action[] actions) {
    JToolBar bar = new JToolBar();
    bar.setFloatable(false);
    for (Action action : actions) {
        if (action == null)
            bar.addSeparator();
        else
            bar.add(action).setFocusable(false);
    }
    return bar;
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:12,代碼來源:SelectRowDialog.java

示例9: createToolBar

import javax.swing.JToolBar; //導入方法依賴的package包/類
/**
 * Creates a tool bar for the display.
 */
@Override
protected JToolBar createToolBar() {
    JToolBar result = super.createToolBar();
    result.addSeparator();
    result.add(getUndoButton());
    result.add(this.textArea.getRedoAction());
    result.addSeparator();
    result.add(this.textArea.getCopyAction());
    result.add(this.textArea.getPasteAction());
    result.add(this.textArea.getCutAction());
    result.add(this.textArea.getDeleteAction());
    return result;
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:17,代碼來源:TextTab.java

示例10: createListToolBar

import javax.swing.JToolBar; //導入方法依賴的package包/類
/** Creates a tool bar for the rule tree. */
@Override
protected JToolBar createListToolBar() {
    int separation = 7;
    JToolBar result = super.createListToolBar(separation);
    result.add(getActions().getShiftPriorityAction(true));
    result.add(getActions().getShiftPriorityAction(false));
    result.addSeparator(new Dimension(separation, 0));
    result.add(getCollapseAllButton());
    return result;
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:12,代碼來源:RuleDisplay.java

示例11: createToolbar

import javax.swing.JToolBar; //導入方法依賴的package包/類
/**
 * Creates new toolbar for current frame.
 */
private void createToolbar() {
    JToolBar toolBar = new JToolBar();
    toolBar.setFloatable(true);

    toolBar.add(newDocumentAction);
    toolBar.add(openDocumentAction);
    toolBar.add(saveDocumentAction);
    toolBar.add(saveAsDocumentAction);
    toolBar.add(closeCurrentTab);
    toolBar.addSeparator();

    toolBar.add(copyAction);
    toolBar.add(cutAction);
    toolBar.add(pasteAction);
    toolBar.addSeparator();

    toolBar.add(sortLinesAsc);
    toolBar.add(sortLinesDesc);
    toolBar.add(uniqueLinesAction);
    toolBar.add(upperCaseAction);
    toolBar.add(lowerCaseAction);
    toolBar.add(reverseCaseAction);
    toolBar.addSeparator();

    toolBar.add(statisticsAction);
    this.getContentPane().add(toolBar, BorderLayout.PAGE_START);
}
 
開發者ID:fgulan,項目名稱:java-course,代碼行數:31,代碼來源:JNotepadPP.java

示例12: fillToolBar

import javax.swing.JToolBar; //導入方法依賴的package包/類
private void fillToolBar(JToolBar result) {
    result.removeAll();
    result.add(getActions().getExplorationDialogAction());
    result.addSeparator();
    result.add(getActions().getStartSimulationAction());
    result.add(getActions().getApplyMatchAction());
    result.add(getActions().getAnimateAction());
    result.add(getActions().getExploreAction());
    result.addSeparator();
    result.add(getActions().getBackAction());
    result.add(getActions().getForwardAction());
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:13,代碼來源:StateDisplay.java

示例13: createListToolBar

import javax.swing.JToolBar; //導入方法依賴的package包/類
/**
 * Creates a tool bar for the list panel.
 * @param separation width of the separator on the tool bar;
 * if negative, the default separator is used
 */
protected JToolBar createListToolBar(int separation) {
    JToolBar result = Options.createToolBar();
    result.add(getNewAction());
    result.add(getEditAction());
    if (separation >= 0) {
        result.addSeparator(new Dimension(separation, 0));
    } else {
        result.addSeparator();
    }
    result.add(getCopyAction());
    result.add(getDeleteAction());
    result.add(getRenameAction());
    if (separation >= 0) {
        result.addSeparator(new Dimension(separation, 0));
    } else {
        result.addSeparator();
    }
    ResourceKind kind = getResourceKind();
    if (kind.isEnableable()) {
        result.add(getEnableButton());
        if (getResourceKind() == ResourceKind.HOST || getResourceKind() == ResourceKind.TYPE
            || getResourceKind() == ResourceKind.PROLOG
            || getResourceKind() == ResourceKind.CONTROL) {
            result.add(getEnableUniqueAction());
        }
    }
    if (kind == ResourceKind.GROOVY) {
        result.add(getActions().getExecGroovyAction());
    }
    return result;
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:37,代碼來源:ResourceDisplay.java

示例14: createToolBar

import javax.swing.JToolBar; //導入方法依賴的package包/類
/** Creates a tool bar for the label tree. */
public JToolBar createToolBar() {
    JToolBar result = Options.createToolBar();
    result.add(getShowSubtypesButton());
    result.add(getShowSupertypesButton());
    result.addSeparator();
    result.add(getShowAllLabelsButton());
    result.add(getCollapseAllButton());
    // put the sub- and supertype buttons in a button group
    ButtonGroup modeButtonGroup = new ButtonGroup();
    modeButtonGroup.add(getShowSubtypesButton());
    modeButtonGroup.add(getShowSupertypesButton());
    return result;
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:15,代碼來源:TypeTree.java

示例15: createToolBar

import javax.swing.JToolBar; //導入方法依賴的package包/類
private Component createToolBar() {
    JToolBar bar = new JToolBar();
    bar.add(undo);
    bar.add(redo);
    bar.addSeparator();
    bar.add(addRow);
    bar.add(removeRows);
    bar.addSeparator();
    bar.add(openNewWindow);
    bar.addSeparator();
    bar.add(saveAs);
    return bar;
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:14,代碼來源:MainFrame.java


注:本文中的javax.swing.JToolBar.addSeparator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。