?? oval.java
字號:
/*
* Oval.java
*
* Created on 2007年4月23日, 下午11:58
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package paintbox;
/**
*
* @author fly
*/
import java.awt.*;
public class Oval extends BoundedShape{
/** Creates a new instance of Oval */
public Oval (Color color, Point corner, int wide, int high)
{
super (color, corner, wide, high);
}
public void draw (Graphics page)
{
if(filled){
page.setColor(fillColor);
page.fillOval(upperLeft.x, upperLeft.y, width, height);
}
page.setColor (strokeColor);
page.drawOval (upperLeft.x, upperLeft.y, width, height);
if(slected)
{
page.setColor(Color.BLACK);
page.fillOval(upperLeft.x-3,upperLeft.y+height/2-3,6,6);
page.fillOval(upperLeft.x+width-3,upperLeft.y+height/2-3,6,6);
page.fillOval(upperLeft.x+width/2-3,upperLeft.y+height-3,6,6);
page.fillOval(upperLeft.x+width/2-3,upperLeft.y-3,6,6);
}
}
public Object clone()
{
B b=new B();
return b.getOval();
}
private class B
{
public Oval oval;
public B()
{
Point point=new Point(upperLeft.x, upperLeft.y);
oval=new Oval(strokeColor,point,width, height);
if(filled)
oval.setFilled(fillColor);
}
public Oval getOval()
{
return oval;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -