本文整理汇总了Java中java.beans.BeanInfo.ICON_COLOR_32x32方法的典型用法代码示例。如果您正苦于以下问题:Java BeanInfo.ICON_COLOR_32x32方法的具体用法?Java BeanInfo.ICON_COLOR_32x32怎么用?Java BeanInfo.ICON_COLOR_32x32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.beans.BeanInfo
的用法示例。
在下文中一共展示了BeanInfo.ICON_COLOR_32x32方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getIcon
import java.beans.BeanInfo; //导入方法依赖的package包/类
@Override
public Image getIcon(int type) {
Image icon = null;
if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) {
if (icon16 == null) {
icon16 = _getIcon(type, icon16URL);
if (icon16 == null)
icon16 = ImageUtilities.loadImage("org/netbeans/modules/palette/resources/unknown16.gif"); // NOI18N
}
icon = icon16;
}
else if (type == BeanInfo.ICON_COLOR_32x32 || type == BeanInfo.ICON_MONO_32x32) {
if (icon32 == null) {
icon32 = _getIcon(type, icon32URL);
if (icon32 == null)
icon32 = ImageUtilities.loadImage("org/netbeans/modules/palette/resources/unknown32.gif"); // NOI18N
}
icon = icon32;
}
return icon;
}
示例2: writeResponseResult
import java.beans.BeanInfo; //导入方法依赖的package包/类
@Override
protected void writeResponseResult(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServiceException {
String className = request.getParameter("className");
String large = request.getParameter("large");
if (className == null || !className.startsWith("com.twinsoft.convertigo.beans"))
throw new ServiceException("Must provide className parameter", null);
try {
BeanInfo bi = CachedIntrospector.getBeanInfo(GenericUtils.<Class<? extends DatabaseObject>>cast(Class.forName(className)));
int iconType = large != null && large.equals("true") ? BeanInfo.ICON_COLOR_32x32 : BeanInfo.ICON_COLOR_16x16;
IOUtils.copy(bi.getBeanDescriptor().getBeanClass().getResourceAsStream(MySimpleBeanInfo.getIconName(bi, iconType)), response.getOutputStream());
} catch (Exception e) {
throw new ServiceException("Icon unreachable", e);
}
Engine.logAdmin.info("The image has been exported");
}
示例3: getIcon
import java.beans.BeanInfo; //导入方法依赖的package包/类
public Image getIcon(int type)
{
Image image = null;
if (type == BeanInfo.ICON_COLOR_16x16) {
image = ImageUtilities.loadImage("org/netbeans/modules/derby/resources/optionsIcon16.png"); // NOI18N
} else if (type == BeanInfo.ICON_COLOR_32x32) {
image = ImageUtilities.loadImage("org/netbeans/modules/derby/resources/optionsIcon32.png"); // NOI18N
}
return image != null ? image : super.getIcon(type);
}
示例4: annotateIconSynch
import java.beans.BeanInfo; //导入方法依赖的package包/类
public @Override Image annotateIconSynch(Image icon, int type, Set<? extends FileObject> files) {
final boolean big;
if (type == BeanInfo.ICON_COLOR_16x16) {
big = false;
} else if (type == BeanInfo.ICON_COLOR_32x32) {
big = true;
} else {
return icon;
}
// XXX could participate in bigIcons/smallIcons cache
return annotateIconGeneral(icon, big, files);
}
示例5: getIcon
import java.beans.BeanInfo; //导入方法依赖的package包/类
Icon getIcon(boolean opened, boolean large) {
int newCacheType = getCacheType(opened, large);
if (cachedIconType != newCacheType) {
int iconType = large ? BeanInfo.ICON_COLOR_32x32 : BeanInfo.ICON_COLOR_16x16;
Image image;
try {
image = opened ? node.getOpenedIcon(iconType) : node.getIcon(iconType);
// bugfix #28515, check if getIcon contract isn't broken
if (image == null) {
String method = opened ? "getOpenedIcon" : "getIcon"; // NOI18N
LOG.warning(
"Node \"" + node.getName() + "\" [" + node.getClass().getName() + "] cannot return null from " +
method + "(). See Node." + method + " contract."
); // NOI18N
}
} catch (RuntimeException x) {
LOG.log(Level.INFO, null, x);
image = null;
}
if (image == null) {
icon = getDefaultIcon();
} else {
icon = ImageUtilities.image2Icon(image);
}
}
cachedIconType = newCacheType;
return icon;
}
示例6: loadIcon
import java.beans.BeanInfo; //导入方法依赖的package包/类
public static Image loadIcon(SaasGroup saasGroup, int type) {
String path = saasGroup.getIcon16Path();
if (type == BeanInfo.ICON_COLOR_32x32 || type == BeanInfo.ICON_MONO_32x32) {
path = saasGroup.getIcon32Path();
}
if (path != null) {
URL url = Thread.currentThread().getContextClassLoader().getResource(path);
if (url != null) {
return new ImageIcon(url).getImage();
}
return ImageUtilities.loadImage(path);
}
return null;
}
示例7: annotateIcon
import java.beans.BeanInfo; //导入方法依赖的package包/类
private Image annotateIcon(FileObject fo, int type) {
String attr = null;
if (type == BeanInfo.ICON_COLOR_16x16) {
attr = "SystemFileSystem.icon"; // NOI18N
} else if (type == BeanInfo.ICON_COLOR_32x32) {
attr = "SystemFileSystem.icon32"; // NOI18N
}
if (attr != null) {
Object value = fo.getAttribute(attr);
if (value != null) {
if (value instanceof URL) {
return Toolkit.getDefaultToolkit().getImage((URL) value);
} else if (value instanceof Image) {
// #18832
return (Image) value;
} else {
LOG.warning("Attribute " + attr + " on " + fo + " expected to be a URL or Image; was: " + value);
}
}
}
String base = (String) fo.getAttribute("iconBase"); // NOI18N
if (base != null) {
if (type == BeanInfo.ICON_COLOR_16x16) {
return ImageUtilities.loadImage(base, true);
} else if (type == BeanInfo.ICON_COLOR_32x32) {
return ImageUtilities.loadImage(insertBeforeSuffix(base, "_32"), true); // NOI18N
}
}
return null;
}
示例8: getDynamicIconName
import java.beans.BeanInfo; //导入方法依赖的package包/类
@Override
public String getDynamicIconName(int iconType) {
if (ionBean != null) {
if (iconType == BeanInfo.ICON_COLOR_16x16) {
return ionBean.getIconColor16Path();
}
else if (iconType == BeanInfo.ICON_COLOR_32x32) {
return ionBean.getIconColor32Path();
}
}
return null;
}
示例9: actionPerformed
import java.beans.BeanInfo; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent event) {
int oldSize = settings.getIconSize();
int newSize = (oldSize == BeanInfo.ICON_COLOR_16x16) ?
BeanInfo.ICON_COLOR_32x32 : BeanInfo.ICON_COLOR_16x16;
settings.setIconSize( newSize );
}