diff options
Diffstat (limited to 'plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/OverlayIcon.java')
-rw-r--r-- | plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/OverlayIcon.java | 121 |
1 files changed, 0 insertions, 121 deletions
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/OverlayIcon.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/OverlayIcon.java deleted file mode 100644 index 8ff7b0a06..000000000 --- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/OverlayIcon.java +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.common.frameworks.internal.ui; - - - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.Point; - -public class OverlayIcon extends org.eclipse.jface.resource.CompositeImageDescriptor { - // //$NON-NLS-1$ - static final int DEFAULT_WIDTH = 16; - static final int DEFAULT_HEIGHT = 16; - private Point fSize = null; - private ImageDescriptor fBase; - private ImageDescriptor fOverlays[][]; - - public OverlayIcon(ImageDescriptor base, ImageDescriptor[][] overlays) { - fBase = base; - if (fBase == null) - fBase = ImageDescriptor.getMissingImageDescriptor(); - fOverlays = overlays; - fSize = new Point(DEFAULT_WIDTH, DEFAULT_HEIGHT); - } - - public OverlayIcon(ImageDescriptor base, ImageDescriptor[][] overlays, Point size) { - fBase = base; - if (fBase == null) - fBase = ImageDescriptor.getMissingImageDescriptor(); - fOverlays = overlays; - fSize = size; - } - - protected void drawBottomLeft(ImageDescriptor[] overlays) { - if (overlays == null) - return; - int length = overlays.length; - int x = 0; - for (int i = 0; i < 3; i++) { - if (i < length && overlays[i] != null) { - ImageData id = overlays[i].getImageData(); - drawImage(id, x, getSize().y - id.height); - x += id.width; - } - } - } - - protected void drawBottomRight(ImageDescriptor[] overlays) { - if (overlays == null) - return; - int length = overlays.length; - int x = getSize().x; - for (int i = 2; i >= 0; i--) { - if (i < length && overlays[i] != null) { - ImageData id = overlays[i].getImageData(); - x -= id.width; - drawImage(id, x, getSize().y - id.height); - } - } - } - - protected void drawCompositeImage(int width, int height) { - ImageData bg = fBase.getImageData(); - drawImage(bg, 0, 0); - - if (fOverlays != null) { - if (fOverlays.length > 0) - drawTopRight(fOverlays[0]); - - if (fOverlays.length > 1) - drawBottomRight(fOverlays[1]); - - if (fOverlays.length > 2) - drawBottomLeft(fOverlays[2]); - - if (fOverlays.length > 3) - drawTopLeft(fOverlays[3]); - } - } - - protected void drawTopLeft(ImageDescriptor[] overlays) { - if (overlays == null) - return; - int length = overlays.length; - int x = 0; - for (int i = 0; i < 3; i++) { - if (i < length && overlays[i] != null) { - ImageData id = overlays[i].getImageData(); - drawImage(id, x, 0); - x += id.width; - } - } - } - - protected void drawTopRight(ImageDescriptor[] overlays) { - if (overlays == null) - return; - int length = overlays.length; - int x = getSize().x; - for (int i = 2; i >= 0; i--) { - if (i < length && overlays[i] != null) { - ImageData id = overlays[i].getImageData(); - x -= id.width; - drawImage(id, x, 0); - } - } - } - - protected Point getSize() { - return fSize; - } -} |