public boolean checkNeighbors(mxGraph graph, Object edge, Object source,
			Object target)
	{
		mxIGraphModel model = graph.getModel();
		Object sourceValue = model.getValue(source);
		Object targetValue = model.getValue(target);
		boolean isValid = !validNeighborsAllowed;
		Iterator<String> it = validNeighbors.iterator();

		while (it.hasNext())
		{
			String tmp = it.next();

			if (this.source && checkType(graph, targetValue, tmp))
			{
				isValid = validNeighborsAllowed;
				break;
			}
			else if (!this.source && checkType(graph, sourceValue, tmp))
			{
				isValid = validNeighborsAllowed;
				break;
			}
		}

		return isValid;
	}