public abstract class AbstractImageBackground extends java.lang.Object implements Background
Constructor and Description |
---|
AbstractImageBackground()
Creates an abstract image background.
|
AbstractImageBackground(ej.microui.display.Image image,
int alignment,
boolean fillColor)
Creates an abstract image background specifying its image and alignment.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(ej.microui.display.GraphicsContext g,
Rectangle bounds,
int color)
Applies the background on a graphics context.
|
protected abstract void |
drawImage(ej.microui.display.GraphicsContext g,
Rectangle bounds)
Draws the background image.
|
boolean |
equals(java.lang.Object obj) |
int |
getAlignment()
Gets the alignment.
|
ej.microui.display.Image |
getImage()
Gets the image.
|
int |
hashCode() |
boolean |
isFillColor()
Gets whether or not the remaining area is filled with the background color.
|
boolean |
isTransparent()
Tells whether or not the background is transparent.
|
void |
setAlignment(int alignment)
Sets the alignment.
|
void |
setFillColor(boolean fillColor)
Sets whether or not the remaining area is filled with the background color.
|
void |
setImage(ej.microui.display.Image image)
Sets the image.
|
public AbstractImageBackground()
public AbstractImageBackground(ej.microui.display.Image image, int alignment, boolean fillColor)
image
- the background image to set.alignment
- the alignment to set.fillColor
- true
to fill remaining area with background color, false
otherwise.public void setImage(@Nullable ej.microui.display.Image image)
image
- the image to set.@Nullable public ej.microui.display.Image getImage()
public void setAlignment(int alignment)
alignment
- the alignment to set.java.lang.IllegalArgumentException
- if the alignment is not valid.AlignmentHelper.validateAlignment(int)
public int getAlignment()
public void setFillColor(boolean fillColor)
fillColor
- true
to fill remaining area with background color, false
otherwise.public boolean isFillColor()
true
if the remaining area is filled with the background color, false
otherwise.public boolean isTransparent()
Background
isTransparent
in interface Background
true
if the background is transparent, false
otherwise.public void apply(ej.microui.display.GraphicsContext g, Rectangle bounds, int color)
Background
apply
in interface Background
g
- the graphics context.bounds
- the available rectangle.color
- the background color.public boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
protected abstract void drawImage(ej.microui.display.GraphicsContext g, Rectangle bounds)
g
- the graphics context.bounds
- the available rectangle.