public class MapImage extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
MapImage.MapImageBoxProvider |
Modifier and Type | Field and Description |
---|---|
int |
alpha
The alpha (opacity) value of the image.
|
boolean |
autoRescale
A flag indicating that the image should automatically be scaled to the right size.
|
private java.awt.image.BufferedImage |
disabledImgCache
A cache that holds a disabled (gray) version of this image
|
int |
height
The height of the image, as set by MapCSS
|
private java.awt.Image |
img
ImageIcon can change while the image is loading.
|
private static int |
MAX_SIZE |
java.lang.String |
name
The name of the image that should be displayed.
|
int |
offsetX
The x offset of the anchor of this image
|
int |
offsetY
The y offset of the anchor of this image
|
StyleSource |
source
The StyleSource that registered the image
|
private boolean |
temporary |
int |
width
The width of the image, as set by MapCSS
|
Constructor and Description |
---|
MapImage(java.lang.String name,
StyleSource source)
Creates a new
MapImage |
MapImage(java.lang.String name,
StyleSource source,
boolean autoRescale)
Creates a new
MapImage |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
float |
getAlphaFloat()
Gets the alpha value the image should be multiplied with
|
BoxTextElement.BoxProvider |
getBoxProvider()
Gets a box provider that provides a box that covers the size of this image
|
private java.awt.Image |
getDisabled() |
int |
getHeight()
Gets the image height
|
private java.awt.Image |
getImage() |
java.awt.Image |
getImage(boolean disabled)
Get the image associated with this MapImage object.
|
int |
getWidth()
Gets the image width
|
int |
hashCode() |
boolean |
isTemporary()
Determines if image is not completely loaded and
getImage() returns a temporary image. |
private boolean |
mustRescale(java.awt.Image image) |
private java.awt.Image |
rescale(java.awt.Image image)
Rescale excessively large images.
|
java.lang.String |
toString() |
private static final int MAX_SIZE
private java.awt.Image img
public int alpha
public java.lang.String name
ImageProvider
public StyleSource source
public boolean autoRescale
public int width
public int height
public int offsetX
public int offsetY
private boolean temporary
private java.awt.image.BufferedImage disabledImgCache
public MapImage(java.lang.String name, StyleSource source)
MapImage
name
- The image namesource
- The style source that requests this imagepublic MapImage(java.lang.String name, StyleSource source, boolean autoRescale)
MapImage
name
- The image namesource
- The style source that requests this imageautoRescale
- A flag indicating to automatically adjust the width/height of the imagepublic java.awt.Image getImage(boolean disabled)
disabled
- true to request disabled version, false
for the standard versionprivate java.awt.Image getDisabled()
private java.awt.Image getImage()
public int getWidth()
public int getHeight()
public float getAlphaFloat()
public boolean isTemporary()
getImage()
returns a temporary image.true
if image is not completely loaded and getImage() returns a temporary imagepublic BoxTextElement.BoxProvider getBoxProvider()
private java.awt.Image rescale(java.awt.Image image)
image
- the unscaled imageprivate boolean mustRescale(java.awt.Image image)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object