Color c = getColor(); if (c==Constants.BACKGROUND_COLOR) if (c==Color.black) c=Color.white; else c=Color.black; g.setColor(c);
g.setColor(hilited && view.isHilitedObject(this) ? Constants.HILITE_COLOR : getVisibleColor());
protected void draw(Graphics g, boolean hilited) {	super.draw(g, hilited);	com.cosylab.vdct.graphics.ViewState view = com.cosylab.vdct.graphics.ViewState.getInstance();	boolean rightSide = isRight();	int arrowLength = 2*r;		int rrx;	if (rightSide)		rrx = getRx()+getRwidth()-view.getRx();	else 		rrx = getRx()-view.getRx()-arrowLength;	//int rry = getRy()+getRheight()/2-view.getRy();	int rry = (int)(getRscale()*getOutY()- view.getRy());		if (!hilited) g.setColor(Constants.FRAME_COLOR);	else g.setColor((this==view.getHilitedObject()) ? 					Constants.HILITE_COLOR : Constants.FRAME_COLOR);	if (inlink!=null) {		// draw arrow		g.drawLine(rrx, rry-r, rrx+arrowLength, rry-r);		g.drawLine(rrx, rry+r, rrx+arrowLength, rry+r);				int dr=-r; 		if (rightSide) {			dr=-dr;			rrx+=arrowLength;		}		g.drawLine(rrx, rry-r, rrx+dr, rry);		g.drawLine(rrx, rry+r, rrx+dr, rry);		if (font2!=null) {			g.setFont(font2);			rry += realHalfHeight;			if (rightSide)				rrx += (labelLen-realLabelLen)/2+arrowLength/2;			else				rrx += arrowLength-rtailLen+labelLen-realLabelLen;			g.drawString(label2, rrx, rry);		}				//if (inlink.getLayerID().equals(getLayerID())) 		//g.setColor(getColor());		Color c = getColor();		if (c==Constants.BACKGROUND_COLOR)			if (c==Color.black)				c=Color.white;			else				c=Color.black;		g.setColor(c);		LinkDrawer.drawLink(g, this, inlink, getQueueCount(), rightSide);	} else {		 		if (getLinkCount()>0) {			// ports - draw tail line			// draw arrow			g.drawLine(rrx, rry-r, rrx+arrowLength, rry-r);			g.drawLine(rrx, rry+r, rrx+arrowLength, rry+r);						int dr=-r; 			if (rightSide) {				dr=-dr;				rrx+=arrowLength;			}			g.drawLine(rrx, rry-r, rrx+dr, rry);			g.drawLine(rrx, rry+r, rrx+dr, rry);				int rrx2 = (int)(getRscale()*getInX()- view.getRx());			g.drawLine(rrx, rry, rrx2, rry);			if (rightSide)				rrx-=arrowLength;		}		if (getFieldData().getValue().length()!=0)		{			// draw cross			if (!rightSide) rrx+=arrowLength;			g.drawLine(rrx-r, rry-r, rrx+r, rry+r);			g.drawLine(rrx+r, rry-r, rrx-r, rry+r);		}	}}