private PrimitiveSite getCompatibleSiteFromTile(int row, int col,
			PrimitiveType type) {
		if ((row < 0) || (col < 0) || (row > rows - 1) || (col > cols - 1))
			return null;
		if (type == null)
			return null;
		PrimitiveSite[] sites = design.getDevice().getTile(row, col)
				.getPrimitiveSites();
		if (sites != null)
			for (PrimitiveSite priSite : sites) {
				if (priSite.isCompatiblePrimitiveType(type)) {
					if (design.getUsedPrimitiveSites().contains(priSite))
						continue;
					return priSite;
				}
			}
		return null;
	}