public ContentObject changeTypeOfRegion(ContentObject region, RegionType newType) throws IllegalArgumentException {
		if (region == null || !(region.getType() instanceof RegionType))
			throw new IllegalArgumentException("Not a region: "+region.getType());
		
		if (region.getType().equals(newType))
			return region;
		
		ContentObject newRegion = contentFactory.createContent(newType);

		//Remove old region from layout
		RegionContainer parentRegion = null;
		if (region instanceof Region)
			parentRegion = ((Region)region).getParentRegion();
		if (parentRegion == null)
			removeRegion(region.getId());
		else
			((RegionContainer)parentRegion).removeRegion((Region)region);
		this.contentFactory.getIdRegister().unregisterId(region.getId());

		//Copy ID, outline, ...
		try {
			newRegion.setId(region.getId());
		} catch (InvalidIdException e) {
		}
		newRegion.setCoords(region.getCoords().clone());

		//Add new region to layout
		if (parentRegion == null || !(newRegion instanceof Region))
			regions.put(newRegion.getId(), (Region)newRegion);
		else
			parentRegion.addRegion((Region)newRegion);
		
		return newRegion;
	}