|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.ui.Background
de.enough.polish.ui.backgrounds.PolygonBackground
public class PolygonBackground
Paints a filled polygon as a background in a specific color.
usage:
.myItem {
background {
type: polygon;
color: green;
points: 0,50 50,0 100,50 50,100;
max-x: 100;
max-y: 100;
scale-mode: proportional; // none, scale, proportional, expand
expand: false;
}
}
Copyright Enough Software 2007 - 2008
| Field Summary | |
|---|---|
static int |
MODE_NO_SCALE
use this mode for not scaling the polygon at all |
static int |
MODE_SCALE
use this mode for scaling the polygon according to the width and height of the background - the given reference width and height are used for calculating the actual positions |
static int |
MODE_SCALE_PROPORTIONAL
use this mode for scaling the polygon proportional according to the minimum of width and height of the background - the given reference width and height are used for calculating the actual positions |
static int |
MODE_SCALE_PROPORTIONAL_EXPAND
use this mode for scaling the polygon proportional according to the maximum of width and height of the background - the given reference width and height are used for calculating the actual positions |
| Fields inherited from class de.enough.polish.ui.Background |
|---|
borderWidth |
| Constructor Summary | |
|---|---|
PolygonBackground(Color color,
Point[] points,
int referenceWidth,
int referenceHeight,
int scalingMode,
int anchor)
Creates a new simple background. |
|
PolygonBackground(int color,
Point[] points,
int referenceWidth,
int referenceHeight,
int scalingMode,
int anchor)
Creates a new simple background. |
|
| Method Summary | |
|---|---|
void |
paint(int x,
int y,
int width,
int height,
javax.microedition.lcdui.Graphics g)
Paints this background. |
| Methods inherited from class de.enough.polish.ui.Background |
|---|
addRelativeToBackgroundRegion, animate, animate, hideNotify, releaseResources, showNotify |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MODE_NO_SCALE
public static final int MODE_SCALE
public static final int MODE_SCALE_PROPORTIONAL
public static final int MODE_SCALE_PROPORTIONAL_EXPAND
| Constructor Detail |
|---|
public PolygonBackground(int color,
Point[] points,
int referenceWidth,
int referenceHeight,
int scalingMode,
int anchor)
color - the color of the background in RGB, e.g. 0xFFDD11points - the points of the polygonreferenceWidth - the maximum horizontal position, 0 when the positions should not be scaledreferenceHeight - the maximum horizontal position, 0 when the positions should not be scaledscalingMode - the scaling mode to be usedanchor - the anchor like Graphics.TOP | Graphics.RIGHT etc - only applicable in no-expanded proportional or non-scaling modeMODE_NO_SCALE,
MODE_SCALE,
MODE_SCALE_PROPORTIONAL,
MODE_SCALE_PROPORTIONAL_EXPAND
public PolygonBackground(Color color,
Point[] points,
int referenceWidth,
int referenceHeight,
int scalingMode,
int anchor)
color - the color of the background in RGB, e.g. 0xFFDD11points - the points of the polygonreferenceWidth - the maximum horizontal position, 0 when the positions should not be scaledreferenceHeight - the maximum horizontal position, 0 when the positions should not be scaledscalingMode - the scaling mode to be usedanchor - the anchor like Graphics.TOP | Graphics.RIGHT etc - only applicable in no-expanded proportional or non-scaling modeMODE_NO_SCALE,
MODE_SCALE,
MODE_SCALE_PROPORTIONAL,
MODE_SCALE_PROPORTIONAL_EXPAND| Method Detail |
|---|
public void paint(int x,
int y,
int width,
int height,
javax.microedition.lcdui.Graphics g)
Background
paint in class Backgroundx - the horizontal start pointy - the vertical start pointwidth - the width of the backgroundheight - the height of the backgroundg - the Graphics on which the background should be painted.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||