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


Java IconInfo类代码示例

本文整理汇总了Java中sun.awt.IconInfo的典型用法代码示例。如果您正苦于以下问题:Java IconInfo类的具体用法?Java IconInfo怎么用?Java IconInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getSecurityIconInfo

import sun.awt.IconInfo; //导入依赖的package包/类
private static IconInfo getSecurityIconInfo(int size, int num) {
    synchronized (CWarningWindow.class) {
        if (icons == null) {
            icons = new IconInfo[4][3];
            icons[0][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw16_png.security_icon_bw16_png);
            icons[0][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim16_png.security_icon_interim16_png);
            icons[0][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow16_png.security_icon_yellow16_png);
            icons[1][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw24_png.security_icon_bw24_png);
            icons[1][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim24_png.security_icon_interim24_png);
            icons[1][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow24_png.security_icon_yellow24_png);
            icons[2][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw32_png.security_icon_bw32_png);
            icons[2][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim32_png.security_icon_interim32_png);
            icons[2][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow32_png.security_icon_yellow32_png);
            icons[3][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw48_png.security_icon_bw48_png);
            icons[3][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim48_png.security_icon_interim48_png);
            icons[3][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow48_png.security_icon_yellow48_png);
        }
    }
    final int sizeIndex = size % icons.length;
    return icons[sizeIndex][num % icons[sizeIndex].length];
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:CWarningWindow.java

示例2: recursivelySetIcon

import sun.awt.IconInfo; //导入依赖的package包/类
public void recursivelySetIcon(java.util.List<IconInfo> icons) {
    dumpIcons(winAttr.icons);
    setIconHints(icons);
    Window target = (Window)this.target;
    Window[] children = target.getOwnedWindows();
    int cnt = children.length;
    for (int i = 0; i < cnt; i++) {
        ComponentPeer childPeer = children[i].getPeer();
        if (childPeer != null && childPeer instanceof XWindowPeer) {
            if (((XWindowPeer)childPeer).winAttr.iconsInherited) {
                ((XWindowPeer)childPeer).winAttr.icons = icons;
                ((XWindowPeer)childPeer).recursivelySetIcon(icons);
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:XWindowPeer.java

示例3: getDefaultIconInfo

import sun.awt.IconInfo; //导入依赖的package包/类
protected synchronized static java.util.List<IconInfo> getDefaultIconInfo() {
    if (defaultIconInfo == null) {
        defaultIconInfo = new ArrayList<IconInfo>();
        if (XlibWrapper.dataModel == 32) {
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon16_png.java_icon16_png));
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon24_png.java_icon24_png));
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon32_png.java_icon32_png));
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon48_png.java_icon48_png));
        } else {
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon16_png.java_icon16_png));
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon24_png.java_icon24_png));
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon32_png.java_icon32_png));
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon48_png.java_icon48_png));
        }
    }
    return defaultIconInfo;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:XWindowPeer.java

示例4: recursivelySetIcon

import sun.awt.IconInfo; //导入依赖的package包/类
public void recursivelySetIcon(java.util.List<IconInfo> icons) {
    dumpIcons(winAttr.icons);
    setIconHints(icons);
    Window target = (Window)this.target;
    Window[] children = target.getOwnedWindows();
    int cnt = children.length;
    final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
    for (int i = 0; i < cnt; i++) {
        final ComponentPeer childPeer = acc.getPeer(children[i]);
        if (childPeer != null && childPeer instanceof XWindowPeer) {
            if (((XWindowPeer)childPeer).winAttr.iconsInherited) {
                ((XWindowPeer)childPeer).winAttr.icons = icons;
                ((XWindowPeer)childPeer).recursivelySetIcon(icons);
            }
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:XWindowPeer.java

示例5: getDefaultIconInfo

import sun.awt.IconInfo; //导入依赖的package包/类
protected static synchronized java.util.List<IconInfo> getDefaultIconInfo() {
    if (defaultIconInfo == null) {
        defaultIconInfo = new ArrayList<IconInfo>();
        if (XlibWrapper.dataModel == 32) {
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon16_png.java_icon16_png));
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon24_png.java_icon24_png));
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon32_png.java_icon32_png));
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon48_png.java_icon48_png));
        } else {
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon16_png.java_icon16_png));
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon24_png.java_icon24_png));
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon32_png.java_icon32_png));
            defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon48_png.java_icon48_png));
        }
    }
    return defaultIconInfo;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:XWindowPeer.java

示例6: setIconImages

import sun.awt.IconInfo; //导入依赖的package包/类
/**
 * Sets icon image by selecting one of the images from the list.
 * The selected image is the one having the best matching size.
 */
void setIconImages(java.util.List<IconInfo> icons) {
    if (icons == null || icons.size() == 0) return;

    int minDiff = Integer.MAX_VALUE;
    Image min = null;
    for (IconInfo iconInfo : icons) {
        if (iconInfo.isValid()) {
            Image image = iconInfo.getImage();
            Dimension dim = calcIconSize(image.getWidth(null), image.getHeight(null));
            int widthDiff = Math.abs(dim.width - image.getWidth(null));
            int heightDiff = Math.abs(image.getHeight(null) - dim.height);

            // "=" below allows to select the best matching icon
            if (minDiff >= (widthDiff + heightDiff)) {
                minDiff = (widthDiff + heightDiff);
                min = image;
            }
        }
    }
    if (min != null) {
        log.finer("Icon: {0}x{1}", min.getWidth(null), min.getHeight(null));
        setIconImage(min);
    }
}
 
开发者ID:greghaskins,项目名称:openjdk-jdk7u-jdk,代码行数:29,代码来源:XIconWindow.java

示例7: updateIconSize

import sun.awt.IconInfo; //导入依赖的package包/类
private void updateIconSize() {
    int newSize = -1;

    if (ownerWindow != null) {
        Insets insets = ownerWindow.getInsets();
        int max = Math.max(insets.top, Math.max(insets.bottom,
                Math.max(insets.left, insets.right)));
        if (max < 24) {
            newSize = 0;
        } else if (max < 32) {
            newSize = 1;
        } else if (max < 48) {
            newSize = 2;
        } else {
            newSize = 3;
        }
    }
    // Make sure we have a valid size
    if (newSize == -1) {
        newSize = 0;
    }

    synchronized (lock) {
        if (newSize != currentSize) {
            currentSize = newSize;
            IconInfo ico = getSecurityIconInfo(currentSize, 0);
            AWTAccessor.getWindowAccessor().setSecurityWarningSize(
                ownerWindow, ico.getWidth(), ico.getHeight());
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:CWarningWindow.java

示例8: setIconHints

import sun.awt.IconInfo; //导入依赖的package包/类
void setIconHints(java.util.List<IconInfo> icons) {
    if (!XWM.getWM().setNetWMIcon(this, icons)) {
        if (icons.size() > 0) {
            if (iconWindow == null) {
                iconWindow = new XIconWindow(this);
            }
            iconWindow.setIconImages(icons);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:XDecoratedPeer.java

示例9: getSecurityIconInfo

import sun.awt.IconInfo; //导入依赖的package包/类
private static IconInfo getSecurityIconInfo(int size, int num) {
    synchronized (XWarningWindow.class) {
        if (icons == null) {
            icons = new IconInfo[4][3];
            if (XlibWrapper.dataModel == 32) {
                icons[0][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw16_png.security_icon_bw16_png);
                icons[0][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim16_png.security_icon_interim16_png);
                icons[0][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow16_png.security_icon_yellow16_png);
                icons[1][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw24_png.security_icon_bw24_png);
                icons[1][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim24_png.security_icon_interim24_png);
                icons[1][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow24_png.security_icon_yellow24_png);
                icons[2][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw32_png.security_icon_bw32_png);
                icons[2][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim32_png.security_icon_interim32_png);
                icons[2][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow32_png.security_icon_yellow32_png);
                icons[3][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw48_png.security_icon_bw48_png);
                icons[3][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim48_png.security_icon_interim48_png);
                icons[3][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow48_png.security_icon_yellow48_png);
            } else {
                icons[0][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw16_png.security_icon_bw16_png);
                icons[0][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim16_png.security_icon_interim16_png);
                icons[0][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow16_png.security_icon_yellow16_png);
                icons[1][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw24_png.security_icon_bw24_png);
                icons[1][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim24_png.security_icon_interim24_png);
                icons[1][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow24_png.security_icon_yellow24_png);
                icons[2][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw32_png.security_icon_bw32_png);
                icons[2][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim32_png.security_icon_interim32_png);
                icons[2][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow32_png.security_icon_yellow32_png);
                icons[3][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw48_png.security_icon_bw48_png);
                icons[3][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim48_png.security_icon_interim48_png);
                icons[3][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow48_png.security_icon_yellow48_png);
            }
        }
    }
    final int sizeIndex = size % icons.length;
    return icons[sizeIndex][num % icons[sizeIndex].length];
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:XWarningWindow.java

示例10: setIconImages

import sun.awt.IconInfo; //导入依赖的package包/类
/**
 * Sets icon image by selecting one of the images from the list.
 * The selected image is the one having the best matching size.
 */
void setIconImages(java.util.List<IconInfo> icons) {
    if (icons == null || icons.size() == 0) return;

    int minDiff = Integer.MAX_VALUE;
    Image min = null;
    for (IconInfo iconInfo : icons) {
        if (iconInfo.isValid()) {
            Image image = iconInfo.getImage();
            Dimension dim = calcIconSize(image.getWidth(null), image.getHeight(null));
            int widthDiff = Math.abs(dim.width - image.getWidth(null));
            int heightDiff = Math.abs(image.getHeight(null) - dim.height);

            // "=" below allows to select the best matching icon
            if (minDiff >= (widthDiff + heightDiff)) {
                minDiff = (widthDiff + heightDiff);
                min = image;
            }
        }
    }
    if (min != null) {
        if (log.isLoggable(PlatformLogger.Level.FINER)) {
            log.finer("Icon: {0}x{1}", min.getWidth(null), min.getHeight(null));
        }
        setIconImage(min);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:XIconWindow.java

示例11: dumpIcons

import sun.awt.IconInfo; //导入依赖的package包/类
static void dumpIcons(java.util.List<IconInfo> icons) {
    if (iconLog.isLoggable(PlatformLogger.Level.FINEST)) {
        iconLog.finest(">>> Sizes of icon images:");
        for (Iterator<IconInfo> i = icons.iterator(); i.hasNext(); ) {
            iconLog.finest("    {0}", i.next());
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:XWindowPeer.java


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