public class Application
extends java.lang.Object
Used to open, focus and close external applications as
well as click on any of its points. Usually only used
through ApplicationHandler.
| Modifier and Type | Field and Description |
|---|---|
private int |
id
Window id for this Application.
|
private java.lang.String |
name
Name of the bin that is executed and name in titlebar of window that is used in windowSearch.
|
private java.util.ArrayList<NamedPoint> |
points
Points specified for this Application in the config file.
|
private java.lang.Process |
proc
This Application's Process.
|
| Constructor and Description |
|---|
Application(java.lang.String name,
java.util.ArrayList<NamedPoint> points)
Object for manipulating external applications.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the application.
|
void |
focus()
Focuses and raises the application.
|
int |
getId()
Gets the window id of this application.
|
private int |
getInitId()
Retrieves the window id of this application just after it has been initially started.
|
java.awt.Point |
getPoint(int i)
Gets the point at index
i. |
java.awt.Point |
getPoint(java.lang.String name)
Gets the point with name
name. |
private void |
setWindowFocus(int id)
Sets the currently focused application to id.
|
private void |
start()
Starts the Application.
|
private int |
windowSearch(java.lang.String search)
Search for a window with
search in its title. |
private int id
private java.lang.String name
private java.util.ArrayList<NamedPoint> points
private java.lang.Process proc
Processpublic Application(java.lang.String name,
java.util.ArrayList<NamedPoint> points)
Used to open, focus and close external applications as
well as click on any of its points. Usually only used
through ApplicationHandler.
Calls start() and getInitId()
name - The name of the bin that is executed and the string that is used to search for the window.points - The list of points that can be clicked on.ApplicationHandlerprivate int windowSearch(java.lang.String search)
search in its title.
Native method to return the window id of
a window that has the String search
in its title.
search - The string to search for.private void setWindowFocus(int id)
Sets the currently focused application to
the window that has id id.
id - The id of the window to focus.private void start()
Starts the Application by
executing the binary located at: "/usr/bin/"
with the name name.
public void close()
Closes the Application by destroying its process.
public void focus()
private int getInitId()
Searches for it every second until it is found.
public int getId()
public java.awt.Point getPoint(int i)
i.i - The index to get.i.public java.awt.Point getPoint(java.lang.String name)
name.name - The name to search for.name or null if none is found.