Java 类javax.swing.JTabbedPane 实例源码

项目:incubator-netbeans    文件:RefactoringPanelContainer.java   
void closeAllButCurrent() {
    Component comp = getComponent(0);
    if (comp instanceof JTabbedPane) {
        JTabbedPane tabs = (JTabbedPane) comp;
        Component current = tabs.getSelectedComponent();
        int tabCount = tabs.getTabCount();
        // #172039: do not use tabs.getComponents()
        Component[] c = new Component[tabCount - 1];
        for (int i = 0, j = 0; i < tabCount; i++) {
            Component tab = tabs.getComponentAt(i);
            if (tab != current) {
                c[j++] = tab;
            }
        }
        for (int i = 0; i < c.length; i++) {
            ((RefactoringPanel) c[i]).close();
        }
    }
}
项目:incubator-netbeans    文件:RefactoringPanelContainer.java   
@Override
protected void componentClosed() {
    isVisible = false;
    if (getComponentCount() == 0) {
        return ;
    }
    Component comp = getComponent(0);
    if (comp instanceof JTabbedPane) {
        JTabbedPane pane = (JTabbedPane) comp;
        // #172039: do not use tabs.getComponents()
        Component[] c = new Component[pane.getTabCount()];
        for (int i = 0; i < c.length; i++) {
            c[i] = pane.getComponentAt(i);
        }
        for (int i = 0; i < c.length; i++) {
            ((RefactoringPanel) c[i]).close();
        }
    } else if (comp instanceof RefactoringPanel) {
        ((RefactoringPanel) comp).close();
    }
}
项目:ants    文件:MenuListener.java   
/**
 * {@link ChangeEvent} of the {@link #tabbedPane} (Menu: Single Player /
 * Duel / Tournament / About)
 */
@Override
public void stateChanged(ChangeEvent e) {
    if (e.getSource() instanceof JTabbedPane) {
        if (tabbedPane.getSelectedIndex() == 4) {
            if (buttonStart != null) {
                buttonStart.setEnabled(false);
            }
            if (runInBackgroundCheckbox != null) {
                runInBackgroundCheckbox.setEnabled(false);
            }
        } else {
            if (buttonStart != null) {
                buttonStart.setEnabled(true);
            }
            if (runInBackgroundCheckbox != null) {
                runInBackgroundCheckbox.setEnabled(true);
            }
        }
    }

}
项目:incubator-netbeans    文件:CollapsiblePanel.java   
public HookPanel(VCSCommitPanel master, Collection<? extends VCSHook> hooks, VCSHookContext hookContext) {            
    super(master, (hooks.size() == 1)
            ? hooks.iterator().next().getDisplayName()
            : getMessage("LBL_Advanced"), //NOI18N
            DEFAULT_DISPLAY_HOOKS);
    this.hooks = hooks;
    this.hookContext = hookContext;

    // need this to happen in addNotify() - depends on how 
    // repositoryComboSupport in hook.createComponents works for bugzilla|jira
    if (hooks.size() == 1) {                
        JPanel p = hooks.iterator().next().createComponent(hookContext);
        if (Boolean.TRUE.equals(p.getClientProperty("prop.requestOpened"))) { //NOI18N - some hook panels may want to be opened (hg queue hook with previously configured setts)
            super.displaySection();
        }
        sectionPanel.add(p);
    } else {
        JTabbedPane hooksTabbedPane = new JTabbedPane();
        for (VCSHook hook : hooks) {
            hooksTabbedPane.add(hook.createComponent(hookContext), hook.getDisplayName().replaceAll("\\&", ""));
        }
        sectionPanel.add(hooksTabbedPane);
    }
}
项目:KernelHive    文件:MainFrame.java   
private void initSidePane() {
    sidePane = new JTabbedPane(JTabbedPane.TOP);
    centerPane.setLeftComponent(sidePane);
    sidePane.setMinimumSize(new Dimension(180, 0));

    projectPanel = new JPanel();
    sidePane.addTab("Project", null, projectPanel, null);
    projectPanel.setLayout(new BorderLayout(0, 0));

    projectScrollPane = new JScrollPane();
    projectPanel.add(projectScrollPane, BorderLayout.CENTER);

    repositoryPanel = new JPanel();
    sidePane.addTab("Repository", null, repositoryPanel, null);
    repositoryPanel.setLayout(new BorderLayout(0, 0));

    repositoryScrollPane = new JScrollPane();
    repositoryPanel.add(repositoryScrollPane, BorderLayout.CENTER);
}
项目:java-course    文件:JNotepadPP.java   
/**
 * Creates new {@link JTabbedPane} with {@link ChangeListener}.
 */
private void tabbedPaneFactory() {
    tabs = new JTabbedPane();
    tabs.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
    tabs.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            int index = tabs.getSelectedIndex();
            activeEditor = editors.get(index);
            if (editors.size() > 1) {
                activeEditor.updateStatusBar();
            }
            updateFrameTitle();
        }

    });
}
项目:openjdk-jdk10    文件:bug8017284.java   
public static void main(String[] args) throws Exception {

        Robot robot = new Robot();
        SwingUtilities.invokeAndWait(() -> {
            frame = new JFrame();
            frame.setSize(500, 500);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

            tabbedPane = new JTabbedPane();

            for (int i = 0; i < TAB_COUNT; i++) {
                tabbedPane.add("Header " + i, new JLabel("Content: " + i));
            }

            frame.getContentPane().setLayout(new BorderLayout());
            frame.getContentPane().add(tabbedPane, BorderLayout.CENTER);
            frame.setVisible(true);
        });

        robot.waitForIdle();

        SwingUtilities.invokeAndWait(() -> {
            for (int j = 0; j < ITERATIONS; j++) {
                for (int i = 0; i < TAB_COUNT; i++) {
                    tabbedPane.setTitleAt(i, getHtmlText(j * TAB_COUNT + i));
                }
            }
        });
        robot.waitForIdle();

        SwingUtilities.invokeAndWait(() -> frame.dispose());
    }
项目:NovelJ    文件:SettingsWindow_Windows.java   
/**
 * Initialize the contents of the frame.
 */
private void initialize() {
    frame = new JFrame();
    frame.setBounds(100, 100, 450, 300);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().setLayout(new GridLayout(1, 0, 0, 0));

    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    frame.getContentPane().add(tabbedPane);

    JScrollPane scrollPane = new JScrollPane();
    tabbedPane.addTab("New tab", null, scrollPane, null);

    JScrollPane scrollPane_1 = new JScrollPane();
    tabbedPane.addTab("New tab", null, scrollPane_1, null);
}
项目:incubator-netbeans    文件:DefaultDiffControllerProviderTest.java   
public void testTextualDiffContent () throws Exception {
    File diffFile = new File(getDataDir(), "enhancedview/diff");
    String goldenText = getFileContents(diffFile);
    goldenText = MessageFormat.format(goldenText, new Object[] {"a/", "b/"});

    final JTabbedPane tabbedPane = findTabbedPane(enhanced.getJComponent());
    JPanel p = (JPanel) tabbedPane.getComponentAt(1);
    tabbedPane.setSelectedIndex(1);
    JEditorPane pane = findEditorPane(p);
    assertFalse(pane == null);
    String text = pane.getText();
    for (int i = 0; i < 100; ++i) {
        if (!text.isEmpty()) {
            break;
        }
        Thread.sleep(100);
        text = pane.getText();
    }
    assertEquals(goldenText, text);
    EventQueue.invokeAndWait(new Runnable() {
        @Override
        public void run () {
            tabbedPane.setSelectedIndex(0);
        }
    });
}
项目:incubator-netbeans    文件:PluginManagerUI.java   
private void tpTabsStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_tpTabsStateChanged
    Component component = ((JTabbedPane) evt.getSource ()).getSelectedComponent ();
    if (component instanceof SettingsTab) {
        int i = ((SettingsTab)component).getSelectedRow();
        ((SettingsTab)component).getSettingsTableModel ().refreshModel ();
        if (i > -1) {
            ((SettingsTab)component).setSelectedRow(i);
        }
        wasSettings = true;
    } else {
        if (wasSettings) {
            final UnitCategoryTableModel availableModel = (UnitCategoryTableModel) (availableTable).getModel ();
            final Map<String, Boolean> availableState = UnitCategoryTableModel.captureState (availableModel.getUnits ());
            ((SettingsTab) tpTabs.getComponentAt (INDEX_OF_SETTINGS_TAB)).doLazyRefresh (new Runnable () { // get SettingsTab
                @Override
                public void run () {
                    UnitCategoryTableModel.restoreState (availableModel.getUnits (), availableState, false);
                }
            });
        }
        wasSettings = false;
    }
}
项目:incubator-netbeans    文件:OptionsPanel.java   
private void computeOptionsWords() {
    Set<Map.Entry<String, CategoryModel.Category>> categories = categoryModel.getCategories();
    categoryid2tabs = new HashMap<String, HashMap<Integer, TabInfo>>();
    for (Map.Entry<String, CategoryModel.Category> set : categories) {
        JComponent jcomp = set.getValue().getComponent();
        String id = set.getValue().getID();
        if(jcomp instanceof JTabbedPane) {
            categoryid2tabbedpane.put(id, (JTabbedPane)jcomp);
        } else if(jcomp instanceof AdvancedPanel) {
            categoryid2tabbedpane.put(id, (JTabbedPane)jcomp.getComponent(0));
        } else if (jcomp instanceof Container) {
            handleAllComponents((Container) jcomp, id, null, -1);
        }
    }

    FileObject keywordsFOs = FileUtil.getConfigRoot().getFileObject(CategoryModel.OD_LAYER_KEYWORDS_FOLDER_NAME);

    for(FileObject keywordsFO : keywordsFOs.getChildren()) {
        handlePanel(keywordsFO);
    }
}
项目:incubator-netbeans    文件:OptionsPanel.java   
private void handleAllComponents(Container container, String categoryID, JTabbedPane tabbedPane, int index) {
    Component[] components = container.getComponents();
    Component component;
    for (int i = 0; i < components.length; i++) {
        component = components[i];
        String text;

        if(component instanceof JTabbedPane) {
            if(categoryid2tabbedpane.get(categoryID) == null) {
                categoryid2tabbedpane.put(categoryID, (JTabbedPane)component);
            }
        } else {
            handleAllComponents((Container)component, categoryID, tabbedPane, index);
        }
    }

}
项目:incubator-netbeans    文件:CodeTemplatesPanel.java   
private static void loc(JTabbedPane p, int tabIdx, String key, JEditorPane ep) {
    JLabel label = new JLabel(); // Only for setting tab names

    String tabName = loc("CTL_" + key); //NOI18N
    Mnemonics.setLocalizedText(label, tabName);
    p.setTitleAt(tabIdx, label.getText());

    int idx = Mnemonics.findMnemonicAmpersand(tabName);
    if (idx != -1 && idx + 1 < tabName.length()) {
        char ch = Character.toUpperCase(tabName.charAt(idx + 1));
        p.setMnemonicAt(tabIdx, ch);
        if (ep != null) {
            ep.setFocusAccelerator(ch);
        }
    }
}
项目:Equella    文件:DrmPageEditor.java   
@Override
@SuppressWarnings("nls")
public void init()
{
    setShowScripting(true);

    configTab = new DRMConfigTab();
    rightsTab = new DRMRightsTab();
    accessControlTab = new DRMAccessControlTab(getClientService().getService(RemoteUserService.class));
    requireAcceptanceFromTab = new DRMRequireAcceptanceFromTab();

    JTabbedPane tabs = new JTabbedPane();
    tabs.addTab(CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drmpageeditor.config"), configTab);
    tabs.addTab(CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drmpageeditor.rights"), rightsTab);
    tabs.addTab(CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drmpageeditor.access"), accessControlTab);
    tabs.addTab(CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drmpageeditor.requires"),
        requireAcceptanceFromTab);

    addSection(tabs);
}
项目:jmeter-bzm-plugins    文件:ViewResultsFullVisualizer.java   
/**
 * Initialize this visualizer
 * @throws ClassNotFoundException 
 * @throws IllegalAccessException 
 * @throws InstantiationException 
 */
private void init() {  // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    log.debug("init() - pass");
    setLayout(new BorderLayout(0, 5));
    setBorder(makeBorder());
    add(makeTitlePanel(), BorderLayout.NORTH);

    leftSide = createLeftPanel();
    // Prepare the common tab
    rightSide = new JTabbedPane();

    // Create the split pane
    mainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftSide, rightSide);
    mainSplit.setOneTouchExpandable(true);

    JSplitPane searchAndMainSP = new JSplitPane(JSplitPane.VERTICAL_SPLIT, 
            new SearchTreePanel(root), mainSplit);
    searchAndMainSP.setOneTouchExpandable(true);
    add(searchAndMainSP, BorderLayout.CENTER);
    // init right side with first render
    resultsRender.setRightSide(rightSide);
    resultsRender.init();
}
项目:scorekeeperfrontend    文件:QuickEntrySearch.java   
@Override
public void event(MT type, Object data)
{
    switch (type)
    {
        case QUICKID_SEARCH:
            if (getParent() instanceof JTabbedPane)
                ((JTabbedPane)getParent()).setSelectedComponent(this);
            entry.requestFocus();
        case EVENT_CHANGED:
        case ENTRANTS_CHANGED:
            cars.setRowSorter(null); // clear sorter so its listener based on old model size goes away
            cars.setModel(new EntryModel());
            TableColumnModel tcm = cars.getColumnModel();
            setColumnWidths(tcm.getColumn(0), 80, 160, 320);
            setColumnWidths(tcm.getColumn(1), 40, 80, 160);
            setColumnWidths(tcm.getColumn(2), 40, 80, 160);
            break;
    }
}
项目:ramus    文件:DFDObjectDialog.java   
public DFDObjectDialog(GUIFramework framework, DataPlugin dataPlugin) {
    super(framework.getMainFrame(), true);

    setTitle("dfd_object_options");

    this.dataPlugin = dataPlugin;
    this.framework = framework;

    JTabbedPane pane = new JTabbedPane();

    pane.addTab(ResourceLoader.getString("dfd_object"), createFirstTab(pane));
    pane.addTab(ResourceLoader.getString("font"), fontChooser);
    pane.addTab(ResourceLoader.getString("bk_color"),
            backgroundColorChooser);
    pane.addTab(ResourceLoader.getString("fg_color"),
            foregroundColorChooser);

    setMainPane(pane);

    ResourceLoader.setJComponentsText(this);

    this.pack();
    this.setMinimumSize(getSize());
    centerDialog();
    Options.loadOptions(this);
}
项目:marathonv5    文件:RComponentFactory.java   
public static void reset() {
    entries.clear();
    add(Component.class, RUnknownComponent.class);
    add(Window.class, RWindow.class);
    add(JTable.class, RTable.class);
    add(JTableHeader.class, RTableHeader.class);
    add(AbstractButton.class, RAbstractButton.class);
    add(JToggleButton.class, RToggleButton.class);
    add(JComboBox.class, RComboBox.class);
    add(JTextComponent.class, RTextComponent.class);
    add(JTree.class, RTree.class);
    add(JList.class, RList.class);
    add(JTabbedPane.class, RTabbedPane.class);
    add(JMenuItem.class, RMenuItem.class);
    add(JSlider.class, RSlider.class);
    add(JProgressBar.class, RProgressBar.class);
    add(JSpinner.class, RSpinner.class);
    add(DefaultEditor.class, RDefaultEditor.class);
    add(JColorChooser.class, RColorChooser.class);
    add(JSplitPane.class, RSplitPane.class);
    add(BasicSplitPaneDivider.class, RSplitPane.class);
    add(JFileChooser.class, RFileChooser.class);
    add(JEditorPane.class, REditorPane.class);
    add(JLabel.class, RLabel.class);
    add(JScrollBar.class, RIgnoreComponent.class);
}
项目:marathonv5    文件:JTabbedPaneJavaElementTest.java   
public void selectTabWithMultipleDuplicates() {
    siw(new Runnable() {

        @Override public void run() {
            JTabbedPane tp = (JTabbedPane) ComponentUtils.findComponent(JTabbedPane.class, frame);
            tp.addTab("Tab 2", icon, makeTextPanel("Panel #5"), "is a duplicate");
            tp.addTab("Tab 2", icon, makeTextPanel("Panel #6"), "is a duplicate");
        }
    });
    IJavaElement tabbedPane = driver.findElementByTagName("tabbed-pane");
    IJavaElement tab1 = tabbedPane.findElementByCssSelector(".::nth-tab(2)");
    tab1.click();
    AssertJUnit.assertEquals("1", tabbedPane.getAttribute("selectedIndex"));
    AssertJUnit.assertEquals("Tab 2", tab1.getText());

    IJavaElement tab2 = tabbedPane.findElementByCssSelector(".::nth-tab(5)");
    tab2.click();
    AssertJUnit.assertEquals("4", tabbedPane.getAttribute("selectedIndex"));
    AssertJUnit.assertEquals("Tab 2(1)", tab2.getText());

    IJavaElement tab3 = tabbedPane.findElementByCssSelector(".::nth-tab(6)");
    tab3.click();
    AssertJUnit.assertEquals("5", tabbedPane.getAttribute("selectedIndex"));
    AssertJUnit.assertEquals("Tab 2(2)", tab3.getText());
}
项目:openjdk-jdk10    文件:ScrollableTabbedPaneTest.java   
private static void createLeftUI(final String shortLAF)
        throws Exception {
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override
        public void run() {
            frame = new JFrame(shortLAF);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
            pane = new JTabbedPane();
            pane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
            pane.setTabPlacement(SwingConstants.LEFT);
            frame.add(pane);
            frame.setSize(500, 500);
        }
    });
}
项目:alevin-svn2    文件:PaneledGuiDemo.java   
@Override
protected JComponent createRightPane() {
    JTabbedPane tabs = new JTabbedPane();
    tabs.addTab("One", new SelectionPanel(graphpanel));
    tabs.addTab("Two", new JLabel("Two"));
    tabs.addTab("Three", new JLabel("Three"));
    tabs.setPreferredSize(new Dimension(80, 300));
    return tabs;
}
项目:openjdk-jdk10    文件:JTabbedPaneOperator.java   
/**
 * Maps {@code JTabbedPane.getComponentAt(int)} through queue
 */
public Component getComponentAt(final int i) {
    return (runMapping(new MapAction<Component>("getComponentAt") {
        @Override
        public Component map() {
            return ((JTabbedPane) getSource()).getComponentAt(i);
        }
    }));
}
项目:VISNode    文件:ExceptionPanel.java   
/**
 * Build tabs for the exceptions
 * 
 * @return JComponent
 */
private JComponent buildTabs() {
    JTabbedPane tabs = new JTabbedPane();
    for (Exception exception : exceptions) {
        if (tabs.getTabCount() > EXCEPTION_LIMIT) {
            tabs.add("And " + (exceptions.size() - EXCEPTION_LIMIT) + " more", Labels.create().icon(IconFactory.get().create("fa:frown-o")));
            break;
        }
        tabs.add(exception.getClass().getSimpleName(), buildExceptionPane(exception));
    }
    return tabs;
}
项目:QN-ACTR-Release    文件:StationParameterPanel.java   
private void initComponents() {
    this.setLayout(new BorderLayout(5, 5));
    mainPanel = new JTabbedPane();
    mainPanel.setBorder(title);

    // Adds a change listener to perform gotFocus() and lostFocus() calls on wizardPanels
    mainPanel.addChangeListener(new ChangeListener() {

        /**
         * Invoked when the target of the listener has changed its state.
         *
         * @param e a ChangeEvent object
         */
        public void stateChanged(ChangeEvent e) {
            // Lose focus on old panel
            if (current != null) {
                current.lostFocus();
            }
            // gets focus on new panel
            if (mainPanel.getSelectedComponent() != null) {
                current = (WizardPanel) mainPanel.getSelectedComponent();
                current.gotFocus();
            }
        }
    });
    add(mainPanel, BorderLayout.CENTER);
}
项目:Logisim    文件:LogFrame.java   
public LogFrame(Project project) {
    this.project = project;
    this.windowManager = new WindowMenuManager();
    project.addProjectListener(myListener);
    project.addLibraryListener(myListener);
    setDefaultCloseOperation(HIDE_ON_CLOSE);
    setJMenuBar(new LogisimMenuBar(this, project));
    setSimulator(project.getSimulator(), project.getCircuitState());

    panels = new LogPanel[] { new SelectionPanel(this), new ScrollPanel(this), new FilePanel(this), };
    tabbedPane = new JTabbedPane();
    for (int index = 0; index < panels.length; index++) {
        LogPanel panel = panels[index];
        tabbedPane.addTab(panel.getTitle(), null, panel, panel.getToolTipText());
    }

    JPanel buttonPanel = new JPanel();
    buttonPanel.add(clearLog);
    clearLog.addActionListener(myListener);

    Container contents = getContentPane();
    tabbedPane.setPreferredSize(new Dimension(450, 300));
    contents.add(tabbedPane, BorderLayout.CENTER);
    contents.add(buttonPanel, BorderLayout.SOUTH);

    LocaleManager.addLocaleListener(myListener);
    myListener.localeChanged();
    pack();
    setLocationRelativeTo(null);
}
项目:marathonv5    文件:JTabbedPaneJavaElementTest.java   
public void assertContentWithDuplicates() {
    IJavaElement tabbedPane = driver.findElementByTagName("tabbed-pane");
    siw(new Runnable() {
        @Override public void run() {
            JTabbedPane tp = (JTabbedPane) ComponentUtils.findComponent(JTabbedPane.class, frame);
            tp.setTitleAt(2, "Tab 2");
        }
    });
    AssertJUnit.assertEquals("[[\"Tab 1\",\"Tab 2\",\"Tab 2(1)\",\"Tab 4\"]]", tabbedPane.getAttribute("content"));
}
项目:openjdk-jdk10    文件:JTabbedPaneOperator.java   
/**
 * Maps {@code JTabbedPane.getSelectedIndex()} through queue
 */
public int getSelectedIndex() {
    return (runMapping(new MapIntegerAction("getSelectedIndex") {
        @Override
        public int map() {
            return ((JTabbedPane) getSource()).getSelectedIndex();
        }
    }));
}
项目:OpenJSharp    文件:MultiTabbedPaneUI.java   
/**
 * Invokes the <code>tabForCoordinate</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int tabForCoordinate(JTabbedPane a, int b, int c) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).tabForCoordinate(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).tabForCoordinate(a,b,c);
    }
    return returnValue;
}
项目:openjdk-jdk10    文件:JTabbedPaneOperator.java   
@Override
public Hashtable<String, Object> getDump() {
    Hashtable<String, Object> result = super.getDump();
    if (((JTabbedPane) getSource()).getSelectedIndex() != -1) {
        result.put(SELECTED_PAGE_DPROP, ((JTabbedPane) getSource()).
                getTitleAt(((JTabbedPane) getSource()).getSelectedIndex()));
    }
    String[] pages = new String[((JTabbedPane) getSource()).getTabCount()];
    for (int i = 0; i < ((JTabbedPane) getSource()).getTabCount(); i++) {
        pages[i] = ((JTabbedPane) getSource()).getTitleAt(i);
    }
    addToDump(result, PAGE_PREFIX_DPROP, pages);
    return result;
}
项目:jaer    文件:Tmpdiff128.java   
/** @return a new panel for controlling this bias generator functionally
 */
@Override
public JPanel buildControlPanel() {
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    JTabbedPane pane = new JTabbedPane();

    pane.addTab("Biases", super.buildControlPanel());
    pane.addTab("User friendly controls", new Tmpdiff128FunctionalBiasgenPanel(Tmpdiff128.this));
    panel.add(pane, BorderLayout.CENTER);
    return panel;
}
项目:openjdk-jdk10    文件:MultiTabbedPaneUI.java   
/**
 * Invokes the <code>getTabRunCount</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getTabRunCount(JTabbedPane a) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabRunCount(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabRunCount(a);
    }
    return returnValue;
}
项目:incubator-netbeans    文件:InnerTabsPanel.java   
private void fireChanged() {
    boolean isChanged = false;
    if (checkShowFolderName.isSelected() != settings.isShowFolderName()
            || checkShowFullPath.isSelected() != settings.isShowFullPath()
            || checkProjectColors.isSelected() != settings.isSameProjectSameColor()
            || checkSortDocumentList.isSelected() != settings.isSortDocumentListByProject()) {
        isChanged = true;
    }

    int rowCount = settings.getRowCount();
    if (checkMultiRow.isSelected() && radioRowCount.isSelected()) {
        rowCount = ((Number) spinRowCount.getValue()).intValue();
    }
    if (checkMultiRow.isSelected() != (rowCount > 1 || settings.isTabRowPerProject())) {
        isChanged = true;
    }
    if (rowCount != settings.getRowCount()) {
        isChanged = true;
    }
    if (radioRowPerProject.isSelected() != settings.isTabRowPerProject()) {
        isChanged = true;
    }

    if(radioPlacementBottom.isSelected() && settings.getTabsLocation() != JTabbedPane.BOTTOM
            || radioPlacementLeft.isSelected() && settings.getTabsLocation() != JTabbedPane.LEFT
            || radioPlacementRight.isSelected() && settings.getTabsLocation() != JTabbedPane.RIGHT
            || radioPlacementTop.isSelected() && settings.getTabsLocation() != JTabbedPane.TOP) {
        isChanged = true;
    }
    controller.changed(null, isChanged);
}
项目:incubator-netbeans    文件:TabDisplayerFactory.java   
@Override
public TabDisplayer createTabDisplayer( TabDataModel tabModel, int orientation ) {
    Settings settings = Settings.getDefault();
    boolean multiRow = settings.getRowCount() > 1 || settings.isTabRowPerProject();
    if( multiRow && (orientation == JTabbedPane.TOP || orientation == JTabbedPane.BOTTOM) ) {
        if( settings.isTabRowPerProject() ) {
            return new RowPerProjectTabDisplayer( tabModel, orientation );
        }
        return new MultiRowTabDisplayer( tabModel, orientation );
    }
    return new SimpleTabDisplayer( tabModel, orientation );
}
项目:openjdk-jdk10    文件:JTabbedPaneOperator.java   
/**
 * Maps {@code JTabbedPane.setEnabledAt(int, boolean)} through queue
 */
public void setEnabledAt(final int i, final boolean b) {
    runMapping(new MapVoidAction("setEnabledAt") {
        @Override
        public void map() {
            ((JTabbedPane) getSource()).setEnabledAt(i, b);
        }
    });
}
项目:openjdk-jdk10    文件:JTabbedPaneOperator.java   
/**
 * Maps {@code JTabbedPane.getTabCount()} through queue
 */
public int getTabCount() {
    return (runMapping(new MapIntegerAction("getTabCount") {
        @Override
        public int map() {
            return ((JTabbedPane) getSource()).getTabCount();
        }
    }));
}
项目:incubator-netbeans    文件:AbstractTabDisplayer.java   
@Override
public Insets getAutoscrollInsets() {
    if( orientation == JTabbedPane.HORIZONTAL ) {
        return new Insets( 0, 25, 0, 25 );
    } else {
        return new Insets( 25, 0, 25, 0 );
    }
}
项目:JavaGraph    文件:DisplaysPanel.java   
/** Indicates if a list panel should go onto the upper or the lower pane. */
private JTabbedPane getListsPanel(DisplayKind kind) {
    JTabbedPane result = null;
    switch (kind.getListPanel()) {
    case 0:
        result = getUpperListsPanel();
        break;
    case 1:
        result = getLowerListsPanel();
    }
    return result;
}
项目:jreliability    文件:MeasuresPanel.java   
/**
 * Initializes the {@link MeasuresPanel} by adding all single {@link MeasurePanel}s to a {@link JTabbedPane}.
 */
protected void initialize() {
    tabs = new JTabbedPane();
    for (Entry<String, ReliabilityFunction> entry : reliabilityFunctions.entrySet()) {
        String name = entry.getKey();
        ReliabilityFunction function = entry.getValue();
        MeasurePanel measurePanel = new MeasurePanel(function);
        tabs.addTab(name, measurePanel);
    }
    this.add(tabs);
    this.setBorder(
            BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Reliability-related Measures"),
                    BorderFactory.createEmptyBorder(5, 0, 0, 0)));
}
项目:bbm487s2017g1    文件:LibrarianBookOperations.java   
/**
 * Initialize the contents of the frame.
 */
private void initialize(String username) {

    frame = new JFrame("Library Book Loan System - Librarian: " + username);
    frame.setResizable(false);
    frame.setBounds(100, 100, 586, 418);
    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

    JPanel panel = new JPanel();
    frame.getContentPane().add(panel, BorderLayout.CENTER);
    panel.setLayout(null);

    JLabel label = new JLabel("Library Book Loan System");
    label.setHorizontalAlignment(SwingConstants.CENTER);
    label.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
    label.setBounds(10, 11, 564, 25);
    panel.add(label);

    JLabel lblBookOperations = new JLabel("Book Operations");
    lblBookOperations.setHorizontalAlignment(SwingConstants.CENTER);
    lblBookOperations.setFont(new Font("Segoe UI Light", Font.PLAIN, 14));
    lblBookOperations.setBounds(10, 40, 564, 22);
    panel.add(lblBookOperations);

    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    tabbedPane.setBackground(Color.LIGHT_GRAY);
    tabbedPane.setBounds(10, 73, 564, 295);
    panel.add(tabbedPane);


    initCreateTab(tabbedPane);
    initUpdateTab(tabbedPane);
    initDeleteTab(tabbedPane);
    initViewTab(tabbedPane);
}
项目:Equella    文件:ScriptEditor.java   
@Override
protected void setup()
{
    scriptTab = new ScriptTab(changeDetector);
    notificationsTab = new NotificationsTab(changeDetector, userService);
    final JTabbedPane tabs = new JTabbedPane();
    tabs.add(CurrentLocale.get("com.tle.admin.workflow.editor.scripteditor.details"), scriptTab);
    tabs.add(CurrentLocale.get("com.tle.admin.workflow.editor.stepeditor.notifications"), notificationsTab);

    setLayout(new GridLayout(1, 1));
    add(tabs);
}