📄 cliprect.java
字号:
import java.awt.*;
public class ClipRect extends RectBoundedShape {
public ClipRect(Color c, Stroke s, int x, int y) {
super(c, s, x, y);
}
public ClipRect() {
super();
}
public void draw(Graphics2D g) {
int x, y, w, h;
if (startX > endX) {
x = endX;
w = startX - endX;
} else {
x = startX;
w = endX - startX;
}
if (startY > endY) {
y = endY;
h = startY - endY;
} else {
y = startY;
h = endY - startY;
}
if(MenuEventClass.isClear==true){
g.setColor(Panel.drawCanvas.getBackground());
g.fillRect(x, y, w, h);
}
else{
g.setStroke(new BasicStroke(1.0f));
g.setColor(Color.BLUE);
g.drawRect(x, y, w, h);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -