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

The following are top voted examples for showing how to use javax.swing.plaf.basic.BasicSplitPaneUI. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: incubator-netbeans   File: DiffSplitPaneDivider.java   View source code 6 votes vote down vote up
DiffSplitPaneDivider(BasicSplitPaneUI splitPaneUI, EditableDiffView master) {
    super(splitPaneUI);
    this.master = master;
    fontColor = new JLabel().getForeground();

    actionIconsHeight = insertAllImage.getHeight(this);
    actionIconsWidth = insertAllImage.getWidth(this);
    
    setBorder(null);
    setLayout(new BorderLayout());
    mydivider = new DiffSplitDivider();
    add(mydivider);
    
    addMouseListener(this);
    addMouseMotionListener(this);
}
 
Example 2
Project: org.alloytools.alloy   File: OurUtil.java   View source code 6 votes vote down vote up
/**
 * Constructs a new SplitPane containing the two components given as
 * arguments
 * 
 * @param orientation - the orientation (HORIZONTAL_SPLIT or VERTICAL_SPLIT)
 * @param first - the left component (if horizontal) or top component (if
 *            vertical)
 * @param second - the right component (if horizontal) or bottom component
 *            (if vertical)
 * @param initialDividerLocation - the initial divider location (in pixels)
 */
public static JSplitPane splitpane(int orientation, Component first, Component second, int initialDividerLocation) {
	JSplitPane x = make(new JSplitPane(orientation, first, second), new EmptyBorder(0, 0, 0, 0));
	x.setContinuousLayout(true);
	x.setDividerLocation(initialDividerLocation);
	x.setOneTouchExpandable(false);
	x.setResizeWeight(0.5);
	if (Util.onMac() && (x.getUI() instanceof BasicSplitPaneUI)) {
		boolean h = (orientation != JSplitPane.HORIZONTAL_SPLIT);
		((BasicSplitPaneUI) (x.getUI())).getDivider().setBorder(new OurBorder(h, h, h, h)); // Makes
																							// the
																							// border
																							// look
																							// nicer
																							// on
																							// Mac
																							// OS
																							// X
	}
	return x;
}
 
Example 3
Project: Equella   File: AppletGuiUtils.java   View source code 6 votes vote down vote up
public static void removeBordersFromSplitPane(JSplitPane split)
{
	// remove the border from the split pane
	split.setBorder(null);

	// check the UI. If we can't work with the UI any further, then
	// exit here.
	if( !(split.getUI() instanceof BasicSplitPaneUI) )
	{
		return;
	}

	// grab the divider from the UI and remove the border from it
	final BasicSplitPaneDivider divider = ((BasicSplitPaneUI) split.getUI()).getDivider();
	if( divider != null )
	{
		// Taken from http://forums.sun.com/thread.jspa?threadID=566152
		divider.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0),
			new SplitPaneBorder(UIManager.getColor("SplitPane.background")))); //$NON-NLS-1$
	}
}
 
Example 4
Project: JHelioviewer-SWHV   File: JHVSplitPane.java   View source code 6 votes vote down vote up
@Override
@SuppressWarnings("deprecation")
public void layout() {
    super.layout();

    // increase divider width or height
    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 5
Project: tellervo   File: SeriesDataMatrix.java   View source code 6 votes vote down vote up
/**
 * Open or close the remarks panel according to its current state
 */
public void toggleRemarks()
{
	log.debug("toggling Remarks panel");
	
	int currLoc = splitPaneTableAndRemarks.getDividerLocation();
	int totalWidth = splitPaneTableAndRemarks.getWidth();
	
	log.debug("Currloc     = "+currLoc);
	log.debug("Total width = " + totalWidth);
	
	
	if(currLoc+20 >= totalWidth)
	{
		log.debug("Panel appears to be shut so open");
		BasicSplitPaneUI ui = (BasicSplitPaneUI)splitPaneTableAndRemarks.getUI();
		JButton oneClick = (JButton)ui.getDivider().getComponent(0);
		oneClick.doClick();
	}
	else
	{
		log.debug("Panel appears to be open so shut");
		hideRemarksPanel();
	}
}
 
Example 6
Project: umlet   File: BaseGUIBuilder.java   View source code 6 votes vote down vote up
protected JSplitPane initBase(Component mainComponent, final int mainDividerLoc) {
	propertyTextPane = createPropertyTextPane(); // must be initialized before palettePanel because it could be accessed during palette initialization (eg in case of different default fontsize)
	palettePanel = newPalettePanel();
	rightSplit = newGenericSplitPane(JSplitPane.VERTICAL_SPLIT, palettePanel, propertyTextPane.getPanel(), 2, Config.getInstance().getRight_split_position(), true);
	rightPanel = newRightPanel();

	mainSplit = newGenericSplitPane(JSplitPane.HORIZONTAL_SPLIT, mainComponent, rightPanel, 2, mainDividerLoc, true);
	// hide mainSplit on doubleclick
	((BasicSplitPaneUI) mainSplit.getUI()).getDivider().addMouseListener(new MouseAdapter() {
		@Override
		public void mouseClicked(MouseEvent e) {
			if (e.getClickCount() == 2) {
				rightPanel.setVisible(!rightPanel.isVisible());
				mainSplit.setDividerLocation(mainDividerLoc);
			}
		}
	});
	customHandler = new CustomElementHandler();
	customHandler.getPanel().setVisible(false);
	customSplit = newGenericSplitPane(JSplitPane.VERTICAL_SPLIT, mainSplit, getCustomPanel(), 0, 0, true);
	mailPanel = new MailPanel();
	mailPanel.setVisible(false);
	mailSplit = newGenericSplitPane(JSplitPane.VERTICAL_SPLIT, mailPanel, customSplit, 0, 0, true);
	return mailSplit;
}
 
Example 7
Project: concurrent   File: ChildComponentDelegate.java   View source code 6 votes vote down vote up
public JSplitPane createSplitPane() {
	JSplitPane split = new JSplitPane();
	// remove the border from the split pane
	split.setBorder(null);

	// set the divider size for a more reasonable, less bulky look 
	split.setDividerSize(3);
	split.setOpaque(false);

	// check the UI.  If we can't work with the UI any further, then
	// exit here.
	if (!(split.getUI() instanceof BasicSplitPaneUI))
		return split;

	//  grab the divider from the UI and remove the border from it
	BasicSplitPaneDivider divider = 
			((BasicSplitPaneUI) split.getUI()).getDivider();
	if (divider != null)
		divider.setBorder(null);

	return split;
}
 
Example 8
Project: concurrent   File: ElegantDemo.java   View source code 6 votes vote down vote up
private static JSplitPane createSplitPane(int orientation) {
	JSplitPane split = new JSplitPane(orientation);
	// remove the border from the split pane
	split.setBorder(null);
        
	// set the divider size for a more reasonable, less bulky look 
	split.setDividerSize(3);

	// check the UI.  If we can't work with the UI any further, then
	// exit here.
	if (!(split.getUI() instanceof BasicSplitPaneUI))
	   return split;

	//  grab the divider from the UI and remove the border from it
	BasicSplitPaneDivider divider =
				   ((BasicSplitPaneUI) split.getUI()).getDivider();
	if (divider != null)
	   divider.setBorder(null);

	return split;
}
 
Example 9
Project: concurrent   File: SplitPaneDemo.java   View source code 6 votes vote down vote up
public JSplitPane createSplitPane() {
	JSplitPane split = new JSplitPane();
	// remove the border from the split pane
	split.setBorder(null);

	// set the divider size for a more reasonable, less bulky look 
	split.setDividerSize(3);

	// check the UI.  If we can't work with the UI any further, then
	// exit here.
	if (!(split.getUI() instanceof BasicSplitPaneUI))
		return split;

	//  grab the divider from the UI and remove the border from it
	BasicSplitPaneDivider divider = ((BasicSplitPaneUI) split.getUI()).getDivider();
	if (divider != null)
		divider.setBorder(null);

	return split;
}
 
Example 10
Project: concurrent   File: StandardBorderManager.java   View source code 6 votes vote down vote up
/**
 * Removes any border from the <code>DockingPort</code> itself and places the currently 
 * assigned border on the two child components of the <code>DockingPort's</code JSplitPane</code>
 * child.
 * @see basesource.convertor.ui.docking.defaults.BorderManager#managePortSplitChild(basesource.convertor.ui.docking.DockingPort)
 */
public void managePortSplitChild(DockingPort port) {
	if(port==null || !(port.getDockedComponent() instanceof JSplitPane))
		return;
		
	setBorder(port, null);
	
	// clear the border from the split pane		
	JSplitPane split = (JSplitPane) port.getDockedComponent();
	if (split.getUI() instanceof BasicSplitPaneUI) {
		//  grab the divider from the UI and remove the border from it
		BasicSplitPaneDivider divider = ((BasicSplitPaneUI) split.getUI()).getDivider();
		if (divider != null && divider.getBorder()!=null)
			divider.setBorder(null);			
	}
	setBorder(split, null);

	// set the borders on each of the child components
	setBorder(split.getLeftComponent(), assignedBorder);
	setBorder(split.getRightComponent(), assignedBorder);
}
 
Example 11
Project: polydes   File: MiniSplitPane.java   View source code 6 votes vote down vote up
@Override
public void doLayout()
{
	super.doLayout();

	// increase divider width or height
	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 12
Project: polydes   File: MiniSplitPane.java   View source code 6 votes vote down vote up
@Override
public void doLayout()
{
	super.doLayout();

	// increase divider width or height
	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 13
Project: flexdock   File: StandardBorderManager.java   View source code 6 votes vote down vote up
/**
 * Removes any border from the {@code DockingPort} itself and places the
 * currently assigned border on the two child components of the
 * {@code DockingPort's</code JSplitPane} child.
 *
 * @see BorderManager#managePortSplitChild(DockingPort)
 */
public void managePortSplitChild(DockingPort port) {
    if (port == null || !(port.getDockedComponent() instanceof JSplitPane))
        return;

    setBorder(port, null);

    // clear the border from the split pane
    JSplitPane split = (JSplitPane) port.getDockedComponent();
    if (split.getUI() instanceof BasicSplitPaneUI) {
        // grab the divider from the UI and remove the border from it
        BasicSplitPaneDivider divider = ((BasicSplitPaneUI) split.getUI())
                                        .getDivider();
        if (divider != null && divider.getBorder() != null)
            divider.setBorder(null);
    }
    setBorder(split, null);

    // set the borders on each of the child components
    setSubComponentBorder(split.getLeftComponent(), assignedBorder);
    setSubComponentBorder(split.getRightComponent(), assignedBorder);
}
 
Example 14
Project: Amber-IDE   File: ThinSplitPane.java   View source code 6 votes vote down vote up
@Override
public void doLayout() {
    super.doLayout();

    // increase divider width or height
    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 15
Project: incubator-netbeans   File: ClassesControllerUI.java   View source code 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 16
Project: incubator-netbeans   File: InstancesControllerUI.java   View source code 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
Project: incubator-netbeans   File: SummaryControllerUI.java   View source code 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
Project: incubator-netbeans   File: OQLControllerUI.java   View source code 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 19
Project: incubator-netbeans   File: PaneBuilders.java   View source code 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 20
Project: incubator-netbeans   File: CombinedPanel.java   View source code 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
Project: incubator-netbeans   File: JExtendedSplitPane.java   View source code 5 votes vote down vote up
private Component getDivider() {
    if (getUI() == null) {
        return null;
    }

    return ((BasicSplitPaneUI) getUI()).getDivider();
}
 
Example 22
Project: incubator-netbeans   File: JCompoundSplitPane.java   View source code 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 23
Project: OpenJSharp   File: MotifSplitPaneDivider.java   View source code 5 votes vote down vote up
/**
 * Creates a new Motif SplitPaneDivider
 */
public MotifSplitPaneDivider(BasicSplitPaneUI ui) {
    super(ui);
    highlightColor = UIManager.getColor("SplitPane.highlight");
    shadowColor = UIManager.getColor("SplitPane.shadow");
    focusedColor = UIManager.getColor("SplitPane.activeThumb");
    setDividerSize(hThumbWidth + pad);
}
 
Example 24
Project: OpenJSharp   File: MotifSplitPaneDivider.java   View source code 5 votes vote down vote up
/**
 * Sets the SplitPaneUI that is using the receiver. This is completely
 * overriden from super to create a different MouseHandler.
 */
public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) {
    if (splitPane != null) {
        splitPane.removePropertyChangeListener(this);
       if (mouseHandler != null) {
           splitPane.removeMouseListener(mouseHandler);
           splitPane.removeMouseMotionListener(mouseHandler);
           removeMouseListener(mouseHandler);
           removeMouseMotionListener(mouseHandler);
           mouseHandler = null;
       }
    }
    splitPaneUI = newUI;
    if (newUI != null) {
        splitPane = newUI.getSplitPane();
        if (splitPane != null) {
            if (mouseHandler == null) mouseHandler=new MotifMouseHandler();
            splitPane.addMouseListener(mouseHandler);
            splitPane.addMouseMotionListener(mouseHandler);
            addMouseListener(mouseHandler);
            addMouseMotionListener(mouseHandler);
            splitPane.addPropertyChangeListener(this);
            if (splitPane.isOneTouchExpandable()) {
                oneTouchExpandableChanged();
            }
        }
    }
    else {
        splitPane = null;
    }
}
 
Example 25
Project: JuggleMasterPro   File: ControlJSplitPane.java   View source code 5 votes vote down vote up
/**
 * Constructs
 * 
 * @param objPleftComponent
 * @param objPrightComponent
 */
public ControlJSplitPane(Component objPleftComponent, Component objPrightComponent) {

	super(JSplitPane.HORIZONTAL_SPLIT, true, objPleftComponent, objPrightComponent);
	this.setOpaque(true);
	this.setDividerSize(5);
	this.setOneTouchExpandable(false);

	// this.setDividerLocation(0.5F);
	// this.setResizeWeight(0.5F);

	((BasicSplitPaneUI) this.getUI()).getDivider().addComponentListener(this);
}
 
Example 26
Project: Tarski   File: OurUtil.java   View source code 5 votes vote down vote up
/** Constructs a new SplitPane containing the two components given as arguments
 * @param orientation - the orientation (HORIZONTAL_SPLIT or VERTICAL_SPLIT)
 * @param first - the left component (if horizontal) or top component (if vertical)
 * @param second - the right component (if horizontal) or bottom component (if vertical)
 * @param initialDividerLocation - the initial divider location (in pixels)
 */
public static JSplitPane splitpane (int orientation, Component first, Component second, int initialDividerLocation) {
   JSplitPane x = make(new JSplitPane(orientation, first, second), new EmptyBorder(0,0,0,0));
   x.setContinuousLayout(true);
   x.setDividerLocation(initialDividerLocation);
   x.setOneTouchExpandable(false);
   x.setResizeWeight(0.5);
   if (Util.onMac() && (x.getUI() instanceof BasicSplitPaneUI)) {
      boolean h = (orientation != JSplitPane.HORIZONTAL_SPLIT);
      ((BasicSplitPaneUI)(x.getUI())).getDivider().setBorder(new OurBorder(h,h,h,h));  // Makes the border look nicer on Mac OS X
   }
   return x;
}
 
Example 27
Project: Tarski   File: OurUtil.java   View source code 5 votes vote down vote up
/** Constructs a new SplitPane containing the two components given as arguments
 * @param orientation - the orientation (HORIZONTAL_SPLIT or VERTICAL_SPLIT)
 * @param first - the left component (if horizontal) or top component (if vertical)
 * @param second - the right component (if horizontal) or bottom component (if vertical)
 * @param initialDividerLocation - the initial divider location (in pixels)
 */
public static JSplitPane splitpane (int orientation, Component first, Component second, int initialDividerLocation) {
   JSplitPane x = make(new JSplitPane(orientation, first, second), new EmptyBorder(0,0,0,0));
   x.setContinuousLayout(true);
   x.setDividerLocation(initialDividerLocation);
   x.setOneTouchExpandable(false);
   x.setResizeWeight(0.5);
   if (Util.onMac() && (x.getUI() instanceof BasicSplitPaneUI)) {
      boolean h = (orientation != JSplitPane.HORIZONTAL_SPLIT);
      ((BasicSplitPaneUI)(x.getUI())).getDivider().setBorder(new OurBorder(h,h,h,h));  // Makes the border look nicer on Mac OS X
   }
   return x;
}
 
Example 28
Project: jdk8u-jdk   File: MotifSplitPaneDivider.java   View source code 5 votes vote down vote up
/**
 * Creates a new Motif SplitPaneDivider
 */
public MotifSplitPaneDivider(BasicSplitPaneUI ui) {
    super(ui);
    highlightColor = UIManager.getColor("SplitPane.highlight");
    shadowColor = UIManager.getColor("SplitPane.shadow");
    focusedColor = UIManager.getColor("SplitPane.activeThumb");
    setDividerSize(hThumbWidth + pad);
}
 
Example 29
Project: jdk8u-jdk   File: MotifSplitPaneDivider.java   View source code 5 votes vote down vote up
/**
 * Sets the SplitPaneUI that is using the receiver. This is completely
 * overriden from super to create a different MouseHandler.
 */
public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) {
    if (splitPane != null) {
        splitPane.removePropertyChangeListener(this);
       if (mouseHandler != null) {
           splitPane.removeMouseListener(mouseHandler);
           splitPane.removeMouseMotionListener(mouseHandler);
           removeMouseListener(mouseHandler);
           removeMouseMotionListener(mouseHandler);
           mouseHandler = null;
       }
    }
    splitPaneUI = newUI;
    if (newUI != null) {
        splitPane = newUI.getSplitPane();
        if (splitPane != null) {
            if (mouseHandler == null) mouseHandler=new MotifMouseHandler();
            splitPane.addMouseListener(mouseHandler);
            splitPane.addMouseMotionListener(mouseHandler);
            addMouseListener(mouseHandler);
            addMouseMotionListener(mouseHandler);
            splitPane.addPropertyChangeListener(this);
            if (splitPane.isOneTouchExpandable()) {
                oneTouchExpandableChanged();
            }
        }
    }
    else {
        splitPane = null;
    }
}
 
Example 30
Project: openjdk-jdk10   File: MotifSplitPaneDivider.java   View source code 5 votes vote down vote up
/**
 * Creates a new Motif SplitPaneDivider
 */
public MotifSplitPaneDivider(BasicSplitPaneUI ui) {
    super(ui);
    highlightColor = UIManager.getColor("SplitPane.highlight");
    shadowColor = UIManager.getColor("SplitPane.shadow");
    focusedColor = UIManager.getColor("SplitPane.activeThumb");
    setDividerSize(hThumbWidth + pad);
}
 
Example 31
Project: openjdk-jdk10   File: MotifSplitPaneDivider.java   View source code 5 votes vote down vote up
/**
 * Sets the SplitPaneUI that is using the receiver. This is completely
 * overriden from super to create a different MouseHandler.
 */
public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) {
    if (splitPane != null) {
        splitPane.removePropertyChangeListener(this);
       if (mouseHandler != null) {
           splitPane.removeMouseListener(mouseHandler);
           splitPane.removeMouseMotionListener(mouseHandler);
           removeMouseListener(mouseHandler);
           removeMouseMotionListener(mouseHandler);
           mouseHandler = null;
       }
    }
    splitPaneUI = newUI;
    if (newUI != null) {
        splitPane = newUI.getSplitPane();
        if (splitPane != null) {
            if (mouseHandler == null) mouseHandler=new MotifMouseHandler();
            splitPane.addMouseListener(mouseHandler);
            splitPane.addMouseMotionListener(mouseHandler);
            addMouseListener(mouseHandler);
            addMouseMotionListener(mouseHandler);
            splitPane.addPropertyChangeListener(this);
            if (splitPane.isOneTouchExpandable()) {
                oneTouchExpandableChanged();
            }
        }
    }
    else {
        splitPane = null;
    }
}
 
Example 32
Project: openjdk9   File: MotifSplitPaneDivider.java   View source code 5 votes vote down vote up
/**
 * Creates a new Motif SplitPaneDivider
 */
public MotifSplitPaneDivider(BasicSplitPaneUI ui) {
    super(ui);
    highlightColor = UIManager.getColor("SplitPane.highlight");
    shadowColor = UIManager.getColor("SplitPane.shadow");
    focusedColor = UIManager.getColor("SplitPane.activeThumb");
    setDividerSize(hThumbWidth + pad);
}
 
Example 33
Project: openjdk9   File: MotifSplitPaneDivider.java   View source code 5 votes vote down vote up
/**
 * Sets the SplitPaneUI that is using the receiver. This is completely
 * overriden from super to create a different MouseHandler.
 */
public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) {
    if (splitPane != null) {
        splitPane.removePropertyChangeListener(this);
       if (mouseHandler != null) {
           splitPane.removeMouseListener(mouseHandler);
           splitPane.removeMouseMotionListener(mouseHandler);
           removeMouseListener(mouseHandler);
           removeMouseMotionListener(mouseHandler);
           mouseHandler = null;
       }
    }
    splitPaneUI = newUI;
    if (newUI != null) {
        splitPane = newUI.getSplitPane();
        if (splitPane != null) {
            if (mouseHandler == null) mouseHandler=new MotifMouseHandler();
            splitPane.addMouseListener(mouseHandler);
            splitPane.addMouseMotionListener(mouseHandler);
            addMouseListener(mouseHandler);
            addMouseMotionListener(mouseHandler);
            splitPane.addPropertyChangeListener(this);
            if (splitPane.isOneTouchExpandable()) {
                oneTouchExpandableChanged();
            }
        }
    }
    else {
        splitPane = null;
    }
}
 
Example 34
Project: jdk8u_jdk   File: MotifSplitPaneDivider.java   View source code 5 votes vote down vote up
/**
 * Creates a new Motif SplitPaneDivider
 */
public MotifSplitPaneDivider(BasicSplitPaneUI ui) {
    super(ui);
    highlightColor = UIManager.getColor("SplitPane.highlight");
    shadowColor = UIManager.getColor("SplitPane.shadow");
    focusedColor = UIManager.getColor("SplitPane.activeThumb");
    setDividerSize(hThumbWidth + pad);
}
 
Example 35
Project: jdk8u_jdk   File: MotifSplitPaneDivider.java   View source code 5 votes vote down vote up
/**
 * Sets the SplitPaneUI that is using the receiver. This is completely
 * overriden from super to create a different MouseHandler.
 */
public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) {
    if (splitPane != null) {
        splitPane.removePropertyChangeListener(this);
       if (mouseHandler != null) {
           splitPane.removeMouseListener(mouseHandler);
           splitPane.removeMouseMotionListener(mouseHandler);
           removeMouseListener(mouseHandler);
           removeMouseMotionListener(mouseHandler);
           mouseHandler = null;
       }
    }
    splitPaneUI = newUI;
    if (newUI != null) {
        splitPane = newUI.getSplitPane();
        if (splitPane != null) {
            if (mouseHandler == null) mouseHandler=new MotifMouseHandler();
            splitPane.addMouseListener(mouseHandler);
            splitPane.addMouseMotionListener(mouseHandler);
            addMouseListener(mouseHandler);
            addMouseMotionListener(mouseHandler);
            splitPane.addPropertyChangeListener(this);
            if (splitPane.isOneTouchExpandable()) {
                oneTouchExpandableChanged();
            }
        }
    }
    else {
        splitPane = null;
    }
}
 
Example 36
Project: lookaside_java-1.8.0-openjdk   File: MotifSplitPaneDivider.java   View source code 5 votes vote down vote up
/**
 * Creates a new Motif SplitPaneDivider
 */
public MotifSplitPaneDivider(BasicSplitPaneUI ui) {
    super(ui);
    highlightColor = UIManager.getColor("SplitPane.highlight");
    shadowColor = UIManager.getColor("SplitPane.shadow");
    focusedColor = UIManager.getColor("SplitPane.activeThumb");
    setDividerSize(hThumbWidth + pad);
}
 
Example 37
Project: lookaside_java-1.8.0-openjdk   File: MotifSplitPaneDivider.java   View source code 5 votes vote down vote up
/**
 * Sets the SplitPaneUI that is using the receiver. This is completely
 * overriden from super to create a different MouseHandler.
 */
public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) {
    if (splitPane != null) {
        splitPane.removePropertyChangeListener(this);
       if (mouseHandler != null) {
           splitPane.removeMouseListener(mouseHandler);
           splitPane.removeMouseMotionListener(mouseHandler);
           removeMouseListener(mouseHandler);
           removeMouseMotionListener(mouseHandler);
           mouseHandler = null;
       }
    }
    splitPaneUI = newUI;
    if (newUI != null) {
        splitPane = newUI.getSplitPane();
        if (splitPane != null) {
            if (mouseHandler == null) mouseHandler=new MotifMouseHandler();
            splitPane.addMouseListener(mouseHandler);
            splitPane.addMouseMotionListener(mouseHandler);
            addMouseListener(mouseHandler);
            addMouseMotionListener(mouseHandler);
            splitPane.addPropertyChangeListener(this);
            if (splitPane.isOneTouchExpandable()) {
                oneTouchExpandableChanged();
            }
        }
    }
    else {
        splitPane = null;
    }
}
 
Example 38
Project: cuba   File: DesktopSplitPanel.java   View source code 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 39
Project: beautyeye   File: BESplitPaneDivider.java   View source code 5 votes vote down vote up
/**
 * Creates a new Windows SplitPaneDivider.
 *
 * @param ui the ui
 */
public BESplitPaneDivider(BasicSplitPaneUI ui) 
{
	super(ui);

	//copy from BasicSplitPaneDivider
	oneTouchSize = DefaultLookup.getInt(ui.getSplitPane(), ui,
			"SplitPane.oneTouchButtonSize", ONE_TOUCH_SIZE);
}
 
Example 40
Project: beautyeye   File: SplitPaneDividerBorder.java   View source code 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;
}