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


Java DefaultLookup.getIcon方法代码示例

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


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

示例1: getTableCellRendererComponent

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
public Component getTableCellRendererComponent(JTable table, Object value,
        boolean isSelected, boolean hasFocus, int row, int column) {
    Icon sortIcon = null;

    boolean isPaintingForPrint = false;

    if (table != null) {
        JTableHeader header = table.getTableHeader();
        if (header != null) {
            Color fgColor = null;
            Color bgColor = null;
            if (hasFocus) {
                fgColor = DefaultLookup.getColor(this, ui, "TableHeader.focusCellForeground");
                bgColor = DefaultLookup.getColor(this, ui, "TableHeader.focusCellBackground");
            }
            if (fgColor == null) {
                fgColor = header.getForeground();
            }
            if (bgColor == null) {
                bgColor = header.getBackground();
            }
            setForeground(fgColor);
            setBackground(bgColor);

            setFont(header.getFont());

            isPaintingForPrint = header.isPaintingForPrint();
        }

        if (!isPaintingForPrint && table.getRowSorter() != null) {
            if (!horizontalTextPositionSet) {
                // There is a row sorter, and the developer hasn't
                // set a text position, change to leading.
                setHorizontalTextPosition(JLabel.LEADING);
            }
            SortOrder sortOrder = getColumnSortOrder(table, column);
            if (sortOrder != null) {
                switch(sortOrder) {
                case ASCENDING:
                    sortIcon = DefaultLookup.getIcon(
                        this, ui, "Table.ascendingSortIcon");
                    break;
                case DESCENDING:
                    sortIcon = DefaultLookup.getIcon(
                        this, ui, "Table.descendingSortIcon");
                    break;
                case UNSORTED:
                    sortIcon = DefaultLookup.getIcon(
                        this, ui, "Table.naturalSortIcon");
                    break;
                }
            }
        }
    }

    setText(value == null ? "" : value.toString());
    setIcon(sortIcon);
    sortArrow = sortIcon;

    Border border = null;
    if (hasFocus) {
        border = DefaultLookup.getBorder(this, ui, "TableHeader.focusCellBorder");
    }
    if (border == null) {
        border = DefaultLookup.getBorder(this, ui, "TableHeader.cellBorder");
    }
    setBorder(border);

    return this;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:71,代码来源:DefaultTableCellHeaderRenderer.java

示例2: getDefaultOpenIcon

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
  * Returns the default icon, for the current laf, that is used to
  * represent non-leaf nodes that are expanded.
  */
public Icon getDefaultOpenIcon() {
    return DefaultLookup.getIcon(this, ui, "Tree.openIcon");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:DefaultTreeCellRenderer.java

示例3: getDefaultClosedIcon

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
  * Returns the default icon, for the current laf, that is used to
  * represent non-leaf nodes that are not expanded.
  */
public Icon getDefaultClosedIcon() {
    return DefaultLookup.getIcon(this, ui, "Tree.closedIcon");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:DefaultTreeCellRenderer.java

示例4: getDefaultLeafIcon

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
  * Returns the default icon, for the current laf, that is used to
  * represent leaf nodes.
  */
public Icon getDefaultLeafIcon() {
    return DefaultLookup.getIcon(this, ui, "Tree.leafIcon");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:DefaultTreeCellRenderer.java

示例5: getDefaultOpenIcon

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
  * Returns the default icon, for the current laf, that is used to
  * represent non-leaf nodes that are expanded.
  *
  * @return the default icon, for the current laf, that is used to
  *         represent non-leaf nodes that are expanded.
  */
public Icon getDefaultOpenIcon() {
    return DefaultLookup.getIcon(this, ui, "Tree.openIcon");
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:DefaultTreeCellRenderer.java

示例6: getDefaultClosedIcon

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
  * Returns the default icon, for the current laf, that is used to
  * represent non-leaf nodes that are not expanded.
  *
  * @return the default icon, for the current laf, that is used to
  *         represent non-leaf nodes that are not expanded.
  */
public Icon getDefaultClosedIcon() {
    return DefaultLookup.getIcon(this, ui, "Tree.closedIcon");
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:DefaultTreeCellRenderer.java

示例7: getDefaultLeafIcon

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
  * Returns the default icon, for the current laf, that is used to
  * represent leaf nodes.
  *
  * @return the default icon, for the current laf, that is used to
  *         represent leaf nodes.
  */
public Icon getDefaultLeafIcon() {
    return DefaultLookup.getIcon(this, ui, "Tree.leafIcon");
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:DefaultTreeCellRenderer.java


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