當前位置: 首頁>>代碼示例>>Java>>正文


Java BasicSplitPaneUI.getSplitPane方法代碼示例

本文整理匯總了Java中javax.swing.plaf.basic.BasicSplitPaneUI.getSplitPane方法的典型用法代碼示例。如果您正苦於以下問題:Java BasicSplitPaneUI.getSplitPane方法的具體用法?Java BasicSplitPaneUI.getSplitPane怎麽用?Java BasicSplitPaneUI.getSplitPane使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.plaf.basic.BasicSplitPaneUI的用法示例。


在下文中一共展示了BasicSplitPaneUI.getSplitPane方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setBasicSplitPaneUI

import javax.swing.plaf.basic.BasicSplitPaneUI; //導入方法依賴的package包/類
/**
 * 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;
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:35,代碼來源:MotifSplitPaneDivider.java

示例2: getBorderInsets

import javax.swing.plaf.basic.BasicSplitPaneUI; //導入方法依賴的package包/類
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;
}
 
開發者ID:JackJiang2011,項目名稱:beautyeye,代碼行數:31,代碼來源:SplitPaneDividerBorder.java

示例3: getBorderInsets

import javax.swing.plaf.basic.BasicSplitPaneUI; //導入方法依賴的package包/類
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)
				{
					// horizontal
					insets.top = insets.bottom = 0;
					insets.left = insets.right = 1;
					return insets;
				}
				else
				{
					// vertical
					insets.top = insets.bottom = 1;
					insets.left = insets.right = 0;
					return insets;
				}
			}
		}
	}
	insets.top = insets.bottom = insets.left = insets.right = 1;
	return insets;
}
 
開發者ID:andy-goryachev,項目名稱:PasswordSafe,代碼行數:32,代碼來源:CSplitPaneDividerBorder.java

示例4: getBorderInsets

import javax.swing.plaf.basic.BasicSplitPaneUI; //導入方法依賴的package包/類
@Override
public Insets getBorderInsets(final Component c)
{
	final Insets insets = new Insets(0, 0, 0, 0);
	if (c instanceof BasicSplitPaneDivider)
	{
		final BasicSplitPaneUI bspui = ((BasicSplitPaneDivider)c).getBasicSplitPaneUI();
		if (bspui != null)
		{
			final 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;
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:29,代碼來源:AdempiereSplitPaneUI.java

示例5: setBasicSplitPaneUI

import javax.swing.plaf.basic.BasicSplitPaneUI; //導入方法依賴的package包/類
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 MouseHandlerHack();
			}
			
			splitPane.addMouseListener(mouseHandler);
			splitPane.addMouseMotionListener(mouseHandler);
			addMouseListener(mouseHandler);
			addMouseMotionListener(mouseHandler);
			splitPane.addPropertyChangeListener(this);
			if(splitPane.isOneTouchExpandable())
			{
				oneTouchExpandableChanged();
			}
		}
	}
	else
	{
		splitPane = null;
	}
}
 
開發者ID:andy-goryachev,項目名稱:PasswordSafe,代碼行數:44,代碼來源:CSplitPaneDivider.java

示例6: setBasicSplitPaneUI

import javax.swing.plaf.basic.BasicSplitPaneUI; //導入方法依賴的package包/類
@Override
public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) {
	if (this.splitPane != null) {
		// fix for defect 358 - multiple listeners were installed
		// on the same split pane
		this.uninstall();
	}

	if (newUI != null) {
		// installing
		this.splitPane = newUI.getSplitPane();

		this.gripModel = new DefaultButtonModel();
		this.gripModel.setArmed(false);
		this.gripModel.setSelected(false);
		this.gripModel.setPressed(false);
		this.gripModel.setRollover(false);
		this.gripModel.setEnabled(this.splitPane.isEnabled());

		this.stateTransitionTracker = new StateTransitionTracker(
				this.splitPane, this.gripModel);

		// fix for defect 109 - memory leak on changing skin
		this.substanceRolloverListener = new RolloverControlListener(this,
				this.gripModel);
		this.addMouseListener(this.substanceRolloverListener);
		this.addMouseMotionListener(this.substanceRolloverListener);

		this.substancePropertyChangeListener = new PropertyChangeListener() {
			public void propertyChange(PropertyChangeEvent evt) {
				if ("enabled".equals(evt.getPropertyName())) {
					boolean isEnabled = splitPane.isEnabled();
					gripModel.setEnabled(isEnabled);
					if (leftButton != null)
						leftButton.setEnabled(isEnabled);
					if (rightButton != null)
						rightButton.setEnabled(isEnabled);
					setEnabled(isEnabled);
				}
			}
		};
		// System.out.println("Registering " + this.hashCode() + ":"
		// + this.substancePropertyChangeListener.hashCode() + " on "
		// + this.splitPane.hashCode());
		this.splitPane
				.addPropertyChangeListener(this.substancePropertyChangeListener);

		this.stateTransitionTracker.registerModelListeners();
	} else {
		uninstall();
	}
	super.setBasicSplitPaneUI(newUI);
}
 
開發者ID:Depter,項目名稱:JRLib,代碼行數:54,代碼來源:SubstanceSplitPaneDivider.java


注:本文中的javax.swing.plaf.basic.BasicSplitPaneUI.getSplitPane方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。