?? circleobj.java
字號:
package connex.plugins.whiteboard;
import java.awt.Graphics2D;
import java.awt.Color;
import java.awt.RenderingHints;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Point2D;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class CircleObj
extends ClosedShape {
public void draw() {
if (start == null || end == null) {
return;
}
g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
if (select != 0) {
drawSelection();
}
else {
g2D.setColor(drawColor);
g2D.drawOval(x1, y1, x2 - x1, y2 - y1);
}
if (fillColor != null) {
fill(fillColor);
}
}
protected void shapeSelection() {
g2D.setColor(Color.gray);
g2D.drawOval(x1, y1, x2 - x1, y2 - y1);
}
public void fill(Color color) {
fillColor = color;
if (lastS != null && lastE != null) {
if (lastE.equals(end) && lastS.equals(start)) {
g2D.setColor(fillColor);
setBounds(this.start, this.end);
g2D.fillOval(x1 + 1, y1 + 1, x2 - x1 - 1, y2 - y1 - 1);
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -