FileDocCategorySizeDatePackage
RepaintEvent.javaAPI DocphoneME MR2 API (J2ME)3310Wed May 02 18:00:24 BST 2007com.sun.midp.lcdui

RepaintEvent

public class RepaintEvent extends com.sun.midp.events.Event
An subclass for events of REPAINT_EVENT type. These events are generated by LCDUI for its own purposes.

Fields Summary
int
paintX1
X1 for the paint event.
int
paintY1
Y1 for the paint event.
int
paintX2
X2 for the paint event.
int
paintY2
Y2 for the paint event.
Object
paintTarget
Target for the paint event.
int
perUseID
Per use ID for tracking events in serviceRepaints.
DisplayEventConsumer
display
Target display of the event.
Constructors Summary
private RepaintEvent(int type)
Construct an event that has no parameters.

param
type event ID type

        super(type);
    
Methods Summary
static com.sun.midp.lcdui.RepaintEventcreateRepaintEvent(DisplayEventConsumer d, int x, int y, int w, int h, java.lang.Object target)
Create a repaint event.

param
d The Display
param
x The x origin coordinate
param
y The y origin coordinate
param
w The width
param
h The height
param
target The optional paint target
return
initialized event

        RepaintEvent e = new RepaintEvent(EventTypes.REPAINT_EVENT);
        e.setRepaintFields(d, x, y, w, h, target);
        return e;
    
voidsetRepaintFields(DisplayEventConsumer d, int x, int y, int w, int h, java.lang.Object target)
Set the fields of a repaint event.

param
d The Display
param
x The x origin coordinate
param
y The y origin coordinate
param
w The width
param
h The height
param
target The optional paint target

        display = d;

        w += x; // convert from width, height to absolute
        h += y; //  x2, y2

        if (x < 0) {
            x = 0;
        }

        if (y < 0) {
            y = 0;
        }

        paintX1 = x;
        paintY1 = y;
        paintX2 = w;
        paintY2 = h;
        paintTarget = target;