Java Code Examples for javax.swing.plaf.basic.BasicSplitPaneDivider

The following examples show how to use javax.swing.plaf.basic.BasicSplitPaneDivider. These examples are extracted from open source projects. 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 Project: marathonv5   Source File: RSplitPaneTest.java    License: Apache License 2.0 6 votes vote down vote up
public void selectSplitPaneDividerLocation() throws InterruptedException {
    final LoggingRecorder lr = new LoggingRecorder();
    siw(new Runnable() {
        @Override
        public void run() {
            JSplitPane splitPane = (JSplitPane) ComponentUtils.findComponent(JSplitPane.class, frame);
            splitPane.setDividerLocation(300);
            BasicSplitPaneDivider divider = (BasicSplitPaneDivider) ComponentUtils.findComponent(BasicSplitPaneDivider.class,
                    splitPane);
            RSplitPane rDivider = new RSplitPane(divider, null, null, lr);
            rDivider.mouseReleased(null);
        }
    });
    Call call = lr.getCall();
    AssertJUnit.assertEquals("select", call.getFunction());
    AssertJUnit.assertEquals("300", call.getState());
}
 
Example 2
/**
 * Searches divider inside split pane.
 *
 * @return an operator for the divider.
 */
public BasicSplitPaneDivider findDivider() {
    return ((BasicSplitPaneDivider) waitSubComponent(new ComponentChooser() {
        @Override
        public boolean checkComponent(Component comp) {
            return comp instanceof BasicSplitPaneDivider;
        }

        @Override
        public String getDescription() {
            return "";
        }

        @Override
        public String toString() {
            return "JSplitPaneOperator.findDivider.ComponentChooser{description = " + getDescription() + '}';
        }
    }));
}
 
Example 3
Source Project: Data_Processor   Source File: UnicornJSplitPane.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
@Override
public void layout() {
	super.layout();
	BasicSplitPaneDivider divider = ((BasicSplitPaneUI)getUI()).getDivider();
	Rectangle bounds = divider.getBounds();
	if( orientation == HORIZONTAL_SPLIT ) {
		bounds.x -= dividerDragOffset;
		bounds.width = dividerDragSize;
	} else {
		bounds.y -= dividerDragOffset;
		bounds.height = dividerDragSize;
	}
	divider.setBounds(bounds);
}
 
Example 4
Source Project: netbeans   Source File: ClassesControllerUI.java    License: 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 Project: netbeans   Source File: InstancesControllerUI.java    License: 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 6
Source Project: netbeans   Source File: SummaryControllerUI.java    License: 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 7
Source Project: netbeans   Source File: OQLControllerUI.java    License: 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 8
Source Project: netbeans   Source File: PaneBuilders.java    License: Apache License 2.0 5 votes vote down vote up
static ComponentBuilder getBuilder(Instance instance, Heap heap) {
    if (DetailsUtils.isSubclassOf(instance, JViewport.class.getName())) {
        return new JViewportBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JScrollPane.class.getName())) {
        return new JScrollPaneBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JSplitPane.class.getName())) {
        return new JSplitPaneBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, BasicSplitPaneDivider.class.getName())) {
        return new BasicSplitPaneDividerBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JTabbedPane.class.getName())) {
        return new JTabbedPaneBuilder(instance, heap);
    }
    return null;
}
 
Example 9
Source Project: netbeans   Source File: PaneBuilders.java    License: 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 10
Source Project: netbeans   Source File: PaneBuilders.java    License: Apache License 2.0 5 votes vote down vote up
protected BasicSplitPaneDivider createInstanceImpl() {
    final JSplitPane split = new JSplitPane(orientation);
    BasicSplitPaneUI ui = split.getUI() instanceof BasicSplitPaneUI ?
            (BasicSplitPaneUI)split.getUI() : new BasicSplitPaneUI() {
                { installUI(split); }
            };
    return new BasicSplitPaneDivider(ui);
}
 
Example 11
Source Project: netbeans   Source File: CombinedPanel.java    License: 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 12
Source Project: netbeans   Source File: JCompoundSplitPane.java    License: Apache License 2.0 5 votes vote down vote up
private void tweakUI() {
    if (!(getUI() instanceof BasicSplitPaneUI)) {
        return;
    }

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

    if (divider != null) {
        divider.addMouseListener(new DividerMouseListener());
    }
}
 
Example 13
public BasicSplitPaneDivider createDefaultDivider() {
  return new BasicSplitPaneDivider( this ) {
    public void setBorder( final Border b ) {
      // ahh, lovely mac-osx would slap its borders everywhere. 
    }
  };
}
 
Example 14
Source Project: visualvm   Source File: Splitter.java    License: GNU General Public License v2.0 5 votes vote down vote up
public BasicSplitPaneDivider createDefaultDivider() {
    return new BasicSplitPaneDivider(this) {
        public void paint(Graphics g) {
            Dimension size = getSize();
            g.setColor(getBackground());
            g.fillRect(0, 0, size.width, size.height);
        }
    };
}
 
Example 15
Source Project: visualvm   Source File: Splitter.java    License: GNU General Public License v2.0 5 votes vote down vote up
public BasicSplitPaneDivider createDefaultDivider() {
    return new BasicSplitPaneDivider(this) {
        public void paint(Graphics g) {
            Dimension size = getSize();
            g.setColor(getBackground());
            g.fillRect(0, 0, size.width, size.height);
        }
    };
}
 
Example 16
Source Project: visualvm   Source File: ClassesControllerUI.java    License: 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 17
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 18
Source Project: visualvm   Source File: SummaryControllerUI.java    License: 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 19
Source Project: visualvm   Source File: OQLControllerUI.java    License: 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 20
Source Project: visualvm   Source File: PaneBuilders.java    License: GNU General Public License v2.0 5 votes vote down vote up
static ComponentBuilder getBuilder(Instance instance, Heap heap) {
    if (DetailsUtils.isSubclassOf(instance, JViewport.class.getName())) {
        return new JViewportBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JScrollPane.class.getName())) {
        return new JScrollPaneBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JSplitPane.class.getName())) {
        return new JSplitPaneBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, BasicSplitPaneDivider.class.getName())) {
        return new BasicSplitPaneDividerBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JTabbedPane.class.getName())) {
        return new JTabbedPaneBuilder(instance, heap);
    }
    return null;
}
 
Example 21
Source Project: visualvm   Source File: PaneBuilders.java    License: 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 22
Source Project: visualvm   Source File: PaneBuilders.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected BasicSplitPaneDivider createInstanceImpl() {
    final JSplitPane split = new JSplitPane(orientation);
    BasicSplitPaneUI ui = split.getUI() instanceof BasicSplitPaneUI ?
            (BasicSplitPaneUI)split.getUI() : new BasicSplitPaneUI() {
                { installUI(split); }
            };
    return new BasicSplitPaneDivider(ui);
}
 
Example 23
Source Project: visualvm   Source File: CombinedPanel.java    License: 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 24
Source Project: visualvm   Source File: JCompoundSplitPane.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void tweakUI() {
    if (!(getUI() instanceof BasicSplitPaneUI)) {
        return;
    }

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

    if (divider != null) {
        divider.addMouseListener(new DividerMouseListener());
    }
}
 
Example 25
Source Project: visualvm   Source File: DataViewComponent.java    License: GNU General Public License v2.0 5 votes vote down vote up
public BasicSplitPaneDivider createDefaultDivider() {
    return new BasicSplitPaneDivider(this) {
        public void paint(Graphics g) {
            Dimension size = getSize();
            g.setColor(getBackground());
            g.fillRect(0, 0, size.width, size.height);
        }
    };
}
 
Example 26
Source Project: visualvm   Source File: ThreadsInspector.java    License: GNU General Public License v2.0 5 votes vote down vote up
public BasicSplitPaneDivider createDefaultDivider() {
    return new BasicSplitPaneDivider(this) {
        public void paint(Graphics g) {
            Dimension size = getSize();
            g.setColor(getBackground());
            g.fillRect(0, 0, size.width, size.height);
        }
    };
}
 
Example 27
Source Project: cuba   Source File: DesktopSplitPanel.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setLocked(boolean locked) {
    this.locked = locked;

    BasicSplitPaneDivider divider = ((BasicSplitPaneUI) impl.getUI()).getDivider();
    if (locked) {
        divider.setDividerSize(0);
    } else {
        divider.setDividerSize(10);
    }

    impl.revalidate();
    impl.repaint();
}
 
Example 28
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 29
Source Project: spotbugs   Source File: SplitLayout.java    License: 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 30
Source Project: beautyeye   Source File: SplitPaneDividerBorder.java    License: Apache License 2.0 5 votes vote down vote up
public Insets getBorderInsets(Component c)
{
	Insets insets = new Insets(0, 0, 0, 0);
	if (c instanceof BasicSplitPaneDivider)
	{
		BasicSplitPaneUI bspui = ((BasicSplitPaneDivider) c)
				.getBasicSplitPaneUI();

		if (bspui != null)
		{
			JSplitPane splitPane = bspui.getSplitPane();

			if (splitPane != null)
			{
				if (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT)
				{
					insets.top = insets.bottom = 0;
					insets.left = insets.right = 1;
					return insets;
				}
				// VERTICAL_SPLIT
				insets.top = insets.bottom = 1;
				insets.left = insets.right = 0;
				return insets;
			}
		}
	}
	insets.top = insets.bottom = insets.left = insets.right = 1;
	return insets;
}