本文整理匯總了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);
}