當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。