add method

This commit is contained in:
Looly 2021-07-26 18:27:46 +08:00
parent d1861eb9db
commit 5bbb6539b3
2 changed files with 19 additions and 6 deletions

View File

@ -16,6 +16,7 @@
* 【core 】 NumberUtil增加calculate方法 * 【core 】 NumberUtil增加calculate方法
* 【core 】 优化TextSimilarity.longestCommonSubstring性能issue#I42A6V@Gitee * 【core 】 优化TextSimilarity.longestCommonSubstring性能issue#I42A6V@Gitee
* 【core 】 MultipartRequestInputStream改为使用long以支持大文件issue#I428AN@Gitee * 【core 】 MultipartRequestInputStream改为使用long以支持大文件issue#I428AN@Gitee
* 【core 】 RobotUtl增加getDelay、getRobot方法pr#1725@Github
### 🐞Bug修复 ### 🐞Bug修复
* 【core 】 修复RobotUtil双击右键问题pr#1721@Github * 【core 】 修复RobotUtil双击右键问题pr#1721@Github

View File

@ -1,5 +1,9 @@
package cn.hutool.core.swing; package cn.hutool.core.swing;
import cn.hutool.core.exceptions.UtilException;
import cn.hutool.core.img.ImgUtil;
import cn.hutool.core.swing.clipboard.ClipboardUtil;
import java.awt.AWTException; import java.awt.AWTException;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.Robot; import java.awt.Robot;
@ -8,10 +12,6 @@ import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import cn.hutool.core.exceptions.UtilException;
import cn.hutool.core.img.ImgUtil;
import cn.hutool.core.swing.clipboard.ClipboardUtil;
/** /**
* {@link Robot} 封装工具类提供截屏等工具 * {@link Robot} 封装工具类提供截屏等工具
* *
@ -32,12 +32,15 @@ public class RobotUtil {
} }
/** /**
* 获取 Robot 实例 * 获取 Robot 单例实例
*
* @return {@link Robot}单例对象
* @since 5.7.6
*/ */
public static Robot getRobot() { public static Robot getRobot() {
return ROBOT; return ROBOT;
} }
/** /**
* 设置默认的延迟时间<br> * 设置默认的延迟时间<br>
* 当按键执行完后的等待时间也可以用ThreadUtil.sleep方法代替 * 当按键执行完后的等待时间也可以用ThreadUtil.sleep方法代替
@ -49,6 +52,15 @@ public class RobotUtil {
delay = delayMillis; delay = delayMillis;
} }
/**
* 获取默认的延迟时间
*
* @since 5.7.6
*/
public static int getDelay() {
return delay;
}
/** /**
* 模拟鼠标移动 * 模拟鼠标移动
* *