public void setSelected(MoleculeComponent e)
	{
		
		System.out.println(">>>>>>>>> Set selected called for " + e);
		if (e == null) // If null, clear selection
		{
			if (selected != null) {
				if (selected.getClass() == Element.class) {
				elements.get(selected.getKey()).setSelected(false); // set the internal selection flag to true
				}
				else if (selected.getClass() == Bond.class) {
					bonds.get(selected.getKey()).setSelected(false); // set the internal selection flag to true
				}
				else if (selected.getClass() == Arrow.class) {
					arrows.get(selected.getKey()).setSelected(false);
				}
			}
			
			selected = null;
			return;
		}
		
		if (e.getClass() == Element.class) {
			selected = elements.get(e.getKey()); // set selected to the newest Element selected
			elements.get(selected.getKey()).setSelected(true); // set the internal selection flag to true
		}
		else if (e.getClass() == Bond.class) {
			selected = bonds.get(e.getKey());
			bonds.get(selected.getKey()).setSelected(true);
		}
		else if (e.getClass() == Arrow.class) {
			selected = arrows.get(e.getKey());
			arrows.get(selected.getKey()).setSelected(true);
		}
		
	}