public void drawTapeHead(Graphics g)
	{ 
		int x = table.getX();
		int y = table.getY();
		
		boolean drawState = true;
		
		int tableTapeHeadColIndex = gui.getSimulator().getTape().getTapeHeadColumnIndex()-tapeBeginColumnIndex;
		int tableTapeHeadRowIndex = gui.getSimulator().getTape().getTapeHeadRowIndex()-tapeBeginRowIndex;
		
		if(!((tableTapeHeadColIndex<0||tableTapeHeadColIndex>=COLUMNS_TO_DISPLAY)||(tableTapeHeadRowIndex<0||tableTapeHeadRowIndex>=ROWS_TO_DISPLAY)))
		{
			TableColumn tapeHeadColumn = table.getColumnModel().getColumn(tableTapeHeadColIndex);
			
			int tableTapeHeadRowHeight = table.getRowHeight(tableTapeHeadRowIndex);
			
			for(int i=0;i<tableTapeHeadColIndex;i++)
			{
				x+=table.getColumnModel().getColumn(i).getWidth();
			}
			for(int i=0;i<tableTapeHeadRowIndex;i++)
			{
				y+=table.getRowHeight(i);
			}
			
			g.setColor(GUI.TAPE_HEAD_COLOR);
			
			//Draw the tape head cell highlight.
			for(int i=0;i<GUI.TAPE_FONT.getSize()/8;i++)
			{
				g.drawRect(x+i, y+i, tapeHeadColumn.getWidth()-(i*2+2), GUI.TAPE_FONT.getSize()*2-(i*2+1));
			}
			
			if(drawState)
			{
				String stateString = ""+gui.getSimulator().getCurrentState();
				Font TAPE_HEAD_SUBSCRIPT_FONT = new Font(GUI.TAPE_HEAD_FONT.getFamily(),GUI.TAPE_HEAD_FONT.getStyle(),(GUI.TAPE_HEAD_FONT.getSize()*3)/4);
				
				int tapeHeadHorizontalInset = GUI.TAPE_HEAD_FONT.getSize()*2/5;
				int tapeHeadVerticalInset = GUI.TAPE_HEAD_FONT.getSize()*3/5;
					int tapeHeadVerticalSubscriptInset = tapeHeadVerticalInset*3/4;
				int tapeHeadSWidth = GUI.TAPE_HEAD_FONT.getSize()*3/5;
				int tapeHeadTextSpacing = GUI.TAPE_HEAD_FONT.getSize()*1/5; 
				int tapeHeadStateWidth = TAPE_HEAD_SUBSCRIPT_FONT.getSize()*3/5*stateString.length();
				int tapeHeadWidth = tapeHeadHorizontalInset+tapeHeadSWidth+tapeHeadTextSpacing+tapeHeadStateWidth+tapeHeadHorizontalInset;
					if(tapeHeadWidth%2!=0)
					{
						tapeHeadWidth+=1;
					}
				int tapeHeadHeight = TAPE_HEAD_SUBSCRIPT_FONT.getSize()*3;
				int tapeHeadX = (x+tapeHeadColumn.getWidth()/2)-tapeHeadWidth/2;
				int tapeHeadY = y+tableTapeHeadRowHeight;
				int tapeHeadPointHeight = TAPE_HEAD_SUBSCRIPT_FONT.getSize();
				//Fill the rectangle containing the text:
				g.fillRect(tapeHeadX, tapeHeadY+tapeHeadPointHeight, tapeHeadWidth, tapeHeadHeight-tapeHeadPointHeight);
				
				//Set the dimensions of the tape head point
				xPoints = new int[] {tapeHeadX,tapeHeadX+tapeHeadWidth/2,tapeHeadX+tapeHeadWidth};
				yPoints = new int[] {tapeHeadY+tapeHeadPointHeight,tapeHeadY,tapeHeadY+tapeHeadPointHeight};
				nPoints = 3;
				headArrow = new Polygon(xPoints,yPoints,nPoints);
			
				//Draw the tape head point:
				g.fillPolygon(headArrow);
				
				//Draw the text:
				g.setColor(GUI.TAPE_HEAD_FONT_COLOR);
				g.setFont(GUI.TAPE_HEAD_FONT);
				g.drawString("S", tapeHeadX+tapeHeadHorizontalInset, tapeHeadY+tapeHeadHeight-tapeHeadVerticalInset);
				g.setFont(TAPE_HEAD_SUBSCRIPT_FONT);
				g.drawString(stateString, tapeHeadX+tapeHeadHorizontalInset+tapeHeadSWidth+tapeHeadTextSpacing,tapeHeadY+tapeHeadHeight-tapeHeadVerticalSubscriptInset);
				//*/
			}
		}
	}