@SuppressWarnings("static-access")
	public void scan(final int index)
	{
		if (frame.isScanning())
		{
			JOptionPane.showMessageDialog(null, "Can't interrupt scanning atm, fix soon etc");
			return;
		}
		frame.setCanceled(false);
		frame.setScanStatus(true);
		
		partitionTrees[index].buildTree();
		
		//Creates a thread to run in the background until the tree is fully generated at which point the scan status is set to false
		Thread checkScan = new Thread(new Runnable(){
			
			@Override
			public void run() {
				while(!partitionTrees[index].isBuilt()){					
					frame.repaint();								
				}			
				frame.setScanStatus(false);				
			}		
		});
		
		checkScan.start();	
	}