javax.swing.plaf.basic.BasicSplitPaneDivider Java Examples

The following examples show how to use javax.swing.plaf.basic.BasicSplitPaneDivider. 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: JSplitPaneOperator.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 #2
Source File: RSplitPaneTest.java    From marathonv5 with 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 #3
Source File: JCompoundSplitPane.java    From netbeans with 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 #4
Source File: SeaGlassSplitPaneUI.java    From seaglass with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the default divider.
 */
public BasicSplitPaneDivider createDefaultDivider() {
    SeaGlassSplitPaneDivider divider = new SeaGlassSplitPaneDivider(this);

    divider.setDividerSize(splitPane.getDividerSize());
    return divider;
}
 
Example #5
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 #6
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 #7
Source File: DesktopSplitPanel.java    From cuba with 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 #8
Source File: UnicornJSplitPane.java    From Data_Processor with 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 #9
Source File: SplitPaneDividerBorder.java    From beautyeye with 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;
}
 
Example #10
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 #11
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 #12
Source File: ThreadsInspector.java    From visualvm with 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 #13
Source File: PaneBuilders.java    From netbeans with 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 #14
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 #15
Source File: PaneBuilders.java    From netbeans with 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 #16
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 #17
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 #18
Source File: DataViewComponent.java    From visualvm with 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 #19
Source File: JCompoundSplitPane.java    From visualvm with 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 #20
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 #21
Source File: PaneBuilders.java    From visualvm with 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 #22
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 #23
Source File: PaneBuilders.java    From visualvm with 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 #24
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 #25
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 #26
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 #27
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 #28
Source File: Splitter.java    From visualvm with 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 #29
Source File: SideWindowCarrierPanel.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public BasicSplitPaneDivider createDefaultDivider() {
  return new BasicSplitPaneDivider( this ) {
    public void setBorder( final Border b ) {
      // ahh, lovely mac-osx would slap its borders everywhere. 
    }
  };
}
 
Example #30
Source File: Splitter.java    From visualvm with 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);
        }
    };
}