?? oval.java
字號:
import java.awt.*;
/**
*
* @author hysun
*/
public class Oval extends RectBoundedShape {
public Oval(Color c, Stroke s, int x, int y) {
super(c, s, x, y);
}
public Oval() {
super();
}
public void draw(Graphics2D g) {
g.setColor(color);
g.setStroke(stroke);
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;
}
g.drawOval(x, y, w, h);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -