public Integer costFrom(Node from, ElementPanel panel, Point target) {
		for (Component c : panel.getElements())
			if (c.intersects(p, from.p))
				return null;
		if (panel.getHvLines() != null && Node.dist(p, from.p) > 20)
			for (HVLine hvl : panel.getHvLines())
				if (hvl.contains(p, from.p))
					return null;

		int vDist = Math.abs(p.y - from.p.y);
		int hDist = Math.abs(p.x - from.p.x);

		int turn = from.getTurn();

		if (isTurn(from))
			turn++;

		int tDist = turn * dist(p, target);

		return vDist + hDist + tDist;
	}