当前位置: 首页>>代码示例>>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;未经允许,请勿转载。