Java 类javax.swing.JToolBar 实例源码

项目:xdman    文件:HelpDialog.java   
JToolBar createToolBar() {
    JToolBar toolbar = new JToolBar();
    next = new JButton(XDMIconMap.getIcon("NEXT_ICON"));
    XDMToolBarButtonUI btnUI = new XDMToolBarButtonUI();
    next.setUI(btnUI);
    next.addActionListener(this);
    next.setRolloverIcon(XDMIconMap.getIcon("NEXT_R_ICON"));
    next.setContentAreaFilled(false);
    next.setFocusPainted(false);
    back = new JButton(XDMIconMap.getIcon("BACK_ICON"));
    back.setUI(btnUI);
    back.setContentAreaFilled(false);
    back.setFocusPainted(false);
    back.addActionListener(this);
    back.setRolloverIcon(XDMIconMap.getIcon("BACK_R_ICON"));
    toolbar.add(back);
    toolbar.add(next);
    return toolbar;// add(toolbar, BorderLayout.NORTH);
}
项目:OpenJSharp    文件:SynthToolBarUI.java   
private void updateStyle(JToolBar c) {
    SynthContext context = getContext(
            c, Region.TOOL_BAR_CONTENT, null, ENABLED);
    contentStyle = SynthLookAndFeel.updateStyle(context, this);
    context.dispose();

    context = getContext(c, Region.TOOL_BAR_DRAG_WINDOW, null, ENABLED);
    dragWindowStyle = SynthLookAndFeel.updateStyle(context, this);
    context.dispose();

    context = getContext(c, ENABLED);
    SynthStyle oldStyle = style;

    style = SynthLookAndFeel.updateStyle(context, this);
    if (oldStyle != style) {
        handleIcon =
            style.getIcon(context, "ToolBar.handleIcon");
        if (oldStyle != null) {
            uninstallKeyboardActions();
            installKeyboardActions();
        }
    }
    context.dispose();
}
项目:JavaGraph    文件:GraphEditorTab.java   
@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;
}
项目:Cognizant-Intelligent-Test-Scripter    文件:TestDesignUI.java   
private JPanel getRTreeInPanel(String labelText, JTree tree) {
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());

    JToolBar toolBar = new JToolBar();
    toolBar.setFloatable(false);
    toolBar.setBorder(BorderFactory.createEtchedBorder());
    reusableSwitch = new JButton(labelText);
    reusableSwitch.setFont(new Font("Default", Font.BOLD, 12));
    reusableSwitch.setContentAreaFilled(false);

    toolBar.add(new javax.swing.Box.Filler(new java.awt.Dimension(10, 0),
            new java.awt.Dimension(10, 0),
            new java.awt.Dimension(10, 32767)));
    toolBar.add(reusableSwitch);
    toolBar.setPreferredSize(new java.awt.Dimension(toolBar.getPreferredSize().width, 30));

    panel.add(toolBar, BorderLayout.NORTH);
    panel.add(TreeSearch.installFor(tree), BorderLayout.CENTER);
    return panel;
}
项目:ramus    文件:ReportEditorTest.java   
public ReportEditorTest() {
    setSize(1200, 800);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setLocationRelativeTo(null);
    JPanel panel = new JPanel(new BorderLayout());

    XMLDiagram diagram = new XMLDiagram();
    ReportEditor editor = new ReportEditor(diagram);

    setContentPane(panel);
    JScrollPane pane = new JScrollPane(editor);

    panel.add(pane, BorderLayout.CENTER);
    JToolBar bar = new JToolBar();
    panel.add(bar, BorderLayout.NORTH);
    for (Action action : editor.getActions()) {
        JButton button = bar.add(action);
        button.setText((String) action.getValue(Action.ACTION_COMMAND_KEY));
    }

}
项目:ramus    文件:DockReader.java   
/**
 * Returns the largest preferred height or width (depending on orientation)
 * of all of the associated toolbars.
 */
private int getPreferredDepth() {
    int depth = 0;

    final JToolBar[] toolbars = super.getToolBars();

    for (final JToolBar toolbar : toolbars) {
        final Dimension d = toolbar.getPreferredSize();
        if (getOrientation() == ToolBarLayout.HORIZONTAL)
            depth = Math.max(depth, d.height);
        else
            depth = Math.max(depth, d.width);
    }

    return depth;
}
项目:marathonv5    文件:ToolBarDemo2.java   
public ToolBarDemo2() {
    super(new BorderLayout());

    // Create the toolbar.
    JToolBar toolBar = new JToolBar("Still draggable");
    addButtons(toolBar);
    toolBar.setFloatable(false);
    toolBar.setRollover(true);

    // Create the text area used for output. Request
    // enough space for 5 rows and 30 columns.
    textArea = new JTextArea(5, 30);
    textArea.setEditable(false);
    JScrollPane scrollPane = new JScrollPane(textArea);

    // Lay out the main panel.
    setPreferredSize(new Dimension(450, 130));
    add(toolBar, BorderLayout.PAGE_START);
    add(scrollPane, BorderLayout.CENTER);
}
项目:incubator-netbeans    文件:HierarchyTopComponent.java   
MainToolBar(@NonNull final Pair<JComponent,GridBagConstraints>... components) {
    super(BoxLayout.X_AXIS);
    setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 5));
    final JToolBar toolbar = new NoBorderToolBar(JToolBar.HORIZONTAL);
    toolbar.setFloatable(false);
    toolbar.setRollover(true);
    toolbar.setBorderPainted(false);
    toolbar.setBorder(BorderFactory.createEmptyBorder());
    toolbar.setOpaque(false);
    toolbar.setFocusable(false);
    toolbar.setLayout(new GridBagLayout());
    for (Pair<JComponent,GridBagConstraints> p : components) {
        toolbar.add(p.first(),p.second());
    }
    add (toolbar);
}
项目:marathonv5    文件:ToolBarDemo.java   
public ToolBarDemo() {
    super(new BorderLayout());

    // Create the toolbar.
    JToolBar toolBar = new JToolBar("Still draggable");
    addButtons(toolBar);

    // Create the text area used for output. Request
    // enough space for 5 rows and 30 columns.
    textArea = new JTextArea(5, 30);
    textArea.setEditable(false);
    JScrollPane scrollPane = new JScrollPane(textArea);

    // Lay out the main panel.
    setPreferredSize(new Dimension(450, 130));
    add(toolBar, BorderLayout.PAGE_START);
    add(scrollPane, BorderLayout.CENTER);
}
项目:incubator-netbeans    文件:ResultPanelTree.java   
ResultPanelTree(ResultDisplayHandler displayHandler, StatisticsPanel statPanel) {
        super(new BorderLayout());
        treeView = new ResultTreeView();
        treeView.getAccessibleContext().setAccessibleName(Bundle.ACSN_TestResults());
        treeView.getAccessibleContext().setAccessibleDescription(Bundle.ACSD_TestResults());
        treeView.setBorder(BorderFactory.createEtchedBorder());
//        resultBar.setPassedPercentage(0.0f);
        JToolBar toolBar = new JToolBar();
        toolBar.setFloatable(false);
        toolBar.add(resultBar);
        toolBar.setBorder(BorderFactory.createEtchedBorder());

        add(toolBar, BorderLayout.NORTH);
        add(treeView, BorderLayout.CENTER);

        explorerManager = new ExplorerManager();
        explorerManager.setRootContext(rootNode = new RootNode(displayHandler.getSession(), filterMask));
        explorerManager.addPropertyChangeListener(this);

        initAccessibility();

        this.displayHandler = displayHandler;
        this.statPanel = statPanel;
        displayHandler.setLookup(ExplorerUtils.createLookup(explorerManager, new ActionMap()));
    }
项目:incubator-netbeans    文件:ProfilerPopup.java   
private static List<Component> components(Container aContainer) {
            List<Component> l = new ArrayList();

            for (int i = 0; i < aContainer.getComponentCount(); i++) {
                Component c = aContainer.getComponent(i);
                if (c instanceof JPanel || c instanceof JToolBar)
                    l.addAll(components((Container)c));
                else if (c instanceof JScrollPane)
                    l.addAll(components((Container)((JScrollPane)c).getViewport()));
//                else if (c instanceof JRootPane)
//                    l.addAll(components((Container)((JRootPane)c).getContentPane()));
                else if (focusable(c)) l.add(c);
            }

            return l;
        }
项目:ramus    文件:QualifierSourceSelectPanel.java   
public QualifierSourceSelectPanel(GUIFramework framework,
                                  Qualifier qualifier, QualifierSource qualifierSource, SelectType selectType) {
    super(new BorderLayout());
    this.qualifierSource = qualifierSource;
    view = new SelectableTableView(framework, qualifier) {

    };

    this.add(view.createComponent(), BorderLayout.CENTER);

    view.setSelectType(selectType);
    List<ElementSource> sources = qualifierSource.getElementSources();
    List<Long> rows = new ArrayList<Long>(sources.size());
    for (ElementSource source : sources) {
        rows.add(source.getElement().getId());
    }
    view.selectRows(rows);

    JToolBar toolBar = view.createToolBar();
    this.add(toolBar, BorderLayout.NORTH);
    toolBar.setFloatable(false);
}
项目:incubator-netbeans    文件:InfoPanel.java   
private JToolBar createFilterToolBar() {
    final FiltersDescriptor filtersDesc = FiltersDescriptor.getInstance();
    // configure toolbar
    final JToolBar toolbar = new NoBorderToolBar();
    toolbar.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
    toolbar.setFloatable(false);
    //toolbar.setRollover(true);
    toolbar.setBorderPainted(false);
    toolbar.setOpaque(false);
    if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) { //NOI18N
        toolbar.setBackground(UIManager.getColor("NbExplorerView.background")); //NOI18N
    }
    createFilterToolBarUI(toolbar, filtersDesc);
    filtersDesc.addPropertyChangeListener(new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    createFilterToolBarUI(toolbar, filtersDesc);
                }
            });
        }
    });
    return toolbar;
}
项目:oxygen-git-plugin    文件:WorkingCopySelectionPanel.java   
/**
 * Adds the browse button to the panel
 * 
 * @param gbc
 *          - the constraints used for this component
 * 
 */
private void addBrowseButton(GridBagConstraints gbc) {
    gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
            UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.NONE;
    gbc.gridx = 2;
    gbc.gridy = 0;
    gbc.weightx = 0;
    gbc.weighty = 0;
    browseButton = new ToolbarButton(null, false);
    ImageUtilities imageUtilities = PluginWorkspaceProvider.getPluginWorkspace().getImageUtilities();
    URL resource = getClass().getResource(ImageConstants.FILE_CHOOSER_ICON);
    if (resource != null) {
      ImageIcon icon = (ImageIcon) imageUtilities.loadIcon(resource);
      browseButton.setIcon(icon);
    }
    browseButton.setToolTipText(translator.getTranslation(Tags.BROWSE_BUTTON_TOOLTIP));
    JToolBar browswtoolbar = new JToolBar();
    browswtoolbar.add(browseButton);
    browswtoolbar.setFloatable(false);
    browswtoolbar.setOpaque(false);
    this.add(browswtoolbar, gbc);
}
项目:JavaGraph    文件:TitledPanel.java   
/** Creates a label panel for a given inner component.
 * @param name initial title of the component
 * @param inner the inner component; non-{@code null}
 * @param toolBar the optional tool bar; may be {@code null}
 * @param scroll flag indicating if the inner component should be put inside a {@link JScrollPane}
 */
public TitledPanel(String name, JComponent inner, JToolBar toolBar,
        boolean scroll) {
    super(new BorderLayout(), false);
    setBorder(null);
    this.titleLabel = new JLabel();
    this.titleLabel.setAlignmentX(LEFT_ALIGNMENT);
    setName(name);
    this.inner = inner;
    this.labelPanelTop = Box.createVerticalBox();
    this.labelPanelTop.add(this.titleLabel);
    if (toolBar != null) {
        toolBar.setAlignmentX(LEFT_ALIGNMENT);
        this.labelPanelTop.add(toolBar);
    }
    add(this.labelPanelTop, BorderLayout.NORTH);
    add(scroll ? new JScrollPane(inner) : inner, BorderLayout.CENTER);
}
项目:EditCalculateAndChart    文件:EditCalculateAndChart.java   
private void Init(JScrollPane scroll,JMenuBar JMB, JToolBar tool ){
              add(tool,BorderLayout.NORTH);
              add(scroll,BorderLayout.CENTER);
              setJMenuBar(JMB);
              area.addMouseListener(new TextAreaMouseListener((TextEdit)this));
              area.addKeyListener(new TextAreaKeyListener((TextEdit)this));
              addWindowListener(new WindowEvents(this));
        //setDefaultCloseOperation(EXIT_ON_CLOSE);
        pack();
        area.addKeyListener(k1);
               if(startFile.contentEquals(currentFile))
        setTitle(currentFile);
               else{
                    currentFile=startFile;
                    readInFile(currentFile);
           setTitle(currentFile);
                }
                area.getDocument().addUndoableEditListener(new TEditUndoableEditListener(this));
                this.setIconImage(appIco);
        setVisible(true);

}
项目:incubator-netbeans    文件:MemoryTest.java   
private static void collectToolbars(final List<JToolBar> toolbars, final EditorCookie oc) throws Exception {
    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            JEditorPane [] jeps = oc.getOpenedPanes();

            for(JEditorPane jep : jeps) {
                EditorUI editorUI = Utilities.getEditorUI(jep);
                assertNotNull(editorUI);

                JToolBar toolbar = editorUI.getToolBarComponent();
                assertNotNull(toolbar);
                toolbars.add(toolbar);

                TopComponent tc = findTopComponent(jep);
                //System.out.println("tc = " + tc);
                assertNotNull(tc);

                boolean closed = tc.close();
                assertTrue("Can't close TC", closed);
            }
        }
    });
}
项目:AgentWorkbench    文件:XyTableTab.java   
/**
 * Adds the further buttons for xy-Charts.
 */
private void addFurtherXyButtons() {

    JToolBar jToolBar = this.getToolBar();

    // --- Button for the series-settings -------------
    jToolBar.add(this.getBtnSeriesSettings(), 0);
    jToolBar.add(new JToolBar.Separator(),1);

    // --- Buttons for the series-navigation ----------
    jToolBar.add(this.getBtnPrevSeries(), 2);
    jToolBar.add(this.getBtnNextSeries(), 3);
    jToolBar.add(new JToolBar.Separator(),4);

    // --- Buttons for row-movement -------------------
    jToolBar.add(this.getBtnMoveUp());
    jToolBar.add(this.getBtnMoveDown());
    jToolBar.addSeparator();

}
项目:ramus    文件:DockBoundary.java   
/**
 * Coordinates the actaul location of each toolbar (edge and indicies) with
 * the toolbar's handler.
 */
void refreshHandlers() {
    final String key = Handler.TOOL_BAR_HANDLER_KEY;

    for (int i = 0; i < ourToolBars.size(); i++) {
        final JToolBar toolbar = (JToolBar) ourToolBars.get(i);
        final Object prop = toolbar.getClientProperty(key);
        final Handler handler = (Handler) prop;

        if (handler != null) {
            handler.setDockEdge(getEdge());
            handler.setDockIndex(getDockIndex(toolbar));
            handler.setRowIndex(getRowIndex(toolbar));
        }
    }

}
项目:JavaGraph    文件:LTSDisplay.java   
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());
}
项目:ramus    文件:SelectRowDialog.java   
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;
}
项目:rapidminer    文件:ToggleButtonUI.java   
@Override
public Dimension getPreferredSize(JComponent c) {
    if (c.getParent() instanceof JToolBar) {
        return new Dimension((int) super.getPreferredSize(c).getWidth() + 6,
                (int) super.getPreferredSize(c).getHeight() + 6);
    } else {
        return new Dimension((int) super.getPreferredSize(c).getWidth() + 10, (int) super.getPreferredSize(c)
                .getHeight() + 6);
    }
}
项目:fuck_zookeeper    文件:NodeViewerData.java   
/**
* 
*/
  public NodeViewerData() {
      this.setLayout(new BorderLayout());
      this.dataArea = new JTextPane();
      this.toolbar = new JToolBar();
      this.toolbar.setFloatable(false);
      JScrollPane scroller = new JScrollPane(this.dataArea);
      scroller
              .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
      this.add(scroller, BorderLayout.CENTER);
      this.add(this.toolbar, BorderLayout.NORTH);
      JButton saveButton = new JButton(ZooInspectorIconResources
              .getSaveIcon());
      saveButton.addActionListener(new ActionListener() {

          public void actionPerformed(ActionEvent e) {
              if (selectedNode != null) {
                  if (JOptionPane.showConfirmDialog(NodeViewerData.this,
                          "Are you sure you want to save this node?"
                                  + " (this action cannot be reverted)",
                          "Confirm Save", JOptionPane.YES_NO_OPTION,
                          JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
                      zooInspectorManager.setData(selectedNode, dataArea
                              .getText());
                  }
              }
          }
      });
      this.toolbar.add(saveButton);

  }
项目:oxygen-git-plugin    文件:ToolbarPanel.java   
/**
 * Sets the panel layout and creates all the buttons with their functionality
 * making them visible
 */
public void createGUI() {
    gitToolbar = new JToolBar();
    gitToolbar.setOpaque(false);
    gitToolbar.setFloatable(false);
    this.setLayout(new GridBagLayout());
    this.pushesAhead = GitAccess.getInstance().getPushesAhead();
    this.pullsBehind = GitAccess.getInstance().getPullsBehind();

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.insets = new Insets(0, 0, 0, 0);
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.NONE;
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.weightx = 0;
    gbc.weighty = 0;
    addCloneRepositoryButton();
    addPushAndPullButtons();
    addBranchSelectButton();
    addSubmoduleSelectButton();
    if (gitRepoHasSubmodules()) {
        submoduleSelectButton.setEnabled(true);
    } else {
        submoduleSelectButton.setEnabled(false);
    }
    this.add(gitToolbar, gbc);

    gbc.insets = new Insets(0, 0, 0, 0);
    gbc.anchor = GridBagConstraints.EAST;
    gbc.fill = GridBagConstraints.NONE;
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.weightx = 1;
    gbc.weighty = 0;
    updateStatus();
    this.add(statusInformationLabel, gbc);

    this.setMinimumSize(new Dimension(UIConstants.PANEL_WIDTH, UIConstants.TOOLBAR_PANEL_HEIGHT));
}
项目:openjdk-jdk10    文件:BasicToolBarSeparatorUI.java   
public Dimension getPreferredSize( JComponent c )
{
    Dimension size = ( (JToolBar.Separator)c ).getSeparatorSize();

    if ( size != null )
    {
        return size.getSize();
    }
    else
    {
        return null;
    }
}
项目:ramus    文件:ToolBarLayout.java   
/**
 * Returns the ToolBarHandler attached to the specified toolbar as a client
 * property, or null if no handler is attached.
 */
private Handler extractHandler(final JToolBar toolbar) {
    if (toolbar == null)
        return null;

    final String key = Handler.TOOL_BAR_HANDLER_KEY;

    final Object prop = toolbar.getClientProperty(key);
    return (Handler) prop; // May be null.
}
项目:ramus    文件:ToolBarLayout.java   
/**
 * Provided for those who wish to create their own DockBoundary
 * implementation for functionality not available in the provided docking
 * styles.
 */
public void installDockBoundary(DockBoundary boundary) {
    if (boundary == null)
        return;

    // Make sure that we're running a compatible java spec version. For
    // version 1.2, the UI will maintain control of drag and drop, so we
    // should only use the simplest dock boundary style.
    if (!ourVersionIsCompatible && !(boundary instanceof DockReader))
        boundary = new DockReader(boundary.getEdge());

    final int edge = boundary.getEdge();
    final DockBoundary db = getBoundary(edge);

    // Copy toolbars from old boundary...
    JToolBar[] toolbars = null;
    if (db != null)
        toolbars = db.getToolBars();
    // ...into new boundary.
    if (toolbars != null) {
        for (final JToolBar element : toolbars) {
            boundary.addToolBar(element, 0, MAX);
        }
    }

    if (edge == NORTH)
        ourNorthBoundary = boundary;
    else if (edge == SOUTH)
        ourSouthBoundary = boundary;
    else if (edge == EAST)
        ourEastBoundary = boundary;
    else if (edge == WEST)
        ourWestBoundary = boundary;
}
项目:incubator-netbeans    文件:SystemAction.java   
/** 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;
}
项目:smile_1.5.0_java7    文件:PlotPanel.java   
/**
 * Initialize toolbar.
 */
private void initToolBar() {
    toolbar = new JToolBar(JToolBar.VERTICAL);
    toolbar.setFloatable(false);
    add(toolbar, BorderLayout.WEST);

    JButton button = makeButton("save", SAVE, "Save", "Save");
    toolbar.add(button);

    button = makeButton("print", PRINT, "Print", "Print");
    toolbar.add(button);
}
项目:ramus    文件:Handler.java   
/**
 * Checks to see if the DockBoundary containing the provided toolbar wishes
 * to veto the drag operation at the provided point. Some DockBoundaries may
 * manipulate the positions of the toolbars without this handler having to
 * undock and redock the toolbar.
 */
private boolean isDraggable(final Point point, final JToolBar toolbar) {
    if (toolbar == null)
        return false;

    final DockBoundary boundary = ourDockLayout.getBoundary(point);
    if (boundary == null)
        return true;

    else if (boundary.containsToolBar(toolbar))
        return boundary.isDraggablePoint(point, toolbar);

    else
        return true;
}
项目:rapidminer    文件:FancyDropDownButton.java   
public JButton addToToolbar(JToolBar toolbar, Object mainButtonConstraints, Object arrowButtonConstraints) {
    arrowButtonPanel.add(arrowButton);
    arrowButtonPanel.add(emptyPanel);
    toolbar.add(mainButton, mainButtonConstraints);
    toolbar.add(arrowButtonPanel, arrowButtonConstraints);
    return mainButton;

}
项目:incubator-netbeans    文件:GtkSlidingButtonUI.java   
public void installDefaults (AbstractButton b) {
       super.installDefaults(b);
if(!defaults_initialized) {
           hiddenToggle = new JToggleButton();
           hiddenToggle.setText("");
           JToolBar bar = new JToolBar();
           bar.setRollover(true);
           bar.add(hiddenToggle);
    defaults_initialized = true;
}
   }
项目:rapidminer    文件:IOObjectCacheViewer.java   
/** Initializes the GUI components of the viewer. */
private void initView() {
    // the viewer's toolbar
    JToolBar toolBar = new ExtendedJToolBar(true);
    toolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Colors.TEXTFIELD_BORDER));

    // add actions that clears all entries
    Action clearAction = new ClearCacheAction(map);
    toolBar.add(clearAction);

    // setup the header column (reuse the layout of the entries)
    JPanel headerPanel = new JPanel(IOObjectCacheEntryPanel.ENTRY_LAYOUT);
    headerPanel.add(Box.createVerticalStrut(16), IOObjectCacheEntryPanel.ICON_CONSTRAINTS);
    JLabel typeLabel = new JLabel(I18N.getGUILabel("ioobject_viewer.type"));
    typeLabel.setFont(getFont().deriveFont(Font.ITALIC));
    headerPanel.add(typeLabel, IOObjectCacheEntryPanel.TYPE_CONSTRAINTS);
    JLabel keyLabel = new JLabel(I18N.getGUILabel("ioobject_viewer.key"));
    keyLabel.setFont(getFont().deriveFont(Font.ITALIC));
    headerPanel.add(keyLabel, IOObjectCacheEntryPanel.KEY_CONSTRAINTS);
    headerPanel.add(Box.createVerticalStrut(24), IOObjectCacheEntryPanel.REMOVE_BUTTON_CONSTRAINTS);

    // create entries panel and embed in scroll pane
    scrollPane = new ExtendedJScrollPane(createEntriesPanel());
    scrollPane.setBorder(null);

    // panel containing the header row and the actual entries
    JPanel contentPanel = new JPanel(new BorderLayout());
    contentPanel.add(headerPanel, BorderLayout.NORTH);
    contentPanel.add(scrollPane, BorderLayout.CENTER);

    // put everything together
    add(toolBar, BorderLayout.NORTH);
    add(contentPanel, BorderLayout.CENTER);
}
项目:incubator-netbeans    文件:MetalSlidingButtonUI.java   
public void installDefaults (AbstractButton b) {
       super.installDefaults(b);
if(!defaults_initialized) {
           hiddenToggle = new JToggleButton();
           hiddenToggle.setText("");
           JToolBar bar = new JToolBar();
           bar.setRollover(true);
           bar.add(hiddenToggle);
    defaults_initialized = true;
}
   }
项目:incubator-netbeans    文件:WinXPSlidingButtonUI.java   
@Override
   public void installDefaults (AbstractButton b) {
       super.installDefaults(b);
if(!defaults_initialized) {
           hiddenToggle = new JToggleButton();
           hiddenToggle.setText("");
           JToolBar bar = new JToolBar();
           bar.add(hiddenToggle);
    defaults_initialized = true;
}
   }
项目:ramus    文件:StackingDockBoundary.java   
/**
 * Implementation of the absract superclass method, returns the index of the
 * specified toolbar within this boundary, or -1 if the toolbar is not
 * present.
 */
@Override
public int getDockIndex(final JToolBar toolbar) {
    final DockSliver sliver = getDockSliver(toolbar);
    if (sliver == null)
        return -1;
    else
        return sliver.getDockIndex(toolbar);
}
项目:incubator-netbeans    文件:AbstractToolbarFactory.java   
public JToolBar createToolbar(String containerCtx) {
    JToolBar result = new JToolBar();
    result.setName(containerCtx);
    result.putClientProperty (KEY_CONTAINERCTX, containerCtx);
    result.putClientProperty (KEY_CREATOR, this);
    attachToToolbar(containerCtx, result);
    populateToolbar(containerCtx, result); //XXX listener should do this
    return result;
}
项目:ramus    文件:StackingDockBoundary.java   
/**
 * Returns the DockSliver containing the specified toolbar or null if no
 * DockSliver contains this toolbar.
 */
private DockSliver getDockSliver(final JToolBar toolbar) {
    for (int i = 0; i < ourDockSlivers.size(); i++) {
        final DockSliver sliver = (DockSliver) ourDockSlivers.get(i);
        if (sliver.containsToolBar(toolbar))
            return sliver;
    }

    return null;
}
项目:ramus    文件:EditUsersDialog.java   
public EditUsersDialog(JFrame frame, UserFactory userFactory,
                       AdminPanelPlugin plugin, Engine engine) {
    super(frame, true);
    this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    this.factory = userFactory;
    this.plugin = plugin;

    this.setTitle(plugin.getString("Action.EditUsers"));

    users = factory.getUsers();
    groups = factory.getGroups();
    qualifiers = engine.getQualifiers();

    createModels();

    createActions();

    JComponent userPanel = createUserPanel();
    JComponent groupPanel = createGroupPanel();

    JSplitPane pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    pane.setLeftComponent(userPanel);
    pane.setRightComponent(groupPanel);
    JToolBar panel = new JToolBar();
    panel.add(createUser).setFocusable(false);
    panel.add(editUser).setFocusable(false);
    panel.add(deleteUser).setFocusable(false);
    panel.add(createGroup).setFocusable(false);
    panel.add(deleteGroup).setFocusable(false);

    JPanel panel2 = new JPanel(new BorderLayout());
    panel2.add(panel, BorderLayout.NORTH);
    panel2.add(pane, BorderLayout.CENTER);
    pane.setDividerLocation(300);
    setMainPane(panel2);
    this.setMinimumSize(new Dimension(800, 600));
    this.setLocationRelativeTo(null);
    Options.loadOptions(this);
}
项目:gate-core    文件:RelationSetView.java   
@Override
public Resource init() {
  setLayout(new BorderLayout());

  text.setEditable(false);

  add(text, BorderLayout.CENTER);

  JButton btnRefresh = new JButton("Refresh", MainFrame.getIcon("Refresh"));
  btnRefresh.addActionListener(new ActionListener() {

    @Override
    public void actionPerformed(ActionEvent arg0) {
      refresh();
    }
  });

  JToolBar toolbar = new JToolBar(JToolBar.HORIZONTAL);
  toolbar.setFloatable(false);

  toolbar.add(btnRefresh);
  toolbar.addSeparator();
  toolbar.add(new JLabel("Currently this view is not automatically updated"));

  // not currently need as we now support the listners properly
  // add(toolbar, BorderLayout.NORTH);

  return this;
}