public void draw(Graphics2D g2){
		sortStateLock.lock();
		try{
			int deltaY = component.getHeight()/values.length;
			for(int i=0; i < values.length; i++){
				if(i<=rangeTo  && i>=rangeFrom){ //highlight partition range
					g2.setColor(Color.BLUE);
					if(i==pivotPos)  			//highlight pivot
						g2.setColor(Color.RED);
					if(i==markedPos1 || i==markedPos2) //highlight element to the left and right of pivot being compared
						g2.setColor(Color.CYAN);
				}
				else{
					g2.setColor(Color.BLACK);
				}
				g2.setStroke(new BasicStroke(4));
				g2.draw(new Line2D.Double(0, i*deltaY, values[i], i*deltaY));
					
			}
		}
		finally{
			sortStateLock.unlock();
		}
		
	}