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


Java Image.UndefinedProperty方法代码示例

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


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

示例1: getProperty

import java.awt.Image; //导入方法依赖的package包/类
/**
 * Return a property of the image by name.  Individual property names
 * are defined by the various image formats.  If a property is not
 * defined for a particular image, then this method will return the
 * UndefinedProperty object.  If the properties for this image are
 * not yet known, then this method will return null and the ImageObserver
 * object will be notified later.  The property name "comment" should
 * be used to store an optional comment which can be presented to
 * the user as a description of the image, its source, or its author.
 */
public Object getProperty(String name, ImageObserver observer) {
    if (name == null) {
        throw new NullPointerException("null property name is not allowed");
    }

    if (src != null) {
        src.checkSecurity(null, false);
    }
    if (properties == null) {
        addWatcher(observer, true);
        if (properties == null) {
            return null;
        }
    }
    Object o = properties.get(name);
    if (o == null) {
        o = Image.UndefinedProperty;
    }
    return o;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:ToolkitImage.java

示例2: validate

import java.awt.Image; //导入方法依赖的package包/类
private static void validate(final BufferedImage bi, final int expected) {
    final String[] names = bi.getPropertyNames();
    if (names.length != expected) {
        throw new RuntimeException("Wrong number of names");
    }
    for (final String name : names) {
        final Object property = bi.getProperty(name);
        if (property == Image.UndefinedProperty || property == null) {
            throw new RuntimeException("Unexpected property");
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:GetPropertyNames.java

示例3: getProperty

import java.awt.Image; //导入方法依赖的package包/类
@Override
public Object getProperty(String name, ImageObserver observer) {
    updateInfo(observer, ImageObserver.PROPERTIES);
    return Image.UndefinedProperty;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:MultiResolutionCachedImage.java


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