當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。