本文整理汇总了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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}