You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.4 KiB

package com.example.jmacro.wjdr.base;
/**
* 屏幕区域
*/
public class ScreenRect {
private int left;
private int top;
private int right;
private int bottom;
public ScreenRect() {
}
public ScreenRect(int left, int top, int right, int bottom) {
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}
public int getLeft() {
return left;
}
public void setLeft(int left) {
this.left = left;
}
public int getTop() {
return top;
}
public void setTop(int top) {
this.top = top;
}
public int getRight() {
return right;
}
public void setRight(int right) {
this.right = right;
}
public int getBottom() {
return bottom;
}
public void setBottom(int bottom) {
this.bottom = bottom;
}
public int getWidth() {
return this.right - this.left;
}
public int getHeight() {
return this.bottom - this.top;
}
public int[] getCenter() {
return new int[]{(left + right) / 2, (top + bottom) / 2};
}
@Override
public String toString() {
return "ScreenRect{" +
"left=" + left +
", top=" + top +
", right=" + right +
", bottom=" + bottom +
'}';
}
}

Powered by TurnKey Linux.