/*******************************************************************************
* Copyright (c) 2009, 2010 Innovation Gate GmbH.
* 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:
* Innovation Gate GmbH - initial API and implementation
******************************************************************************/
package de.innovationgate.eclipse.editors.helpers;
import org.eclipse.jface.resource.CompositeImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.Point;
import de.innovationgate.eclipse.editors.Plugin;
public class DirectAccessCompositeImageDescriptor extends CompositeImageDescriptor {
private Image _baseImage;
public DirectAccessCompositeImageDescriptor(Image image) {
_baseImage = image;
}
@Override
protected void drawCompositeImage(int width, int height) {
drawImage(_baseImage.getImageData(), 0, 0);
Image overlayImage = Plugin.getDefault().getImageRegistry().get(Plugin.IMAGE_WORLD);
ImageData overlayImageData = overlayImage.getImageData();
int xValue = 5;
int yValue = 0;
drawImage (overlayImageData, xValue, yValue);
}
@Override
protected Point getSize() {
return new Point(_baseImage.getImageData().height, _baseImage.getImageData().width);
}
}