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


Java JSplitPane.getDividerLocation方法代码示例

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


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

示例1: mouseButton1Pressed

import javax.swing.JSplitPane; //导入方法依赖的package包/类
@Override protected void mouseButton1Pressed(MouseEvent me) {
    JSplitPane c = (JSplitPane) (component instanceof JSplitPane ? component
            : SwingUtilities.getAncestorOfClass(JSplitPane.class, component));
    if (c == null) {
        return;
    }
    dividerLocation = c.getDividerLocation();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:9,代码来源:RSplitPane.java

示例2: mouseReleased

import javax.swing.JSplitPane; //导入方法依赖的package包/类
@Override protected void mouseReleased(MouseEvent me) {
    JSplitPane c = (JSplitPane) (component instanceof JSplitPane ? component
            : SwingUtilities.getAncestorOfClass(JSplitPane.class, component));
    if (c == null || dividerLocation == c.getDividerLocation()) {
        return;
    }
    RComponent rComponent = new RComponentFactory(omapConfig).findRComponent(c, null, recorder);
    recorder.recordSelect(rComponent, "" + c.getDividerLocation());
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:10,代码来源:RSplitPane.java

示例3: buildInfoPanel

import javax.swing.JSplitPane; //导入方法依赖的package包/类
/** Adjust the info panel by retrieving upper and lower info subpanels from the selected tab. */
protected void buildInfoPanel() {
    JComponent upperInfoPanel = null;
    JComponent lowerInfoPanel = null;
    ResourceTab tab = getSelectedTab();
    if (tab != null) {
        upperInfoPanel = tab.getUpperInfoPanel();
        lowerInfoPanel = tab.getLowerInfoPanel();
    }
    JPanel infoPanel = (JPanel) getInfoPanel();
    String key;
    if (lowerInfoPanel == null || !lowerInfoPanel.isEnabled()) {
        // if we switch from split to single, freeze the divider location
        if (upperInfoPanel != null && upperInfoPanel.getParent() == getSplitInfoPanel()) {
            this.frozenDividerPos = getSplitInfoPanel().getDividerLocation();
        }
        getSingleInfoPanel().removeAll();
        if (upperInfoPanel != null) {
            getSingleInfoPanel().add(upperInfoPanel, BorderLayout.CENTER);
            getSingleInfoPanel().validate();
            getSingleInfoPanel().repaint();
        }
        key = this.SINGLE_INFO_KEY;
    } else {
        JSplitPane splitInfoPanel = getSplitInfoPanel();
        int dividerPos = this.frozenDividerPos;
        this.frozenDividerPos = 0;
        if (dividerPos == 0) {
            dividerPos = splitInfoPanel.getDividerLocation();
        }
        splitInfoPanel.setTopComponent(upperInfoPanel);
        splitInfoPanel.setBottomComponent(lowerInfoPanel);
        splitInfoPanel.setDividerLocation(dividerPos);
        key = this.SPLIT_INFO_KEY;
    }
    ((CardLayout) infoPanel.getLayout()).show(infoPanel, key);
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:38,代码来源:ResourceDisplay.java

示例4: test

import javax.swing.JSplitPane; //导入方法依赖的package包/类
private static void test(JSplitPane pane, String action, int expected) {
    ActionEvent event = new ActionEvent(pane, expected, action);
    pane.getActionMap().get(action).actionPerformed(event);
    int actual = pane.getDividerLocation();
    if (actual != expected) {
        throw new Error(actual + ", but expected " + expected);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:Test6657026.java


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