📄 line.java
字号:
public class Line extends GraphicObject {
/**
* specific attributes that Line needs
*/
private Point origin;
private Point end;
Line(){
super();
origin = new Point(0,0);
end = new Point(0,1);
}
Line(Point first,Point last, String color ){
super(color,"null");
origin = first;
end = last;
}
@Override
public void draw() {
// TODO Auto-generated method stub
System.out.println("Draw the origin of the line is ("+origin.getX()+","+origin.getY()+").The end is(" +
end.getX()+","+end.getY()+").color of the line is "+super.getColorOfLine());
}
@Override
public void rotate() {
// TODO Auto-generated method stub
System.out.println("rotate this line");
end.setNewPoint(2*origin.getX()-end.getX(),end.getY() );
draw();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -