-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomWidget.java
More file actions
22 lines (16 loc) · 879 Bytes
/
CustomWidget.java
File metadata and controls
22 lines (16 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
public class CustomWidget {
// These are status codes returned to a client.
public static final int S_EVENT_NOT_CONSUMED = 0; // event not processed
public static final int S_DONT_REDRAW = 1; // event was processed, and no need to redraw
public static final int S_REDRAW = 2; // event was processed, and please redraw
protected boolean isVisible = false;
public boolean isVisible() { return isVisible; }
public void setVisible( boolean flag ) { isVisible = flag; }
public boolean isMouseOverWidget() { return false; }
// Each of these returns a status code.
public int pressEvent( int x, int y ) { return S_DONT_REDRAW; }
public int releaseEvent( int x, int y ) { return S_DONT_REDRAW; }
public int moveEvent( int x, int y ) { return S_DONT_REDRAW; }
public int dragEvent( int x, int y ) { return S_DONT_REDRAW; }
public void draw( GraphicsWrapper gw ) { }
}