/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public class IconInfo {
/**
* Representation of image as an int array.
* It's used on platforms where icon data
* is expected to be in 32-bit format.
*/
private int[] intIconData;
/**
* Representation of image as an long array.
* It's used on platforms where icon data
* is expected to be in 64-bit format.
*/
private long[] longIconData;
/**
* Icon image.
*/
/**
* Width of icon image. Being set in constructor.
*/
private final int width;
/**
* Height of icon image. Being set in constructor.
*/
private final int height;
/**
* Width of scaled icon image. Can be set in setScaledDimension.
*/
private int scaledWidth;
/**
* Height of scaled icon image. Can be set in setScaledDimension.
*/
private int scaledHeight;
/**
* Length of raw data. Being set in constructor / setScaledDimension.
*/
private int rawLength;
this.intIconData =
this.scaledWidth = width;
this.scaledHeight = height;
}
this.longIconData =
this.scaledWidth = width;
this.scaledHeight = height;
}
if (image instanceof ToolkitImage) {
} else {
}
this.scaledWidth = width;
this.scaledHeight = height;
}
/*
* It sets size of scaled icon.
*/
this.scaledWidth = width;
this.scaledHeight = height;
}
public boolean isValid() {
}
public int getWidth() {
return width;
}
public int getHeight() {
return height;
}
}
public int getRawLength() {
return rawLength;
}
public int[] getIntData() {
if (this.intIconData == null) {
if (this.longIconData != null) {
}
}
return this.intIconData;
}
public long[] getLongData() {
if (this.longIconData == null) {
if (this.intIconData != null) {
}
}
return this.longIconData;
}
if (this.intIconData != null) {
} else if (this.longIconData != null) {
}
}
return this.image;
}
// Such a conversion is valid since the
// original data (see
// make/sun/xawt/ToBin.java) were ints
}
return intData;
}
}
return longData;
}
ColorModel cm =
0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000,
false, DataBuffer.TYPE_INT);
raw[0],
new int[] {0x00ff0000, 0x0000ff00,
0x000000ff, 0xff000000},
null);
return im;
}
/*
* Returns array of integers which holds data for the image.
* It scales the image if necessary.
*/
return null;
}
ColorModel cm =
0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000,
false, DataBuffer.TYPE_INT);
new int[] {0x00ff0000, 0x0000ff00,
0x000000ff, 0xff000000},
null);
g.dispose();
return raw;
}
}