?? bar.java
字號(hào):
import java.awt.*;
//Download by http://www.codefans.net
//畫豎型方格的Bar類繼承Squareshape類
class Bar extends SquareShape
{
private Color barColor=new Color(120,107,223);//藍(lán),設(shè)置顏色為藍(lán)色
public Bar()//構(gòu)造函數(shù)
{
super();//初始化基類的屬性
this.color=barColor;
}
//默認(rèn)是各個(gè)方格的位置
protected void defaultRotate()
{
for(int i=0;i<4;i++)
{
position[i][0]=xpos;
position[i][1]=ypos+i*20;
}
}
//第一次旋轉(zhuǎn)后各方格的位置
protected void firstRotate()
{
for(int i=0;i<4;i++)
{
position[i][0]=xpos+i*20;
position[i][1]=ypos;
}
}
//第二次旋轉(zhuǎn)后各方格的位置
protected void secondRotate()
{
this.defaultRotate();
}
//第三次旋轉(zhuǎn)后各方格的位置
protected void thirdRotate()
{
this.firstRotate();
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -