public class PatternImage extends java.lang.Object implements IBackgroundDrawable
Image
-based background.Modifier and Type | Field and Description |
---|---|
static int |
SCALE_FILL_KEEP_ASPECT
Fill the entire background space of a NativeUI Object,
ensuring that the base
Image is scaled proportionally. |
static int |
SCALE_KEEP_ASPECT_NO_CLIP
Ensure that the base
Image is scaled proportionally to be as large as
possible in the background of a NativeUI Object, but
without clipping. |
static int |
SCALE_STRETCH
Stretch the base
Image set with no regard for proportional scaling; just fill the space available. |
Constructor and Description |
---|
PatternImage(javax.microedition.lcdui.Image baseImage)
Create a tiled
PatternImage from a base Image . |
PatternImage(javax.microedition.lcdui.Image baseImage,
boolean tileH,
boolean tileV)
Create a tiled
PatternImage from a base Image , with custom tiling. |
PatternImage(javax.microedition.lcdui.Image baseImage,
int scalingTypeHint)
Create a
PatternImage that will scale the baseImage to fit the background. |
Modifier and Type | Method and Description |
---|---|
void |
applyBackgroundFor(ICustomBackground element,
int state) |
boolean |
equals(java.lang.Object obj) |
javax.microedition.lcdui.Image |
getBaseImage()
Get the base
Image that this PatternImage is using. |
boolean |
getScaleToFit()
Determine if this
PatternImage will apply scaling to its base Image . |
int |
getScalingTypeHint()
Determine the preferred type of scaling that the
PatternImage will try to apply. |
boolean |
getTileH()
Determine if this
PatternImage will tile its base Image horizontally. |
boolean |
getTileV()
Determine if this
PatternImage will tile its base Image vertically. |
int |
hashCode() |
public static final int SCALE_STRETCH
Image
set with no regard for proportional scaling; just fill the space available.public static final int SCALE_FILL_KEEP_ASPECT
Image
is scaled proportionally.
This may result in the Image
being clipped.public static final int SCALE_KEEP_ASPECT_NO_CLIP
Image
is scaled proportionally to be as large as
possible in the background of a NativeUI Object, but
without clipping.public PatternImage(javax.microedition.lcdui.Image baseImage)
PatternImage
from a base Image
.
The Image
will be tiled horizontally and
vertically to fill the space available to it.baseImage
- the Image
to use.public PatternImage(javax.microedition.lcdui.Image baseImage, boolean tileH, boolean tileV)
PatternImage
from a base Image
, with custom tiling.baseImage
- the Image
to usetileH
- indicates if the baseImage
should be tiled horizontally to fill the spacetileV
- indicates if the baseImage
should be tiled vertically to fill the spacepublic PatternImage(javax.microedition.lcdui.Image baseImage, int scalingTypeHint)
PatternImage
that will scale the baseImage
to fit the background.baseImage
- the Image
to usescalingTypeHint
- a hint to suggest the preferred scaling mode. This will be one of the static SCALE_*
values defined for this class.public void applyBackgroundFor(ICustomBackground element, int state)
applyBackgroundFor
in interface IBackgroundDrawable
public boolean getTileH()
PatternImage
will tile its base Image
horizontally.true
if horizontal tiling is enabledpublic boolean getTileV()
PatternImage
will tile its base Image
vertically.true
if vertical tiling is enabledpublic javax.microedition.lcdui.Image getBaseImage()
Image
that this PatternImage
is using.public boolean getScaleToFit()
PatternImage
will apply scaling to its base Image
.public int getScalingTypeHint()
PatternImage
will try to apply.SCALE_*
integer values defined for this class.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object