g.setColor(Constants.SELECTION_COLOR);  double scale = view.getScale();  int posX2 = 0; int posY2 = 0;  if(partnerVertex.getHashID().compareTo(hashId) < 0) { posX = getRx() + (int)(Constants.CONNECTOR_WIDTH * scale / 2) - offsetX; posY = getRy() + (int)(Constants.CONNECTOR_HEIGHT * scale / 2) - offsetY;  posX2 = partnerVertex.getRx() + (int)(Constants.CONNECTOR_WIDTH * scale / 2) - offsetX; posY2 = partnerVertex.getRy() + (int)(Constants.CONNECTOR_HEIGHT * scale / 2) - offsetY; } else { posX = partnerVertex.getRx() + (int)(Constants.CONNECTOR_WIDTH * scale / 2) - offsetX; posY = partnerVertex.getRy() + (int)(Constants.CONNECTOR_HEIGHT * scale / 2) - offsetY;  posX2 = getRx() + (int)(Constants.CONNECTOR_WIDTH * scale / 2) - offsetX; posY2 = getRy() + (int)(Constants.CONNECTOR_HEIGHT * scale / 2) - offsetY; }  int dirX = (posX < posX2) ? (1) : (-1); int dirY = (posY < posY2) ? (1) : (-1);  int curX = posX;  while((curX * dirX) <= (posX2 * dirX)) { int curX2 = curX + dirX * Constants.DASHED_LINE_DENSITY;  if((curX2 * dirX) > (posX2 * dirX)) curX2 = posX2;  g.drawLine(curX, posY, curX2, posY); g.drawLine(curX, posY2, curX2, posY2);  curX += 2 * dirX * Constants.DASHED_LINE_DENSITY; }  int curY = posY;  while((curY * dirY) <= (posY2 * dirY)) { int curY2 = curY + dirY * Constants.DASHED_LINE_DENSITY;  if((curY2 * dirY) > (posY2 * dirY)) curY2 = posY2;  g.drawLine(posX, curY, posX, curY2); g.drawLine(posX2, curY, posX2, curY2);  curY += 2 * dirY * Constants.DASHED_LINE_DENSITY; }
protected void draw(Graphics g, boolean hilited){	if((!isAlwaysDrawn) && (!hilited))		return;	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(!((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(Constants.SELECTION_COLOR);	double scale = view.getScale();	int posX2 = 0;	int posY2 = 0;	if(partnerVertex.getHashID().compareTo(hashId) < 0)	{		posX = getRx() + (int)(Constants.CONNECTOR_WIDTH * scale / 2) - offsetX;		posY = getRy() + (int)(Constants.CONNECTOR_HEIGHT * scale / 2) - offsetY;				posX2 = partnerVertex.getRx() + (int)(Constants.CONNECTOR_WIDTH * scale / 2) - offsetX;		posY2 = partnerVertex.getRy() + (int)(Constants.CONNECTOR_HEIGHT * scale / 2) - offsetY;	}	else	{		posX = partnerVertex.getRx() + (int)(Constants.CONNECTOR_WIDTH * scale / 2) - offsetX;		posY = partnerVertex.getRy() + (int)(Constants.CONNECTOR_HEIGHT * scale / 2) - offsetY;		posX2 = getRx() + (int)(Constants.CONNECTOR_WIDTH * scale / 2) - offsetX;		posY2 = getRy() + (int)(Constants.CONNECTOR_HEIGHT * scale / 2) - offsetY;	}	int dirX = (posX < posX2) ? (1) : (-1);	int dirY = (posY < posY2) ? (1) : (-1);	int curX = posX;	while((curX * dirX) <= (posX2 * dirX))	{		int curX2 = curX + dirX * Constants.DASHED_LINE_DENSITY;						if((curX2 * dirX) > (posX2 * dirX))			curX2 = posX2;						g.drawLine(curX, posY, curX2, posY);		g.drawLine(curX, posY2, curX2, posY2);						curX += 2 * dirX * Constants.DASHED_LINE_DENSITY;	}	int curY = posY;	while((curY * dirY) <= (posY2 * dirY))	{		int curY2 = curY + dirY * Constants.DASHED_LINE_DENSITY;						if((curY2 * dirY) > (posY2 * dirY))			curY2 = posY2;						g.drawLine(posX, curY, posX, curY2);		g.drawLine(posX2, curY, posX2, curY2);						curY += 2 * dirY * Constants.DASHED_LINE_DENSITY;	}}