📄 cutter.java
字号:
/*
* Created on 2005-4-6
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package bubbletea;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
/**
* @author roger
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class Cutter extends Shape{
void draw(Graphics2D g2d)
{
g2d.setPaint(new Color(0,0,0));
g2d.setStroke(new BasicStroke(1,
BasicStroke.CAP_ROUND,BasicStroke.JOIN_BEVEL));
int x = ((x1 - x2) >= 0)?x2:x1;
int y = ((y1 - y2) >= 0)?y2:y1;
g2d.drawRect(x,y,Math.abs(x2-x1),Math.abs(y2-y1));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -