private void drawItem(Graphics2D g2D, ScheduleItem item, Color boxColor, 
				Color fontColor) {
			int y;
			int h = 0; //controls the height to draw the gridlet
			PERangeList gridletPERanges = item.getPERangeList();
			gridletPERanges.sortRanges();
				
			int firstX, firstY;
			int width, height;
			int textX, textY;
			int textHeight, textWidth;
				
			// gets the time duration of the gridlet
			double duration = item.getActualFinishTime() - item.getStartTime(); 
				
			width = (int) (duration * scaleX_);
			firstX = SHIFT_X + (int) (item.getStartTime() * scaleX_);
				
			String boxText;
			LineMetrics lineMetrics;
				
			Font font = g2D.getFont().deriveFont(10f);
		    g2D.setFont(font);
		    FontRenderContext frc = g2D.getFontRenderContext();
		        
		    // A gridlet can have the nodes 0-2, 5-7, etc. 
		    // So it must be painted in parts
		    for(PERange range : gridletPERanges){
	       	    y = range.getEnd();
	       	    h = range.getNumPE();
		        
				firstY = SHIFT_Y + (int) ((numPE - (y + 1)) * scaleY_);
				height = (int) ((h) * scaleY_);
	
				// if it is a gridlet that reserved resources, then make it
				// transparent to show the advance reservation as well
				boolean reservedGridlet = !item.isAdvanceReservation() && item.hasReserved();
				Composite previousComposite = null;
				if(reservedGridlet) {
					previousComposite = g2D.getComposite();
					g2D.setComposite(transpComp);
				}
	
				g2D.setColor(boxColor);
				if(!reservedGridlet)
					g2D.fillRect(firstX, firstY, width, height);
	
				g2D.setColor(Color.black);
				g2D.drawRect(firstX, firstY, width, height);
	
				//draw the label in the center of the box
				boxText = new Integer(item.getID()).toString();
		        textWidth = (int)font.getStringBounds(boxText, frc).getWidth();
		        lineMetrics = font.getLineMetrics(boxText, frc);
		        textHeight = (int)(lineMetrics.getAscent() + lineMetrics.getDescent());
	
		        textX = firstX + (width - textWidth)/2;
		        textY = (int)(firstY + (height + textHeight)/2 - lineMetrics.getDescent());
	
		        g2D.setColor(fontColor);
		        if(drawID_){
		        	g2D.drawString(boxText, textX, textY);
		        }
		        
				if(reservedGridlet) {
					g2D.setComposite(previousComposite);
				}
			}
		}