Java Code Examples for javax.swing.plaf.basic.BasicSplitPaneDivider#setBorder()

The following examples show how to use javax.swing.plaf.basic.BasicSplitPaneDivider#setBorder() . 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: PluggableTreeTableView.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
protected JComponent createComponent() {
    final JComponent comp = super.createComponent();
    
    if (toolbar == null) init();
    
    JExtendedSplitPane contentSplit = new JExtendedSplitPane(JExtendedSplitPane.VERTICAL_SPLIT, true, comp, pluginsComponent) {
        public boolean requestFocusInWindow() {
            return comp.requestFocusInWindow();
        }
    };
    BasicSplitPaneDivider contentDivider = ((BasicSplitPaneUI)contentSplit.getUI()).getDivider();
    contentDivider.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, SEPARATOR_COLOR));
    contentDivider.setDividerSize(5);
    contentSplit.setBorder(BorderFactory.createEmptyBorder());
    contentSplit.setResizeWeight(0.7d);
    
    return contentSplit;
}
 
Example 2
Source File: ClassesControllerUI.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void tweakSplitPaneUI(JSplitPane splitPane) {
    splitPane.setOpaque(false);
    splitPane.setBorder(null);
    splitPane.setDividerSize(3);

    if (!(splitPane.getUI() instanceof BasicSplitPaneUI)) {
        return;
    }

    BasicSplitPaneDivider divider = ((BasicSplitPaneUI) splitPane.getUI()).getDivider();

    if (divider != null) {
        divider.setBorder(null);
    }
}
 
Example 3
Source File: InstancesControllerUI.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void tweakSplitPaneUI(JSplitPane splitPane) {
    splitPane.setOpaque(false);
    splitPane.setBorder(null);
    splitPane.setDividerSize(3);

    if (!(splitPane.getUI() instanceof BasicSplitPaneUI)) {
        return;
    }

    BasicSplitPaneDivider divider = ((BasicSplitPaneUI) splitPane.getUI()).getDivider();

    if (divider != null) {
        divider.setBorder(null);
    }
}
 
Example 4
Source File: SummaryControllerUI.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void tweakSplitPaneUI(JSplitPane splitPane) {
    splitPane.setOpaque(false);
    splitPane.setBorder(null);
    splitPane.setDividerSize(3);

    if (!(splitPane.getUI() instanceof BasicSplitPaneUI)) {
        return;
    }

    BasicSplitPaneDivider divider = ((BasicSplitPaneUI) splitPane.getUI()).getDivider();

    if (divider != null) {
        divider.setBorder(null);
    }
}
 
Example 5
Source File: OQLControllerUI.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private static void tweakSplitPaneUI(JSplitPane splitPane) {
    splitPane.setOpaque(false);
    splitPane.setBorder(null);
    splitPane.setDividerSize(3);

    if (!(splitPane.getUI() instanceof BasicSplitPaneUI)) {
        return;
    }

    BasicSplitPaneDivider divider = ((BasicSplitPaneUI) splitPane.getUI()).getDivider();

    if (divider != null) {
        divider.setBorder(null);
    }
}
 
Example 6
Source File: PaneBuilders.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected void setupInstance(BasicSplitPaneDivider instance) {
            super.setupInstance(instance);
            
//            instance.setDividerSize(dividerSize);
            if (border != null) {
                Border b = border.createInstance();
                if (b != null) instance.setBorder(b);
            }
        }
 
Example 7
Source File: CombinedPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void tweakUI() {
    setBorder(null);
    setDividerSize(5);

    if (!(getUI() instanceof BasicSplitPaneUI)) return;

    BasicSplitPaneDivider divider = ((BasicSplitPaneUI)getUI()).getDivider();
    if (divider != null) {
        Color c = UIUtils.isNimbus() ? UIUtils.getDisabledLineColor() :
                new JSeparator().getForeground();
        divider.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, c));
    }
}
 
Example 8
Source File: ClassesControllerUI.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
private void tweakSplitPaneUI(JSplitPane splitPane) {
    splitPane.setOpaque(false);
    splitPane.setBorder(null);
    splitPane.setDividerSize(3);

    if (!(splitPane.getUI() instanceof BasicSplitPaneUI)) {
        return;
    }

    BasicSplitPaneDivider divider = ((BasicSplitPaneUI) splitPane.getUI()).getDivider();

    if (divider != null) {
        divider.setBorder(null);
    }
}
 
Example 9
Source File: InstancesControllerUI.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
private void tweakSplitPaneUI(JSplitPane splitPane) {
    splitPane.setOpaque(false);
    splitPane.setBorder(null);
    splitPane.setDividerSize(3);

    if (!(splitPane.getUI() instanceof BasicSplitPaneUI)) {
        return;
    }

    BasicSplitPaneDivider divider = ((BasicSplitPaneUI) splitPane.getUI()).getDivider();

    if (divider != null) {
        divider.setBorder(null);
    }
}
 
Example 10
Source File: SummaryControllerUI.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
private void tweakSplitPaneUI(JSplitPane splitPane) {
    splitPane.setOpaque(false);
    splitPane.setBorder(null);
    splitPane.setDividerSize(3);

    if (!(splitPane.getUI() instanceof BasicSplitPaneUI)) {
        return;
    }

    BasicSplitPaneDivider divider = ((BasicSplitPaneUI) splitPane.getUI()).getDivider();

    if (divider != null) {
        divider.setBorder(null);
    }
}
 
Example 11
Source File: OQLControllerUI.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
private static void tweakSplitPaneUI(JSplitPane splitPane) {
    splitPane.setOpaque(false);
    splitPane.setBorder(null);
    splitPane.setDividerSize(3);

    if (!(splitPane.getUI() instanceof BasicSplitPaneUI)) {
        return;
    }

    BasicSplitPaneDivider divider = ((BasicSplitPaneUI) splitPane.getUI()).getDivider();

    if (divider != null) {
        divider.setBorder(null);
    }
}
 
Example 12
Source File: PaneBuilders.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
protected void setupInstance(BasicSplitPaneDivider instance) {
            super.setupInstance(instance);
            
//            instance.setDividerSize(dividerSize);
            if (border != null) {
                Border b = border.createInstance();
                if (b != null) instance.setBorder(b);
            }
        }
 
Example 13
Source File: CombinedPanel.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
private void tweakUI() {
    setBorder(null);
    setDividerSize(5);

    if (!(getUI() instanceof BasicSplitPaneUI)) return;

    BasicSplitPaneDivider divider = ((BasicSplitPaneUI)getUI()).getDivider();
    if (divider != null) {
        Color c = UIUtils.isNimbus() ? UIUtils.getDisabledLineColor() :
                new JSeparator().getForeground();
        divider.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, c));
    }
}
 
Example 14
Source File: Editor.java    From i18n-editor with MIT License 4 votes vote down vote up
private void setupUI() {
	Color borderColor = Colors.scale(UIManager.getColor("Panel.background"), .8f);
	
	setTitle(TITLE);
	setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
	addWindowListener(new EditorWindowListener());
	
	setIconImages(Lists.newArrayList("512","256","128","64","48","32","24","20","16").stream()
			.map(size -> Images.loadFromClasspath("images/icon-" + size + ".png").getImage())
			.collect(Collectors.toList()));
	
       translationTree = new TranslationTree();
       translationTree.setBorder(BorderFactory.createEmptyBorder(0,5,0,5));
       translationTree.addTreeSelectionListener(new TranslationTreeNodeSelectionListener());
       translationTree.addMouseListener(new TranslationTreeMouseListener());
       
	translationField = new TranslationKeyField();
	translationField.addKeyListener(new TranslationFieldKeyListener());
	translationField.setBorder(BorderFactory.createCompoundBorder(
			BorderFactory.createMatteBorder(1,0,0,1,borderColor),
			((CompoundBorder)translationField.getBorder()).getInsideBorder()));
	
	JScrollPane translationsScrollPane = new JScrollPane(translationTree);
	translationsScrollPane.getViewport().setOpaque(false);
	translationsScrollPane.setOpaque(false);
	translationsScrollPane.setBorder(BorderFactory.createMatteBorder(0,0,0,1,borderColor));
	
	translationsPanel = new JPanel(new BorderLayout());
	translationsPanel.add(translationsScrollPane);
	translationsPanel.add(translationField, BorderLayout.SOUTH);
	
       resourcesPanel = new JScrollablePanel(true, false);
       resourcesPanel.setLayout(new BoxLayout(resourcesPanel, BoxLayout.Y_AXIS));
       resourcesPanel.setBorder(BorderFactory.createEmptyBorder(10,20,10,20));
       resourcesPanel.setOpaque(false);
       resourcesPanel.addMouseListener(new ResourcesPaneMouseListener());
       
       resourcesScrollPane = new JScrollPane(resourcesPanel);
       resourcesScrollPane.getViewport().setOpaque(false);
       resourcesScrollPane.setOpaque(false);
       resourcesScrollPane.setBorder(null);
       resourcesScrollPane.addMouseListener(new ResourcesPaneMouseListener());
	
	contentPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, translationsPanel, resourcesScrollPane);
	contentPane.setBorder(null);
	contentPane.setDividerSize(10);
	
	// Style the split pane divider if possible
	SplitPaneUI splitPaneUI = contentPane.getUI();
    if (splitPaneUI instanceof BasicSplitPaneUI) {
        BasicSplitPaneDivider divider = ((BasicSplitPaneUI)splitPaneUI).getDivider();
        divider.setBorder(null);
		resourcesPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,20));
    }
    
	introText = new JLabel("<html><body style=\"text-align:center; padding:30px;\">" + 
			MessageBundle.get("core.intro.text") + "</body></html>");
	introText.setOpaque(true);
	introText.setFont(introText.getFont().deriveFont(28f));
	introText.setHorizontalTextPosition(JLabel.CENTER);
	introText.setVerticalTextPosition(JLabel.BOTTOM);
	introText.setHorizontalAlignment(JLabel.CENTER);
	introText.setVerticalAlignment(JLabel.CENTER);
	introText.setForeground(getBackground().darker());
	introText.setIcon(Images.loadFromClasspath("images/icon-intro.png"));
	
	Container container = getContentPane();
	container.add(introText);
	
	editorMenu = new EditorMenuBar(this, translationTree);
	setJMenuBar(editorMenu);
}