Repository navigation
Expand file tree
/
Copy pathPositionalWidget.java
More file actions
81 lines (72 loc) · 1.51 KB
/
Copy pathPositionalWidget.java
File metadata and controls
81 lines (72 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package org.lcdproc.lcdjava;
/**
* Abstract Widget that deals with x and y dimensions.
* <p>Copyright (c) 2004-2005 Darren Greaves.
* @author Darren Greaves
* @version $Id: PositionalWidget.java,v 1.2 2005-03-03 14:13:16 boncey Exp $
*/
public abstract class PositionalWidget extends AbstractWidget
{
/**
* Version details.
*/
public static final String CVSID =
"$Id: PositionalWidget.java,v 1.2 2005-03-03 14:13:16 boncey Exp $";
/**
* The x position.
*/
private int _x = 1;
/**
* The y position.
*/
private int _y = 1;
/**
* Constructor.
* @param id the of the Widget.
* @param screen the Screen that knows about this Widget.
*/
protected PositionalWidget(int id, Screen screen)
{
super(id, screen);
}
/**
* Set the x position.
* @param x the x position.
*/
public void setX(int x)
{
_x = x;
}
/**
* Get the x position.
* @return the x position.
*/
public int getX()
{
return _x;
}
/**
* Set the y position.
* @param y the y position.
*/
public void setY(int y)
{
_y = y;
}
/**
* Get the y position.
* @return the y position.
*/
public int getY()
{
return _y;
}
/**
* Return the data this Widget needs to update itself.
* @return the data to update this Widget.
*/
public String getData()
{
return getX() + " " + getY() + " ";
}
}