Runtime

## org.eclipse.gmf.runtime.common.ui.util
Class ShiftedImageDescriptor

    java.lang.Object
      org.eclipse.jface.resource.DeviceResourceDescriptor
          org.eclipse.jface.resource.ImageDescriptor
              org.eclipse.jface.resource.CompositeImageDescriptor
                  org.eclipse.gmf.runtime.common.ui.util.ShiftedImageDescriptor

public class ShiftedImageDescriptor
extends CompositeImageDescriptor

An image descriptor that is cached and shifted from the left or from the top or both. The shifted area contains the original image and the area on the left or top contains a background color. Both the original image and background color are specified in the constructor.

Field Summary

Fields inherited from class org.eclipse.jface.resource.ImageDescriptor
`DEFAULT_IMAGE_DATA`

Constructor Summary
`ShiftedImageDescriptor(short shiftX, short shiftY, ImageDescriptor imageDescriptor)` Make a new image descriptor of an image that is shifted.

Method Summary
`protected void` `drawCompositeImage(int width, int height)` Draw the image in the shifted position
`protected Point` `getSize()` Return the size of the shifted image and cache it

Methods inherited from class org.eclipse.jface.resource.CompositeImageDescriptor
`drawImage, getImageData`

Methods inherited from class org.eclipse.jface.resource.ImageDescriptor
`createFromFile, createFromImage, createFromImage, createFromImageData, createFromURL, createImage, createImage, createImage, createImage, createResource, createWithFlags, destroyResource, getMissingImageDescriptor`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ShiftedImageDescriptor

    public ShiftedImageDescriptor(short shiftX,
                                  short shiftY,
                                  ImageDescriptor imageDescriptor)

  Make a new image descriptor of an image that is shifted.

Parameters:
  `shiftX` - how much to shift from the left
  `shiftY` - how much to shift from the top
  `imageDescriptor` - original image to shift by shiftX and shiftY

Method Detail

### drawCompositeImage

    protected void drawCompositeImage(int width,
                                      int height)

  Draw the image in the shifted position

  Parameters:
    `width` - int ignored
    `height` - int ignored
  See Also:
    `CompositeImageDescriptor.drawCompositeImage(int, int)`

### getSize

    protected Point getSize()

  Return the size of the shifted image and cache it

  Returns:
    Point with the size of the shifted image
  See Also:
    `CompositeImageDescriptor.getSize()`

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.