Java Code Examples for javax.swing.JSplitPane#setUI()

The following examples show how to use javax.swing.JSplitPane#setUI() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Test6657026.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    SunToolkit.createNewAppContext();
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    JSplitPane pane = new JSplitPane();
    pane.setUI(this);

    createFocusListener().focusGained(null); // allows actions
    test(pane, "positiveIncrement", 3);
    test(pane, "negativeIncrement", 0);
}
 
Example 2
Source File: Test6657026.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    SunToolkit.createNewAppContext();
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    JSplitPane pane = new JSplitPane();
    pane.setUI(this);

    createFocusListener().focusGained(null); // allows actions
    test(pane, "positiveIncrement", 3);
    test(pane, "negativeIncrement", 0);
}
 
Example 3
Source File: Test6657026.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    SunToolkit.createNewAppContext();
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    JSplitPane pane = new JSplitPane();
    pane.setUI(this);

    createFocusListener().focusGained(null); // allows actions
    test(pane, "positiveIncrement", 3);
    test(pane, "negativeIncrement", 0);
}
 
Example 4
Source File: SplitLayout.java    From spotbugs with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void removeSplitPaneBorders(JSplitPane pane) {
    pane.setUI(new BasicSplitPaneUI() {
        @Override
        public BasicSplitPaneDivider createDefaultDivider() {
            return new BasicSplitPaneDivider(this) {
                @Override
                public void setBorder(Border b) {
                }
            };
        }
    });
    pane.setBorder(new EmptyBorder(3, 3, 3, 3));
}
 
Example 5
Source File: MainFrameComponentFactory.java    From spotbugs with GNU Lesser General Public License v2.1 5 votes vote down vote up
JSplitPane summaryTab() {
    mainFrame.setSummaryTopPanel(new JPanel());
    mainFrame.getSummaryTopPanel().setLayout(new GridLayout(0, 1));
    mainFrame.getSummaryTopPanel().setBorder(BorderFactory.createEmptyBorder(2, 4, 2, 4));
    //        mainFrame.getSummaryTopPanel().setMinimumSize(new Dimension(fontSize * 50, fontSize * 5));

    JPanel summaryTopOuter = new JPanel(new BorderLayout());
    summaryTopOuter.add(mainFrame.getSummaryTopPanel(), BorderLayout.NORTH);

    mainFrame.getSummaryHtmlArea().setContentType("text/html");
    mainFrame.getSummaryHtmlArea().setEditable(false);
    mainFrame.getSummaryHtmlArea().addHyperlinkListener(evt -> AboutDialog.editorPaneHyperlinkUpdate(evt));
    setStyleSheets();
    // JPanel temp = new JPanel(new BorderLayout());
    // temp.add(summaryTopPanel, BorderLayout.CENTER);
    JScrollPane summaryScrollPane = new JScrollPane(summaryTopOuter);
    summaryScrollPane.getVerticalScrollBar().setUnitIncrement((int) Driver.getFontSize());

    JSplitPane splitP = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, false, summaryScrollPane,
            mainFrame.getSummaryHtmlScrollPane());
    splitP.setContinuousLayout(true);
    splitP.setDividerLocation(GUISaveState.getInstance().getSplitSummary());
    splitP.setOneTouchExpandable(true);
    splitP.setUI(new BasicSplitPaneUI() {
        @Override
        public BasicSplitPaneDivider createDefaultDivider() {
            return new BasicSplitPaneDivider(this) {
                @Override
                public void setBorder(Border b) {
                }
            };
        }
    });
    splitP.setBorder(null);
    return splitP;
}
 
Example 6
Source File: Test6657026.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    SunToolkit.createNewAppContext();
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    JSplitPane pane = new JSplitPane();
    pane.setUI(this);

    createFocusListener().focusGained(null); // allows actions
    test(pane, "positiveIncrement", 3);
    test(pane, "negativeIncrement", 0);
}
 
Example 7
Source File: Test6657026.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    SunToolkit.createNewAppContext();
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    JSplitPane pane = new JSplitPane();
    pane.setUI(this);

    createFocusListener().focusGained(null); // allows actions
    test(pane, "positiveIncrement", 3);
    test(pane, "negativeIncrement", 0);
}
 
Example 8
Source File: Test6657026.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    SunToolkit.createNewAppContext();
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    JSplitPane pane = new JSplitPane();
    pane.setUI(this);

    createFocusListener().focusGained(null); // allows actions
    test(pane, "positiveIncrement", 3);
    test(pane, "negativeIncrement", 0);
}
 
Example 9
Source File: Test6657026.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    SunToolkit.createNewAppContext();
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    JSplitPane pane = new JSplitPane();
    pane.setUI(this);

    createFocusListener().focusGained(null); // allows actions
    test(pane, "positiveIncrement", 3);
    test(pane, "negativeIncrement", 0);
}
 
Example 10
Source File: Test6657026.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    SunToolkit.createNewAppContext();
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    JSplitPane pane = new JSplitPane();
    pane.setUI(this);

    createFocusListener().focusGained(null); // allows actions
    test(pane, "positiveIncrement", 3);
    test(pane, "negativeIncrement", 0);
}
 
Example 11
Source File: Test6657026.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    SunToolkit.createNewAppContext();
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    JSplitPane pane = new JSplitPane();
    pane.setUI(this);

    createFocusListener().focusGained(null); // allows actions
    test(pane, "positiveIncrement", 3);
    test(pane, "negativeIncrement", 0);
}
 
Example 12
Source File: Test6657026.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    SunToolkit.createNewAppContext();
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    JSplitPane pane = new JSplitPane();
    pane.setUI(this);

    createFocusListener().focusGained(null); // allows actions
    test(pane, "positiveIncrement", 3);
    test(pane, "negativeIncrement", 0);
}
 
Example 13
Source File: PSheet.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private JSplitPane createSplitPane(Component lower) {
    JSplitPane pane = new JSplitPane();

    if (firstSplit == null) {
        firstSplit = Boolean.TRUE;
    } else {
        firstSplit = Boolean.FALSE;
    }

    pane.setRightComponent(lower);
    pane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    pane.setContinuousLayout(true);
    pane.setResizeWeight(1);
    pane.setDividerLocation(0.80f);
    pane.setBorder(BorderFactory.createEmptyBorder());
    //Do not install our custom split pane UI on Nimbus L&F
    if (!"Nimbus".equals(UIManager.getLookAndFeel().getID())) {
        pane.setUI(PropUtils.createSplitPaneUI());
    }

    // #52188: default F6 behaviour doesn't make to much sense in NB 
    // property sheet and blocks NetBeans default F6
    pane.getActionMap().getParent().remove("toggleFocus");
    if( PropUtils.isAqua ) {
        pane.setBackground( UIManager.getColor("NbExplorerView.background") ); //NOI18N
    }

    return pane;
}
 
Example 14
Source File: Test6657026.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    SunToolkit.createNewAppContext();
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    JSplitPane pane = new JSplitPane();
    pane.setUI(this);

    createFocusListener().focusGained(null); // allows actions
    test(pane, "positiveIncrement", 3);
    test(pane, "negativeIncrement", 0);
}
 
Example 15
Source File: Test6657026.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    SunToolkit.createNewAppContext();
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    JSplitPane pane = new JSplitPane();
    pane.setUI(this);

    createFocusListener().focusGained(null); // allows actions
    test(pane, "positiveIncrement", 3);
    test(pane, "negativeIncrement", 0);
}
 
Example 16
Source File: Test6657026.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    SunToolkit.createNewAppContext();
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    JSplitPane pane = new JSplitPane();
    pane.setUI(this);

    createFocusListener().focusGained(null); // allows actions
    test(pane, "positiveIncrement", 3);
    test(pane, "negativeIncrement", 0);
}
 
Example 17
Source File: EndmemberForm.java    From snap-desktop with GNU General Public License v3.0 4 votes vote down vote up
private void initComponents() {

        endmemberList = new JList<>();
        endmemberList.setModel(formModel.getEndmemberListModel());
        endmemberList.setSelectionModel(formModel.getEndmemberListSelectionModel());
        endmemberList.setPreferredSize(new Dimension(80, 160));

        diagramCanvas = new DiagramCanvas();
        diagramCanvas.setDiagram(formModel.getEndmemberDiagram());
        formModel.getPropertyChangeSupport().addPropertyChangeListener("selectedEndmemberIndex",
                                                                       evt -> diagramCanvas.repaint());

        AbstractButton addButton = ToolButtonFactory.createButton(formModel.getAddAction(), false);
        AbstractButton removeButton = ToolButtonFactory.createButton(formModel.getRemoveAction(), false);
        AbstractButton clearButton = ToolButtonFactory.createButton(formModel.getClearAction(), false);
        AbstractButton exportButton = ToolButtonFactory.createButton(formModel.getExportAction(), false);

        GridBagLayout gbl = new GridBagLayout();
        JPanel actionPanel = new JPanel(gbl);
        actionPanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 0, 3));
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.anchor = GridBagConstraints.WEST;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.ipady = 2;
        gbc.gridy = 0;
        actionPanel.add(addButton, gbc);
        gbc.gridy++;
        actionPanel.add(removeButton, gbc);
        gbc.gridy++;
        actionPanel.add(clearButton, gbc);
        gbc.gridy++;
        actionPanel.add(exportButton, gbc);
        gbc.gridy++;
        gbc.weighty = 1;
        actionPanel.add(new JLabel(), gbc);
        final Color color = actionPanel.getBackground();
        final float[] rgbColors = new float[3];
        color.getRGBColorComponents(rgbColors);
        final float factor = 0.9f;
        actionPanel.setBackground(new Color(rgbColors[0] * factor, rgbColors[1] * factor, rgbColors[2] * factor));

        JPanel endmemberSelectionPanel = new JPanel(new BorderLayout());
        endmemberSelectionPanel.add(new JScrollPane(endmemberList), BorderLayout.CENTER);
        endmemberSelectionPanel.add(actionPanel, BorderLayout.WEST);

        JPanel endmemberPreviewPanel = new JPanel(new BorderLayout());
        endmemberPreviewPanel.add(diagramCanvas, BorderLayout.CENTER);

        JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
        splitPane.setLeftComponent(endmemberSelectionPanel);
        splitPane.setRightComponent(endmemberPreviewPanel);
        splitPane.setBorder(BorderFactory.createEmptyBorder());
        splitPane.setUI(createPlainDividerSplitPaneUI());

        setLayout(new BorderLayout());
        add(splitPane, BorderLayout.CENTER);
    }