protected void layout(List<Object> parallels)
	{
		Object edge = parallels.get(0);
		mxIGraphModel model = graph.getModel();
		mxGeometry src = model.getGeometry(model.getTerminal(edge, true));
		mxGeometry trg = model.getGeometry(model.getTerminal(edge, false));

		// Routes multiple loops
		if (src == trg)
		{
			double x0 = src.getX() + src.getWidth() + this.spacing;
			double y0 = src.getY() + src.getHeight() / 2;

			for (int i = 0; i < parallels.size(); i++)
			{
				route(parallels.get(i), x0, y0);
				x0 += spacing;
			}
		}
		else if (src != null && trg != null)
		{
			// Routes parallel edges
			double scx = src.getX() + src.getWidth() / 2;
			double scy = src.getY() + src.getHeight() / 2;

			double tcx = trg.getX() + trg.getWidth() / 2;
			double tcy = trg.getY() + trg.getHeight() / 2;

			double dx = tcx - scx;
			double dy = tcy - scy;

			double len = Math.sqrt(dx * dx + dy * dy);

			double x0 = scx + dx / 2;
			double y0 = scy + dy / 2;

			double nx = dy * spacing / len;
			double ny = dx * spacing / len;

			x0 += nx * (parallels.size() - 1) / 2;
			y0 -= ny * (parallels.size() - 1) / 2;

			for (int i = 0; i < parallels.size(); i++)
			{
				route(parallels.get(i), x0, y0);
				x0 -= nx;
				y0 += ny;
			}
		}
	}