use of org.jowidgets.common.image.IImageDescriptor in project jo-client-platform by jo-source.
the class BeanRelationGraphImpl method renderIcon.
private void renderIcon(final Node node, final IBeanProxy<Object> bean, final IBeanProxyLabelRenderer<Object> renderer) {
final IImageConstant icon = renderer.getLabel(bean).getIcon();
if (icon != null) {
final IImageHandle imageHandle = Toolkit.getImageRegistry().getImageHandle(icon);
if (imageHandle != null) {
final Object image = imageHandle.getImage();
final IImageDescriptor imageDescriptor = imageHandle.getImageDescriptor();
if (image instanceof Image) {
renderIcon(node, (Image) image);
} else if (imageDescriptor != null) {
IImageHandle awtImageHandle = SwingImageRegistry.getInstance().getImageHandle(icon);
if (awtImageHandle == null) {
SwingImageRegistry.getInstance().registerImageConstant(icon, imageDescriptor);
awtImageHandle = SwingImageRegistry.getInstance().getImageHandle(icon);
}
renderIcon(node, (Image) awtImageHandle.getImage());
}
}
}
}
use of org.jowidgets.common.image.IImageDescriptor in project jo-client-platform by jo-source.
the class NodeRenderer method initializeIcons.
private Image initializeIcons(final IImageConstant iconImage) {
final IImageConstant icon = iconImage;
if (icon != null) {
final IImageHandle imageHandle = Toolkit.getImageRegistry().getImageHandle(icon);
if (imageHandle != null) {
final Object image = imageHandle.getImage();
final IImageDescriptor imageDescriptor = imageHandle.getImageDescriptor();
if (image instanceof Image) {
return (Image) image;
} else if (imageDescriptor != null) {
IImageHandle awtImageHandle = SwingImageRegistry.getInstance().getImageHandle(icon);
if (awtImageHandle == null) {
SwingImageRegistry.getInstance().registerImageConstant(icon, imageDescriptor);
awtImageHandle = SwingImageRegistry.getInstance().getImageHandle(icon);
}
return (Image) awtImageHandle.getImage();
}
}
}
return null;
}
Aggregations