Methods Summary |
---|
public final int | getHeight()Gets the current height of this layer, in pixels.
return height;
|
public final int | getWidth()Gets the current width of this layer, in pixels.
return width;
|
public final int | getX()Gets the horizontal position of this Layer's upper-left corner
in the painter's coordinate system.
return x;
|
public final int | getY()Gets the vertical position of this Layer's upper-left corner
in the painter's coordinate system.
return y;
|
public final boolean | isVisible()Gets the visibility of this Layer.
return visible;
|
public void | move(int dx, int dy)Moves this Layer by the specified horizontal and vertical distances.
The Layer's coordinates are subject to wrapping if the passed
parameters will cause them to exceed beyond Integer.MAX_VALUE
or Integer.MIN_VALUE.
x += dx;
y += dy;
|
public abstract void | paint(javax.microedition.lcdui.Graphics g)Paints this Layer if it is visible. The upper-left corner of the Layer
is rendered at it's current (x,y) position relative to the origin of
the provided Graphics object. Applications may make use of Graphics
clipping and translation to control where the Layer is rendered and to
limit the region that is rendered.
Implementations of this method are responsible for checking if this
Layer is visible; this method does nothing if the Layer is not
visible.
The attributes of the Graphics object (clip region, translation,
drawing color, etc.) are not modified as a result of calling this
method.
|
void | setHeightImpl(int height)Sets the current height of this layer, in pixels. The Layer's height
is used to determine its bounds for rendering purposes.
if (height < 0) {
throw new IllegalArgumentException();
}
this.height = height;
|
public void | setPosition(int x, int y)Sets this Layer's position such that its upper-left corner
is located at (x,y) in the painter's coordinate system.
A Layer is located at (0,0) by default.
this.x = x;
this.y = y;
|
public void | setVisible(boolean visible)Sets the visibility of this Layer. A visible Layer is rendered when
its {@link #paint(Graphics)} method is called; an invisible Layer is
not rendered.
this.visible = visible;
|
void | setWidthImpl(int width)Sets the current width of this layer, in pixels. The Layer's width is
used to determine its bounds for rendering purposes.
if (width < 0) {
throw new IllegalArgumentException();
}
this.width = width;
|