public class JawGadget
extends java.lang.Object
Constructor and Description |
---|
JawGadget()
Creates a JawGadet instance and allocates native resources.
|
JawGadget(boolean changeCursor)
Creates a JawGadet instance and allocates native resources.
|
Modifier and Type | Method and Description |
---|---|
boolean |
activate()
Activates the Gadget's window.
|
boolean |
activate(java.lang.String windowTitle)
Activates window with given title.
|
void |
addNativeKeyListener(NativeKeyListener listener) |
void |
addNativeMouseListener(NativeMouseListener listener,
int mouseEventMask)
Registers the given listener, in order to get mouse events from the native window.
|
void |
addTrayIconListener(TrayIconListener listener)
Same as addTrayIconListener(listener, iconEventMask),
but only lRelease is registered.
|
void |
addTrayIconListener(TrayIconListener listener,
int iconEventMask)
Registers the given listener, in order to get mouse events when the mouse
cursor is inside the tray icon.
|
void |
destroy()
Closes the native window or tray icon and releases all native resources.
|
void |
enableMouseEvents(boolean enable)
Enables or disables the callbacks from mouse events.
|
java.lang.String |
enumWindows()
Returns an enumeration of non-empty titles of all current windows.
|
int |
getX()
Returns windows's upper left x-coordinate.
|
int |
getY()
Returns windows's upper left y-coordinate.
|
void |
hideIcon()
Hides the tray icon.
|
void |
hideImage()
Hides the image.
|
void |
setPosition(int ulx,
int uly)
Move the window to given position.
|
void |
showBalloonTooltip(java.lang.String title,
java.lang.String text)
Same as showBalloonTooltip(title, text, flag, timeout)
with flag = 0 and timeout = 2000.
|
void |
showBalloonTooltip(java.lang.String title,
java.lang.String text,
int flag)
Same as showBalloonTooltip(title, text, flag, timeout) with timeout = 2000.
|
void |
showBalloonTooltip(java.lang.String title,
java.lang.String text,
int flag,
int timeout)
Shows a ballon tool tip at the tray icon that contains the given title
and text for the given timeout time.
|
void |
showIcon(java.lang.String iconPath)
Same as showIcon(iconPath, tooltip), but no tool tip is shown.
|
void |
showIcon(java.lang.String iconPath,
java.lang.String tooltip)
Shows tray icon given by iconPath.
|
void |
showImage(java.lang.String imagePath,
int percent,
boolean isTopMost)
Same as showImage(imagePath, percent, isTopMost, int ulx, int uly), but uses the current position.
|
void |
showImage(java.lang.String imagePath,
int percent,
boolean isTopMost,
int ulx,
int uly)
Same as showImage(imagePath, percent, color, isTopMost, int ulx, int uly),
but white pixels will be transparent.
|
void |
showImage(java.lang.String imagePath,
int percent,
java.awt.Color color,
boolean isTopMost)
Same as showImage(imagePath, percent, color, isTopMost, ulx, uly), but uses the current position.
|
void |
showImage(java.lang.String imagePath,
int percent,
java.awt.Color color,
boolean isTopMost,
int ulx,
int uly)
Shows image given by imagePath at given upper left corner (ulx, uly)
with given opaque percentage (0..100) and given transparency color.
|
void |
sleep(int time)
Waits the given amount of time using Thread.currentThread.sleep().
|
void |
writeBMP(javax.swing.JComponent component,
java.io.File file)
Transforms the given component and stores it in a BMP image file.
|
void |
writeBMP(javax.swing.JComponent component,
java.lang.String pathname)
Same as writeMMP(component, file) with output pathname.
|
public JawGadget(boolean changeCursor)
destroy()
public JawGadget()
destroy()
public void showImage(java.lang.String imagePath, int percent, java.awt.Color color, boolean isTopMost, int ulx, int uly)
imagePath
- the filename of the image file. If drive:\dir is missing, the directory of the Java class file is assumedpercent
- the percentage of opacity in range 0..100color
- the RGB color of pixels, that will get transparentisTopMost
- sets the window to the topmost level in windows z-orderulx
- the x-coordinate of the window's upper left corneruly
- the y-coordinate of the window's upper left cornerpublic void showImage(java.lang.String imagePath, int percent, java.awt.Color color, boolean isTopMost)
imagePath
- the filename of the image file. If drive:\dir is missing, the directory of the Java class file is assumedpercent
- the percentage of opacity in range 0..100isTopMost
- sets the window to the topmost level in windows Z-ordercolor
- the RGB color of pixels, that will get transparentshowImage(String imagePath, int percent, Color color, boolean isTopMost, int ulx, int uly)
public void showImage(java.lang.String imagePath, int percent, boolean isTopMost, int ulx, int uly)
imagePath
- the filename of the image file. If drive:\dir is missing, the directory of the Java class file is assumedpercent
- the percentage of opacity in range 0..100isTopMost
- sets the window to the topmost level in windows Z-orderulx
- the x-coordinate of the window's upper left corneruly
- the y-coordinate of the window's upper left cornershowImage(String imagePath, int percent, Color color, boolean isTopMost, int ulx, int uly)
public void showImage(java.lang.String imagePath, int percent, boolean isTopMost)
imagePath
- the filename of the image file. If drive:\dir is missing, the directory of the Java class file is assumedpercent
- the percentage of opacity in range 0..100isTopMost
- sets the window to the topmost level in windows Z-ordershowImage(String imagePath, int percent, boolean isTopMost, int ulx, int uly)
public void hideImage()
destroy()
public void destroy()
public void addNativeMouseListener(NativeMouseListener listener, int mouseEventMask)
NativeMouse
,
NativeMouseListener
public void addNativeKeyListener(NativeKeyListener listener)
public void addTrayIconListener(TrayIconListener listener, int iconEventMask)
NativeMouse
,
TrayIcon
,
TrayIconListener
public void addTrayIconListener(TrayIconListener listener)
public void showIcon(java.lang.String iconPath, java.lang.String tooltip)
iconPath
- the filename of the icon file. If drive:\dir is missing, the directory of the Java class file is assumedtooltip
- the text to be displayed in the tool tip area. When empty, no tool tip is shownpublic void showIcon(java.lang.String iconPath)
iconPath
- the filename of the icon file. If drive:\dir is missing, the directory of the Java class file is assumedshowIcon(String iconPath, String tooltip)
public void hideIcon()
destroy()
public void showBalloonTooltip(java.lang.String title, java.lang.String text, int flag, int timeout)
title
- the title (up to 63 characters) shown bold in the tool tip. When empty, no title is showntext
- the text (up to 253 characters) to be displayed in the tool tip area. When empty, no text is shownflag
- an integer 0..3 selecting the type of a small icontimeout
- the time in milliseconds until the tool tip disappearspublic void showBalloonTooltip(java.lang.String title, java.lang.String text, int flag)
public void showBalloonTooltip(java.lang.String title, java.lang.String text)
public void sleep(int time)
time
- the time to wait (in milliseconds)public void writeBMP(javax.swing.JComponent component, java.io.File file)
component
- a packed Swing JComponentfile
- output filepublic void writeBMP(javax.swing.JComponent component, java.lang.String pathname)
component
- a packed Swing JComponentpathname
- the file path of the output file. If drive:\dir is missing, the directory of the Java class file is assumedpublic void enableMouseEvents(boolean enable)
enable
- if true, the mouse events are enabled, otherwise disabledpublic boolean activate()
public boolean activate(java.lang.String windowTitle)
windowTitle
- the text in the window's title bar.public int getX()
public int getY()
public java.lang.String enumWindows()
public void setPosition(int ulx, int uly)
ulx
- the x-coordinate of the window's upper left corneruly
- the y-coordinate of the window's upper left corner