if (ol.getOutX() > mid) hasRightOutLink = true; else hasLeftOutLink = true;
if (ol.getLayerID().equals(this.getLayerID())) { if (ol.getOutX() > mid) hasRightOutLink = true; else hasLeftOutLink = true; }
protected void draw(Graphics g, boolean hilited) {	if (drawOnlyOneSided)	{		drawOneSided(g, hilited);		return;	}	com.cosylab.vdct.graphics.ViewState view = com.cosylab.vdct.graphics.ViewState.getInstance();		double Rscale = view.getScale();	boolean zoom = (Rscale < 1.0) && view.isZoomOnHilited() && view.isHilitedObject(this);		if (zoom) {	    zoomImage = ZoomPane.getInstance().startZooming(this,!isZoomRepaint());	}		boolean isRightSide = isRight();	int rrrx = getRx()+r+getRwidth()-view.getRx();	int rrlx = getRx()-r-view.getRx();	//int rry = getRy()+getRheight()/2-view.getRy();	int rry = (int)(getRscale()*getInY()- view.getRy());			if (getParent().isZoomRepaint()) {        rrrx = getX() - getParent().getX() + getWidth() + ZoomPane.getInstance().getLeftOffset() + r;        rrlx = getX() - getParent().getX() + ZoomPane.getInstance().getLeftOffset()-r;	    rry = getY() - getParent().getY() + ZoomPane.VERTICAL_MARGIN + getHeight()/2;	} else if (isZoomRepaint()) {	    rrrx = getWidth() + ZoomPane.getInstance().getLeftOffset();        rrlx = getX() - getParent().getX() + ZoomPane.getInstance().getLeftOffset() - r;        if (!(this instanceof TemplateEPICSLink)) {            rrrx += r;            rrlx -= 3*r;        }        rry = ZoomPane.VERTICAL_MARGIN + getHeight()/2;    }		if (!hilited) g.setColor(Constants.FRAME_COLOR);	else g.setColor((view.isHilitedObject(this)) ? 					Constants.HILITE_COLOR : Constants.FRAME_COLOR);	g.drawOval(rrrx-r, rry-r, 2*r,2*r);	g.drawOval(rrlx-r, rry-r, 2*r,2*r);		if (!disconnected && (outlinks.size()>0)) {		// tail		g.setColor(hilited && view.isHilitedObject(this) ? Constants.HILITE_COLOR : getVisibleColor());		boolean hasLeftOutLink = false;		boolean hasRightOutLink = false;				// check which sides are used		int mid = (getLeftX() + getRightX())/2;		Enumeration e = outlinks.elements();		while (e.hasMoreElements() && !(hasLeftOutLink && hasRightOutLink))		{			OutLink ol = (OutLink)e.nextElement();			if (ol.getOutX() > mid)				hasRightOutLink = true;			else				hasLeftOutLink = true;		}		int linklx = (int)(getRscale()*getLeftX() - view.getRx());		int linkrx = (int)(getRscale()*getRightX() - view.getRx());		if (isZoomRepaint() || getParent().isZoomRepaint()) {		    linklx = 0;		    linkrx = ZoomPane.getInstance().getWidth();		}		if (hasLeftOutLink) {			g.drawLine(linklx, rry, rrlx-3*r, rry);		}		if (hasRightOutLink) {			g.drawLine(rrrx+2*r, rry, linkrx, rry);		}				// !!! more intergroup inlinks?!		LinkDrawer.drawInIntergroupLink(g, (OutLink)outlinks.firstElement(), this, isRightSide);			}	super.draw(g, hilited);}