當前位置: 首頁>>代碼示例>>Java>>正文


Java JTree.getRowHeight方法代碼示例

本文整理匯總了Java中javax.swing.JTree.getRowHeight方法的典型用法代碼示例。如果您正苦於以下問題:Java JTree.getRowHeight方法的具體用法?Java JTree.getRowHeight怎麽用?Java JTree.getRowHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JTree的用法示例。


在下文中一共展示了JTree.getRowHeight方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateStyle

import javax.swing.JTree; //導入方法依賴的package包/類
private void updateStyle(JTree tree) {
    SynthContext context = getContext(tree, ENABLED);
    SynthStyle oldStyle = style;

    style = SynthLookAndFeel.updateStyle(context, this);
    if (style != oldStyle) {
        Object value;

        setExpandedIcon(style.getIcon(context, "Tree.expandedIcon"));
        setCollapsedIcon(style.getIcon(context, "Tree.collapsedIcon"));

        setLeftChildIndent(style.getInt(context, "Tree.leftChildIndent",
                                        0));
        setRightChildIndent(style.getInt(context, "Tree.rightChildIndent",
                                         0));

        drawHorizontalLines = style.getBoolean(
                      context, "Tree.drawHorizontalLines",true);
        drawVerticalLines = style.getBoolean(
                    context, "Tree.drawVerticalLines", true);
        linesStyle = style.get(context, "Tree.linesStyle");

            value = style.get(context, "Tree.rowHeight");
            if (value != null) {
                LookAndFeel.installProperty(tree, "rowHeight", value);
            }

            value = style.get(context, "Tree.scrollsOnExpand");
            LookAndFeel.installProperty(tree, "scrollsOnExpand",
                                                value != null? value : Boolean.TRUE);

        padding = style.getInt(context, "Tree.padding", 0);

        largeModel = (tree.isLargeModel() && tree.getRowHeight() > 0);

        useTreeColors = style.getBoolean(context,
                              "Tree.rendererUseTreeColors", true);

        Boolean showsRootHandles = style.getBoolean(
                context, "Tree.showsRootHandles", Boolean.TRUE);
        LookAndFeel.installProperty(
                tree, JTree.SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles);

        if (oldStyle != null) {
            uninstallKeyboardActions();
            installKeyboardActions();
        }
    }
    context.dispose();

    context = getContext(tree, Region.TREE_CELL, ENABLED);
    cellStyle = SynthLookAndFeel.updateStyle(context, this);
    context.dispose();
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:55,代碼來源:SynthTreeUI.java

示例2: updateStyle

import javax.swing.JTree; //導入方法依賴的package包/類
private void updateStyle(JTree tree) {
    SynthContext context = getContext(tree, ENABLED);
    SynthStyle oldStyle = style;

    style = SynthLookAndFeel.updateStyle(context, this);
    if (style != oldStyle) {
        Object value;

        setExpandedIcon(style.getIcon(context, "Tree.expandedIcon"));
        setCollapsedIcon(style.getIcon(context, "Tree.collapsedIcon"));

        setLeftChildIndent(style.getInt(context, "Tree.leftChildIndent",
                                        0));
        setRightChildIndent(style.getInt(context, "Tree.rightChildIndent",
                                         0));

        drawHorizontalLines = style.getBoolean(
                      context, "Tree.drawHorizontalLines",true);
        drawVerticalLines = style.getBoolean(
                    context, "Tree.drawVerticalLines", true);
        linesStyle = style.get(context, "Tree.linesStyle");

            value = style.get(context, "Tree.rowHeight");
            if (value != null) {
                LookAndFeel.installProperty(tree, "rowHeight", value);
            }

            value = style.get(context, "Tree.scrollsOnExpand");
            LookAndFeel.installProperty(tree, "scrollsOnExpand",
                                                value != null? value : Boolean.TRUE);

        padding = style.getInt(context, "Tree.padding", 0);

        largeModel = (tree.isLargeModel() && tree.getRowHeight() > 0);

        useTreeColors = style.getBoolean(context,
                              "Tree.rendererUseTreeColors", true);

        Boolean showsRootHandles = style.getBoolean(
                context, "Tree.showsRootHandles", Boolean.TRUE);
        LookAndFeel.installProperty(
                tree, JTree.SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles);

        if (oldStyle != null) {
            uninstallKeyboardActions();
            installKeyboardActions();
        }
    }

    context = getContext(tree, Region.TREE_CELL, ENABLED);
    cellStyle = SynthLookAndFeel.updateStyle(context, this);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:53,代碼來源:SynthTreeUI.java


注:本文中的javax.swing.JTree.getRowHeight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。