📄 rect.java
字号:
/*
* Rect.java
*
* Created on 2007年4月23日, 下午11:57
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package paintbox;
/**
*
* @author fly
*/
import java.awt.*;
public class Rect extends BoundedShape{
/** Creates a new instance of Rect */
public Rect (Color color, Point corner, int wide, int high)
{
super (color, corner, wide, high);
}
public void draw (Graphics page)
{
if(filled){
page.setColor(fillColor);
page.fillRect(upperLeft.x, upperLeft.y, width, height);
}
page.setColor (strokeColor);
page.drawRect (upperLeft.x, upperLeft.y, width, height);
if(slected)
{
page.setColor(Color.BLACK);
page.fillOval(upperLeft.x-3,upperLeft.y-3,6,6);
page.fillOval(upperLeft.x+width-3,upperLeft.y-3,6,6);
page.fillOval(upperLeft.x+width-3,upperLeft.y+height-3,6,6);
page.fillOval(upperLeft.x-3,upperLeft.y+height-3,6,6);
}
}
public Object clone()
{
C c=new C();
return c.getRect();
}
private class C
{
public Rect rect;
public C()
{
Point point=new Point(upperLeft.x, upperLeft.y);
rect=new Rect(strokeColor,point,width, height);
if(filled)
rect.setFilled(fillColor);
}
public Rect getRect()
{
return rect;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -