posX = startVertex.getRx() + rw - offsetX; posY = startVertex.getRy() + rh - offsetY;  int posX2 = endVertex.getRx() + rw - offsetX; int posY2 = endVertex.getRy() + rh - offsetY;
int posX2 = endVertex.getRx() - offsetX; int posY2 = endVertex.getRy() - offsetY;
protected void draw(Graphics g, boolean hilited){	ViewState view = ViewState.getInstance();	int offsetX = view.getRx();	int offsetY = view.getRy();		int posX = getRx() - offsetX;	int posY = getRy() - offsetY;	int rwidth = getRwidth();	int rheight = getRheight();	if((hilited) && (!((posX > view.getViewWidth()) || (posY > view.getViewHeight())		|| ((posX + rwidth) < 0) || ((posY + rheight) < 0))))	{		g.setColor(Constants.HILITE_COLOR);		g.drawRect(posX, posY, rwidth, rheight);	}	g.setColor(getColor());	double scale = view.getScale();		int rw = (int)(Constants.CONNECTOR_WIDTH * scale / 2);	int rh = (int)(Constants.CONNECTOR_HEIGHT * scale / 2);			posX = startVertex.getRx() + rw - offsetX;	posY = startVertex.getRy() + rh - offsetY;			int posX2 = endVertex.getRx() + rw - offsetX;	int posY2 = endVertex.getRy() + rh - offsetY;	int t;	if(posX > posX2)	{		t = posX;		posX = posX2;		posX2 = t;	}	if(posY > posY2)	{		t = posY;		posY = posY2;		posY2 = t;	}			if((dashed) && ((posX != posX2) || (posY != posY2)))	{		int curX = posX;		while(curX <= posX2)		{			int curX2 = curX + Constants.DASHED_LINE_DENSITY;							if(curX2 > posX2)				curX2 = posX2;							g.drawLine(curX, posY, curX2, posY);			g.drawLine(curX, posY2, curX2, posY2);							curX += 2 * Constants.DASHED_LINE_DENSITY;		}		int curY = posY;		while(curY <= posY2)		{			int curY2 = curY + Constants.DASHED_LINE_DENSITY;							if(curY2 > posY2)				curY2 = posY2;							g.drawLine(posX, curY, posX, curY2);			g.drawLine(posX2, curY, posX2, curY2);							curY += 2 * Constants.DASHED_LINE_DENSITY;		}	}	else		g.drawRect(posX, posY, posX2 - posX, posY2 - posY);}