forked from lcdproc/lcdjava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVBarWidget.java
More file actions
63 lines (57 loc) · 1.52 KB
/
Copy pathVBarWidget.java
File metadata and controls
63 lines (57 loc) · 1.52 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
package org.lcdproc.lcdjava;
/**
* Vertical Bar Widget.
* <p>Displays a Vertical Bar on the LCD display.
* <p>Copyright (c) 2004-2005 Darren Greaves.
* @author Darren Greaves
* @version $Id: VBarWidget.java,v 1.2 2005-03-03 14:13:16 boncey Exp $
*/
public class VBarWidget extends BarWidget
{
/**
* Version details.
*/
public static final String CVSID =
"$Id: VBarWidget.java,v 1.2 2005-03-03 14:13:16 boncey Exp $";
/**
* Constructor.
* @param id the of the Widget.
* @param screen the Screen that knows about this Widget.
*/
protected VBarWidget(int id, Screen screen)
{
super(id, screen);
}
/**
* Get the Widget type.
* @return the Widget type.
*/
public String getType()
{
return Widget.WIDGET_VBAR;
}
/**
* Construct a new VBarWidget.
* @param screen the Screen that owns the Widget.
* @param x the x position.
* @param y the y position.
* @param length the widget length.
* @return a new VBarWidget.
*/
public static VBarWidget construct(Screen screen, int x, int y, int length)
{
VBarWidget widget = null;
try
{
widget = (VBarWidget)screen.constructWidget(Widget.WIDGET_VBAR);
widget.setX(x);
widget.setY(y);
widget.setLength(length);
}
catch (LCDException e)
{
// Supress, would only get one if we asked for an invalid Widget.
}
return widget;
}
}