graphicobject.java

来自「第四次作业 1、 创建一个Animal(动物)类」· Java 代码 · 共 43 行

JAVA
43
字号
/**
 * 
 * @author 07301048
 * base class GraphicObject ,which contains abstract method that should be implemented 
 *in derived class
 */
public abstract class GraphicObject {
	
	/**
	 * common attributes that all graphic have
	 */
	private String lineColor;
	private String fillColor;
	
	GraphicObject(){
	
		lineColor = "black";
		fillColor = "white";
	}
	
	GraphicObject(String lineColor, String fillColor){
		
		this.lineColor = lineColor;
		this.fillColor = fillColor;
		
	}
	public String getColorOfLine(){
		return lineColor;
	}
	
	public String getFillcolor(){
		return fillColor;
	}
	/**
	 * method rotate() rotate the graphic 90 degrees
	 * method draw() draw the shape of the graphic
	 */
	public abstract void rotate();
	public abstract void draw();
	

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?