本文整理汇总了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;
}
示例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");
}
}
}
示例3: getProperty
import java.awt.Image; //导入方法依赖的package包/类
@Override
public Object getProperty(String name, ImageObserver observer) {
updateInfo(observer, ImageObserver.PROPERTIES);
return Image.UndefinedProperty;
}