Face.java
// Responsible for drawing of the face
Responsible for drawing of the face
Responsible for drawing of the face
public void toGraphic(Graphics g){
		if(smilingStatus == 0){
			g.setColor(Color.GREEN);
			g.fillOval(positionX, positionY, width, height);
			g.setColor(Color.BLACK);
			g.drawArc((positionX + (width/4)), positionY + (height / 4), width/2, height/2, 220, 100);
		}
		else if(smilingStatus == 1){
			g.setColor(Color.YELLOW);
			g.fillOval(positionX, positionY, width, height);
			g.setColor(Color.BLACK);
			g.drawLine(positionX + (width / 4), positionY + (3 * (height / 4)), positionX + (3 * (width / 4)), positionY + (3 * (height / 4)));
		}
		else if(smilingStatus == 2){
			g.setColor(Color.RED);
			g.fillOval(positionX, positionY, width, height);
			g.setColor(Color.BLACK);
			g.drawArc(positionX + (width / 4), positionY + (3 * (height / 4)), width / 2, height / 2, 40, 100);
		}
		g.drawOval(positionX, positionY, width, height);
		g.drawOval((positionX + (width/4)) - ((width/6)/2), (positionY + (height/4)) - ((height/6)/2), width/6, height/6);
		g.drawOval((positionX + (width/4)) - ((width/6)/2) + width/2, (positionY + (height/4)) - ((height/6)/2), width/6, height/6);
	}
public void toGraphic ( Graphics g ) { if ( smilingStatus == 0 ) { g . setColor ( Color . GREEN ) ; g . fillOval ( positionX , positionY , width , height ) ; g . setColor ( Color . BLACK ) ; g . drawArc ( ( positionX + ( width / 4 ) ) , positionY + ( height / 4 ) , width / 2 , height / 2 , 220 , 100 ) ; } else if ( smilingStatus == 1 ) { g . setColor ( Color . YELLOW ) ; g . fillOval ( positionX , positionY , width , height ) ; g . setColor ( Color . BLACK ) ; g . drawLine ( positionX + ( width / 4 ) , positionY + ( 3 * ( height / 4 ) ) , positionX + ( 3 * ( width / 4 ) ) , positionY + ( 3 * ( height / 4 ) ) ) ; } else if ( smilingStatus == 2 ) { g . setColor ( Color . RED ) ; g . fillOval ( positionX , positionY , width , height ) ; g . setColor ( Color . BLACK ) ; g . drawArc ( positionX + ( width / 4 ) , positionY + ( 3 * ( height / 4 ) ) , width / 2 , height / 2 , 40 , 100 ) ; } g . drawOval ( positionX , positionY , width , height ) ; g . drawOval ( ( positionX + ( width / 4 ) ) - ( ( width / 6 ) / 2 ) , ( positionY + ( height / 4 ) ) - ( ( height / 6 ) / 2 ) , width / 6 , height / 6 ) ; g . drawOval ( ( positionX + ( width / 4 ) ) - ( ( width / 6 ) / 2 ) + width / 2 , ( positionY + ( height / 4 ) ) - ( ( height / 6 ) / 2 ) , width / 6 , height / 6 ) ; }
Responsible for drawing of the face
Responsible for drawing of the face
// The following if statements determine the expression // Sets the face to green and draw a happy expression // Sets the face to yellow and draws a blank expression // Sets the face to red and draws a mad expression // Draws the eyes and the actual face