当前位置: 首页>>代码示例>>Java>>正文


Java JSplitPane.getUI方法代码示例

本文整理汇总了Java中javax.swing.JSplitPane.getUI方法的典型用法代码示例。如果您正苦于以下问题:Java JSplitPane.getUI方法的具体用法?Java JSplitPane.getUI怎么用?Java JSplitPane.getUI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JSplitPane的用法示例。


在下文中一共展示了JSplitPane.getUI方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: splitpane

import javax.swing.JSplitPane; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:32,代码来源:OurUtil.java

示例2: removeBordersFromSplitPane

import javax.swing.JSplitPane; //导入方法依赖的package包/类
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$
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:22,代码来源:AppletGuiUtils.java

示例3: tweakSplitPaneUI

import javax.swing.JSplitPane; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:ClassesControllerUI.java

示例4: tweakSplitPaneUI

import javax.swing.JSplitPane; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:OQLControllerUI.java

示例5: createInstanceImpl

import javax.swing.JSplitPane; //导入方法依赖的package包/类
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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:PaneBuilders.java

示例6: splitpane

import javax.swing.JSplitPane; //导入方法依赖的package包/类
/** 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;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:19,代码来源:OurUtil.java


注:本文中的javax.swing.JSplitPane.getUI方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。