prj03-group06/src/weather/WindPanel.java
@Override
	public void paintComponent(final Graphics theGraphics) {
		super.paintComponent(theGraphics);
		final Graphics2D g2d = (Graphics2D)theGraphics;
		
		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                 RenderingHints.VALUE_ANTIALIAS_ON);
		g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
                 RenderingHints.VALUE_RENDER_QUALITY);
		g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
                 RenderingHints.VALUE_STROKE_PURE);
		
		if (drawColor == null) {
			g2d.setColor(Color.BLACK);
		} else {
			g2d.setColor(drawColor);
		}
		g2d.setStroke(myStroke);
		
		// only use 90% of the bounding rectangle in each dimension
		double innerDiam = getWidth()*0.9;
		
		// draw the background circle
		g2d.draw(new Ellipse2D.Double((getWidth()-innerDiam)/2, (getHeight()-innerDiam)/2, innerDiam, innerDiam));
		
		// draw the speed text string
		g2d.drawString(Integer.toString(speed) + " mph", getWidth()*(0.25f), getHeight()/2.0f);
		
		// draw the direction triangle
		g2d.translate(getWidth()/2.0, getHeight()/2.0);
		g2d.rotate(dir * Math.PI/180);
		g2d.fillPolygon(new int[] {-getWidth()/10, 0, getWidth()/10},
						new int[] {(int) (getHeight()*(-1)/2) , (int) (getHeight()*(-0.85)/2.0), (int) (getHeight()*(-1)/2)}, 3);
		g2d.rotate(dir * -Math.PI/180);
		g2d.translate(-getWidth()/2.0, -getHeight()/2.0);
		
		g2d.dispose();
	}
/**
	 * Paints the wind panel
	 * 
	 * @param theGraphics the graphics device onto which to paint the wind panel
	 */
Paints the wind panel

@param theGraphics the graphics device onto which to paint the wind panel
Paints the wind panel @param theGraphics the graphics device onto which to paint the wind panel
@Override
	public void paintComponent(final Graphics theGraphics) {
		super.paintComponent(theGraphics);
		final Graphics2D g2d = (Graphics2D)theGraphics;
		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                 RenderingHints.VALUE_ANTIALIAS_ON);
		g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
                 RenderingHints.VALUE_RENDER_QUALITY);
		g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
                 RenderingHints.VALUE_STROKE_PURE);
		if (drawColor == null) {
			g2d.setColor(Color.BLACK);
		} else {
			g2d.setColor(drawColor);
		}
		g2d.setStroke(myStroke);
		double innerDiam = getWidth()*0.9;
		g2d.draw(new Ellipse2D.Double((getWidth()-innerDiam)/2, (getHeight()-innerDiam)/2, innerDiam, innerDiam));
		g2d.drawString(Integer.toString(speed) + " mph", getWidth()*(0.25f), getHeight()/2.0f);
		g2d.translate(getWidth()/2.0, getHeight()/2.0);
		g2d.rotate(dir * Math.PI/180);
		g2d.fillPolygon(new int[] {-getWidth()/10, 0, getWidth()/10},
						new int[] {(int) (getHeight()*(-1)/2) , (int) (getHeight()*(-0.85)/2.0), (int) (getHeight()*(-1)/2)}, 3);
		g2d.rotate(dir * -Math.PI/180);
		g2d.translate(-getWidth()/2.0, -getHeight()/2.0);
		g2d.dispose();
	}
@ Override public void paintComponent ( final Graphics theGraphics ) { super . paintComponent ( theGraphics ) ; final Graphics2D g2d = ( Graphics2D ) theGraphics ; g2d . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; g2d . setRenderingHint ( RenderingHints . KEY_RENDERING , RenderingHints . VALUE_RENDER_QUALITY ) ; g2d . setRenderingHint ( RenderingHints . KEY_STROKE_CONTROL , RenderingHints . VALUE_STROKE_PURE ) ; if ( drawColor == null ) { g2d . setColor ( Color . BLACK ) ; } else { g2d . setColor ( drawColor ) ; } g2d . setStroke ( myStroke ) ; double innerDiam = getWidth ( ) * 0.9 ; g2d . draw ( new Ellipse2D . Double ( ( getWidth ( ) - innerDiam ) / 2 , ( getHeight ( ) - innerDiam ) / 2 , innerDiam , innerDiam ) ) ; g2d . drawString ( Integer . toString ( speed ) + " mph" , getWidth ( ) * ( 0.25f ) , getHeight ( ) / 2.0f ) ; g2d . translate ( getWidth ( ) / 2.0 , getHeight ( ) / 2.0 ) ; g2d . rotate ( dir * Math . PI / 180 ) ; g2d . fillPolygon ( new int [ ] { - getWidth ( ) / 10 , 0 , getWidth ( ) / 10 } , new int [ ] { ( int ) ( getHeight ( ) * ( - 1 ) / 2 ) , ( int ) ( getHeight ( ) * ( - 0.85 ) / 2.0 ) , ( int ) ( getHeight ( ) * ( - 1 ) / 2 ) } , 3 ) ; g2d . rotate ( dir * - Math . PI / 180 ) ; g2d . translate ( - getWidth ( ) / 2.0 , - getHeight ( ) / 2.0 ) ; g2d . dispose ( ) ; }
Paints the wind panel
Paints the wind panel
// only use 90% of the bounding rectangle in each dimension // draw the background circle // draw the speed text string // draw the direction triangle