public class RoundedBackground extends java.lang.Object implements Background
Should be used in association with a RoundedBorder
to:
The corner radius is stored as a char
for heap optimization and therefore cannot exceed
65535
.
Constructor and Description |
---|
RoundedBackground(int color,
int cornerRadius)
Creates a rounded background.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(ej.microui.display.GraphicsContext g,
int width,
int height)
Applies the background on a graphics context.
|
boolean |
equals(java.lang.Object obj) |
int |
getColor()
Gets the color.
|
int |
getCornerRadius()
Gets the corner radius.
|
int |
hashCode() |
boolean |
isTransparent(int width,
int height)
Tells whether or not this background is transparent.
|
public RoundedBackground(int color, int cornerRadius)
The given corner radius is clamped between 0
and Character.MAX_VALUE
.
color
- the color to set.cornerRadius
- the corner radius to set.public int getColor()
public int getCornerRadius()
public boolean isTransparent(int width, int height)
Background
A background is considered as transparent if it does not draw every pixel with maximal opacity when it is applied. If a widget has a transparent background, its parent has to be rendered before the widget.
isTransparent
in interface Background
width
- the width of the background.height
- the height of the background.true
if the background is transparent, false
otherwise.public void apply(ej.microui.display.GraphicsContext g, int width, int height)
Background
apply
in interface Background
g
- the graphics context.width
- the width of the background.height
- the height of the background.public boolean equals(@Nullable java.lang.Object obj)
equals
in interface Background
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface Background
hashCode
in class java.lang.Object