KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > views > launch > ImageImageDescriptor


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.debug.internal.ui.views.launch;
12
13 import org.eclipse.jface.resource.ImageDescriptor;
14 import org.eclipse.swt.graphics.Image;
15 import org.eclipse.swt.graphics.ImageData;
16
17 /**
18  * Image descriptor for an image.
19  */

20 public class ImageImageDescriptor extends ImageDescriptor {
21     private Image fImage;
22
23     /**
24      * Constructor for ImagImageDescriptor.
25      */

26     public ImageImageDescriptor(Image image) {
27         super();
28         fImage= image;
29     }
30
31     /* (non-Javadoc)
32      * @see ImageDescriptor#getImageData()
33      */

34     public ImageData getImageData() {
35         return fImage.getImageData();
36     }
37
38     /* (non-Javadoc)
39      * @see Object#equals(Object)
40      */

41     public boolean equals(Object JavaDoc obj) {
42         return (obj != null) && getClass().equals(obj.getClass()) && fImage.equals(((ImageImageDescriptor)obj).fImage);
43     }
44
45     /* (non-Javadoc)
46      * @see Object#hashCode()
47      */

48     public int hashCode() {
49         return fImage.hashCode();
50     }
51 }
52
Popular Tags