|
||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjp.hishidama.robot.WindowsRobot
public class WindowsRobot
MS-Windowsウィンドウ自動実行クラス.
MS-Windowsのウィンドウを操作するユーティリティークラス。
→使用例
フィールドの概要 |
---|
コンストラクタの概要 | |
---|---|
WindowsRobot()
|
メソッドの概要 | |
---|---|
void |
delay(int time)
指定時間待機. |
JWnd |
findWindow(String title,
int time,
int count)
ウィンドウ探索. |
int |
getAutoDelay()
待機時間取得. |
Rectangle |
getBounds()
ウィンドウ範囲取得. |
JWnd |
getJWnd()
操作対象ウィンドウ取得. |
String |
getTitle()
ウィンドウタイトル取得. |
boolean |
isTarget(JWnd wnd,
String title)
タイトル確認. |
void |
setAutoDelay(int ms)
待機時間設定. |
boolean |
setBounds(int x,
int y,
int cx,
int cy)
範囲設定. |
boolean |
setForegroundWindow()
最前面移動. |
void |
setJWnd(JWnd wnd)
操作対象ウィンドウ設定. |
boolean |
setLocation(int x,
int y)
位置設定. |
boolean |
setSize(int cx,
int cy)
サイズ設定. |
boolean |
waitForTitle(String title,
int time,
int count)
タイトル変更待ち. |
クラス java.lang.Object から継承されたメソッド |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
---|
public WindowsRobot()
メソッドの詳細 |
---|
public void delay(int time)
time
- ウェイト[ミリ秒]public JWnd findWindow(String title, int time, int count)
タイトルの一部が一致するウィンドウを探す。
見つからない場合、指定された時間だけスリープし、再度探索する。
指定された回数だけリトライする。
title
- タイトルtime
- スリープ時間[ミリ秒]count
- リトライ回数
public void setJWnd(JWnd wnd)
wnd
- JWndpublic JWnd getJWnd()
public void setAutoDelay(int ms)
時間のかかるウィンドウ操作を呼び出す各メソッドでは、処理完了時にウェイトする。
その時間を当メソッドで設定する。
ms
- ウェイト[ミリ秒]public int getAutoDelay()
public boolean waitForTitle(String title, int time, int count)
ウィンドウのタイトルの一部が一致するまで待つ。
IEやテキストエディタ等の、ウィンドウのタイトルが変わる場合に それを待つ際に使うことを想定している。
指定された時間だけスリープしつつ、指定された回数だけリトライする。
title
- タイトルtime
- スリープ時間[ミリ秒]count
- リトライ回数
public boolean isTarget(JWnd wnd, String title)
ウィンドウのタイトルに 指定された文字列が含まれていればtrueを返す。
wnd
- ウィンドウtitle
- 文字列
public String getTitle()
public boolean setForegroundWindow()
ウィンドウを最前面に移動させる。
ウィンドウがアイコン化(最小化)していた場合は、以前の大きさに戻す。
setAutoDelay(int)
public boolean setLocation(int x, int y)
x
- y
-
setBounds(int, int, int, int)
,
setAutoDelay(int)
public boolean setSize(int cx, int cy)
cx
- cy
-
setBounds(int, int, int, int)
,
setAutoDelay(int)
public boolean setBounds(int x, int y, int cx, int cy)
x
- y
- cx
- cy
-
setAutoDelay(int)
public Rectangle getBounds()
|
||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |