|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.beanizer.jxosd.JXosd
Class to create an On Screen Display.
This class is a Java binding of the useful native XOSD library (http://www.ignavus.net/software.html).
As XOSD author explains:
"XOSD displays text on your screen, sounds simple right?
The difference is it is unmanaged and shaped,
so it appears transparent. This gives the effect of an On Screen Display, like your TV/VCR etc.".
Typical Usage:
libxosd.so and libjxosd.so must be in java.library.path or LD_LIBRARY_PATH.
A simple example
JXosd x = new JXosd(2); // creates 2 lines display
x.setPosition(JXosd.TOP); // vertical position
x.setTimeout(5); // 5 seconds of display time
x.setColor("MediumSpringGreen"); // see following notices
x.setFont("-misc-fixed-bold-r-normal--15-*-*-*-c-*-*-*"); // see following notices
x.setShadowOffset(1); // shadow offset in pixels
x.setShadowColor("gray"); // shadow color
x.showText(0, "This is a test string........"); // text to show on line 0
x.waitUntilNoDisplay(); // wait
x.destroy(); // finalize
You can also use showPercentage or showSlider.
NOTICE ABOUT COLOURS:
Colours string are those you can find in the rgb.txt file in your X11 distribution
NOTICE ABOUT FONTS:
Use xfontsel or xlsfont to get a list of fonts
Field Summary | |
static int |
BOTTOM
|
static int |
CENTER
|
static int |
FAILURE
|
static int |
HIDDEN
|
static int |
LEFT
|
static int |
MIDDLE
|
static int |
RIGHT
|
static int |
SHOWN
|
static int |
SUCCESS
|
static int |
TOP
|
Constructor Summary | |
JXosd(int lines)
Constructor for the JXosd object |
Method Summary | |
int |
destroy()
Destroys the native object |
int |
getNumberLines()
Gets the number of lines of the display |
int |
hide()
Hides the display |
int |
isOnScreen()
Gets the onScreen status of the display |
int |
scroll(int lines)
Scrolls th display a given number of lines |
int |
setAlign(int pos)
Sets the horizontal alignment of the display |
void |
setBarLength(int length)
Sets the bar length(for percentage or slider) |
int |
setColor(java.lang.String color)
Sets the foreground color |
int |
setFont(java.lang.String font)
Sets the font |
int |
setHorizontalOffset(int offset)
Sets the horizontal offset |
int |
setOutlineColor(java.lang.String color)
Sets the outline color |
int |
setOutlineOffset(int offset)
Sets the outline offset |
int |
setPosition(int pos)
Sets the vertical position of the display |
int |
setShadowColor(java.lang.String color)
Sets the shadow color |
int |
setShadowOffset(int offset)
Sets the shadow offset |
void |
setTimeout(int timeout)
Sets the nymber of seconds before the display is hidden |
int |
setVerticalOffset(int offset)
Sets the vertical offset |
int |
show()
Makes the display visible. |
int |
showPercentage(int line,
int value)
Description of the Method |
int |
showSlider(int line,
int value)
Description of the Method |
int |
showText(int line,
java.lang.String text)
Show given text |
int |
waitUntilNoDisplay()
Waits until display is empty |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SUCCESS
public static final int FAILURE
public static final int HIDDEN
public static final int SHOWN
public static final int TOP
public static final int BOTTOM
public static final int MIDDLE
public static final int LEFT
public static final int CENTER
public static final int RIGHT
Constructor Detail |
public JXosd(int lines)
lines
- Number of lines for the displayMethod Detail |
public int destroy()
public int show()
public int hide()
public int getNumberLines()
public int isOnScreen()
public int waitUntilNoDisplay()
public void setTimeout(int timeout)
timeout
- number of secondspublic int setPosition(int pos)
pos
- TOP, BOTTOM, MIDDLE
public int setAlign(int pos)
pos
- LEFT, CENTER or RIGHT
public void setBarLength(int length)
length
- length in pixelspublic int setColor(java.lang.String color)
color
- The new color
public int setFont(java.lang.String font)
font
- The new font
public int setOutlineColor(java.lang.String color)
color
- The new outline color
public int setOutlineOffset(int offset)
offset
- The new outline offset
public int setShadowColor(java.lang.String color)
color
- The new shadow color
public int setShadowOffset(int offset)
offset
- The new shadow offset
public int setHorizontalOffset(int offset)
offset
- The new horizontal offset value
public int setVerticalOffset(int offset)
offset
- The new vertical offset
public int showText(int line, java.lang.String text)
line
- Line of the display where to show texttext
- Text string
public int showPercentage(int line, int value)
line
- Line of the display where to show the percentage barvalue
- Value to show
public int showSlider(int line, int value)
line
- Line of the display where to show the slidervalue
- Value to show
public int scroll(int lines)
lines
- Bunber of lines to scroll
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |