当前位置: 首页>>代码示例>>Java>>正文


Java JSplitPane.getLeftComponent方法代码示例

本文整理汇总了Java中javax.swing.JSplitPane.getLeftComponent方法的典型用法代码示例。如果您正苦于以下问题:Java JSplitPane.getLeftComponent方法的具体用法?Java JSplitPane.getLeftComponent怎么用?Java JSplitPane.getLeftComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JSplitPane的用法示例。


在下文中一共展示了JSplitPane.getLeftComponent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateSplitLocation

import javax.swing.JSplitPane; //导入方法依赖的package包/类
/**
 * TODO: to remove? doesn't seems to be used anywhere.
 */
protected void updateSplitLocation(JSplitPane split, int foo) {
  Component left = split.getLeftComponent();
  Component right = split.getRightComponent();
  if(left == null) {
    split.setDividerLocation(0);
    return;
  }
  if(right == null) {
    split.setDividerLocation(1);
    return;
  }
  Dimension leftPS = left.getPreferredSize();
  Dimension rightPS = right.getPreferredSize();
  double location =
      split.getOrientation() == JSplitPane.HORIZONTAL_SPLIT
          ? (double)leftPS.width / (leftPS.width + rightPS.width)
          : (double)leftPS.height / (leftPS.height + rightPS.height);
  split.setDividerLocation(location);
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:23,代码来源:DocumentEditor.java

示例2: removeComponentFromContainer

import javax.swing.JSplitPane; //导入方法依赖的package包/类
/** Removes a real component from a real container.
    * @param container instance of a real container
    * @param containerDelegate effective container delegate of the container
    * @param component component to be removed
    * @return whether it was possible to remove the component (some containers
    *         may not support removing individual components reasonably)
    */
   @Override
   public boolean removeComponentFromContainer(Container container,
                                               Container containerDelegate,
                                               Component component)
   {
if( !(containerDelegate instanceof JSplitPane) ) {
    return false; // should not happen
}	

JSplitPane splitPane = (JSplitPane) containerDelegate;

if( component == splitPane.getLeftComponent() ) { 
    if( super.removeComponentFromContainer(container, containerDelegate, component) ) {
	JButton left = (JButton) splitPane.getClientProperty(LEFT_TOP_BUTTON);
	if( left != null ) {
	    // fall back to the default swing setting
	    splitPane.setLeftComponent(left);
	    splitPane.putClientProperty(LEFT_TOP_BUTTON, null);
	}	
	return true;
    }
} else if ( component == splitPane.getRightComponent() ) {    
    if( super.removeComponentFromContainer(container, containerDelegate, component) ) {
	JButton right = (JButton) splitPane.getClientProperty(RIGHT_BOTTOM_BUTTON);
	if( right != null ) {
	    // fall back to the default swing setting		    
	    splitPane.setRightComponent(right);		    
	    splitPane.putClientProperty(RIGHT_BOTTOM_BUTTON, null);
	}	
	return true;
    }
}

       return super.removeComponentFromContainer(container, containerDelegate, component);
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:43,代码来源:JSplitPaneSupport.java

示例3: requestFocusInWindow

import javax.swing.JSplitPane; //导入方法依赖的package包/类
public @Override boolean requestFocusInWindow() {
    JSplitPane view = getCurrentResultView();
    if (view == null) {
        return super.requestFocusInWindow();
    }
    Component left = view.getLeftComponent();
    if (left == null) {
        return super.requestFocusInWindow();
    }
    return left.requestFocusInWindow();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:ResultWindow.java

示例4: actionPerformed

import javax.swing.JSplitPane; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
    JSplitPane view = getCurrentResultView();
    if (view == null || !(view.getLeftComponent() instanceof StatisticsPanel)) {
        return;
    }
    StatisticsPanel statisticsPanel = (StatisticsPanel) view.getLeftComponent();
    if (next) {
        statisticsPanel.selectNextFailure();
    } else {
        statisticsPanel.selectPreviousFailure();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:ResultWindow.java

示例5: getStatisticsPanel

import javax.swing.JSplitPane; //导入方法依赖的package包/类
private static StatisticsPanel getStatisticsPanel() {
JSplitPane view = getCurrentResultView();
if (view == null || !(view.getLeftComponent() instanceof StatisticsPanel)) {
    return null;
}
return (StatisticsPanel) view.getLeftComponent();
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:ResultWindow.java

示例6: getFirstComponent

import javax.swing.JSplitPane; //导入方法依赖的package包/类
private Component getFirstComponent(JSplitPane splitPane) {
    if (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
        return splitPane.getLeftComponent();
    } else {
        return splitPane.getTopComponent();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:JCompoundSplitPane.java

示例7: copyFilterMask

import javax.swing.JSplitPane; //导入方法依赖的package包/类
private void copyFilterMask(JSplitPane oldView, JSplitPane newView) {
    StatisticsPanel oldSP = (StatisticsPanel)oldView.getLeftComponent();
    StatisticsPanel newSP = (StatisticsPanel)newView.getLeftComponent();
    newSP.copyFilterMask(oldSP);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:ResultWindow.java


注:本文中的javax.swing.JSplitPane.getLeftComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。