當前位置: 首頁>>代碼示例>>Java>>正文


Java CompositeImageDescriptor類代碼示例

本文整理匯總了Java中org.eclipse.jface.resource.CompositeImageDescriptor的典型用法代碼示例。如果您正苦於以下問題:Java CompositeImageDescriptor類的具體用法?Java CompositeImageDescriptor怎麽用?Java CompositeImageDescriptor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CompositeImageDescriptor類屬於org.eclipse.jface.resource包,在下文中一共展示了CompositeImageDescriptor類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: decorateImage

import org.eclipse.jface.resource.CompositeImageDescriptor; //導入依賴的package包/類
private Image decorateImage(final Image image, INSISInstallElement element)
{
    String name = Integer.toString(image.hashCode())+"$error"; //$NON-NLS-1$
    Image image2 = EclipseNSISPlugin.getImageManager().getImage(name);
    if(image2 == null) {
        EclipseNSISPlugin.getImageManager().putImageDescriptor(name,
                new CompositeImageDescriptor(){
                    @Override
                    protected void drawCompositeImage(int width, int height)
                    {
                        drawImage(image.getImageData(),0,0);
                        drawImage(cErrorImageData,0,getSize().y-cErrorImageData.height);
                    }

                    @Override
                    protected Point getSize()
                    {
                        return new Point(image.getBounds().width,image.getBounds().height);
                    }
                });
        image2 = EclipseNSISPlugin.getImageManager().getImage(name);
    }
    return image2;
}
 
開發者ID:henrikor2,項目名稱:eclipsensis,代碼行數:25,代碼來源:NSISInstallElementLabelProvider.java

示例2: decorateImage

import org.eclipse.jface.resource.CompositeImageDescriptor; //導入依賴的package包/類
private Image decorateImage(NSISOutlineElement element)
{
    final Image image = (element.isRoot()?cRootImage:element.getIcon());
    final ImageData data;
    String hashCode;
    int severity = getElementSeverity(element);
    switch(severity) {
        case IMarker.SEVERITY_ERROR:
            hashCode = image.hashCode() + "$error"; //$NON-NLS-1$
            data = cErrorImageData;
            break;
        case IMarker.SEVERITY_WARNING:
            hashCode = image.hashCode() + "$warning"; //$NON-NLS-1$
            data = cWarningImageData;
            break;
        default:
            return image;
    }
    Image image2 = EclipseNSISPlugin.getImageManager().getImage(hashCode);
    if(image2 == null) {
        EclipseNSISPlugin.getImageManager().putImageDescriptor(hashCode,
                new CompositeImageDescriptor(){
                    @Override
                    protected void drawCompositeImage(int width, int height)
                    {
                        drawImage(image.getImageData(),0,0);
                        drawImage(data,0,getSize().y-data.height);
                    }

                    @Override
                    protected Point getSize()
                    {
                        return new Point(image.getBounds().width,image.getBounds().height);
                    }
                });
        image2 = EclipseNSISPlugin.getImageManager().getImage(hashCode);
    }
    return image2;
}
 
開發者ID:henrikor2,項目名稱:eclipsensis,代碼行數:40,代碼來源:NSISOutlineLabelProvider.java


注:本文中的org.eclipse.jface.resource.CompositeImageDescriptor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。