public void paintComponent(Graphics g) {
			Graphics2D g2d = (Graphics2D)g;
			//Rectangle treeSelectionBox = null;

			if (mouseDrag) {
				g2d.setColor(Color.white);
				g2d.fill(prevRect);
			}
			
			int boxWidth = (int)(getWidth()/(double)cols);
			int boxHeight = (int)(getHeight()/(double)rows);
			boundsRect.width = boxWidth;
			boundsRect.height = boxHeight;
			if (currentTrees == null) 
				return;
			
			if ((retracting || advancing) && rows ==1) { //We're in the middle of an advancing move, so ignore selection, etc..
				if (elapsedTime==0) {
					startTime = System.currentTimeMillis();
					elapsedTime = 1;
				}
				else
					elapsedTime = System.currentTimeMillis()-startTime;
				
				double fraction = (double)(elapsedTime)/(double)moveTime; 
				double fsquared = 0.5*fraction*fraction;
				advanceOffset = fsquared*fsquared/(0.06 + fsquared*fsquared);
				
				//System.out.println(fraction + ", " + advanceOffset);
				
				if (advanceOffset>1)
					advanceOffset = 1;
				
				boundsRect.y = 0;
 
				int x;
				if (advancing)
					x = (int)(boxWidth*(1-advanceOffset)-boxWidth);
				else 
					x = (int)(-boxWidth+advanceOffset*boxWidth );
				g2d.drawImage(treeImage, x, 0, null);
				
			}
			else { 
				//Dont draw with antialiasing unless we're in normal (non-advancing or retracting) mode
				g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
		                RenderingHints.VALUE_ANTIALIAS_ON);
				
				paintTrees(g2d, 0, 0, getWidth(), getHeight());
			}//Not advancing or retracting, just draw trees normally			

			if (mouseDrag) {
				g2d.setColor(highlightSquareColor);
				g2d.fill(selectRect);
				g2d.setColor(Color.DARK_GRAY);
				g2d.drawRect(selectRect.x, selectRect.y, selectRect.width-1, selectRect.height-1);
				prevRect.x = selectRect.x;
				prevRect.y = selectRect.y;
				prevRect.width = selectRect.width;
				prevRect.height = selectRect.height;
			}

	}