c = findConnectionStart(x, y, drawingView.getDrawing());
} else {
c = findTarget(x, y, drawingView.getDrawing());
}
Connector startConnector = getStartConnector();
// track the figure containing the mouse
if (true/*c != getTargetFigure()*/) {
if (getTargetFigure() != null) {
FigureHelper.setConnectorVisible(getTargetFigure(), false);
}
setTargetFigure(c);
if (getTargetFigure() != null) {
if (startConnector == null) { //��û������ͼԪ��һ�ˣ�mouse move
FigureHelper.setConnectorVisible(getTargetFigure(), true);
}
else { //������һ�ˣ�������һ��
String featureId = (String)c.getAttribute("id");
String constraintId = (String)this.getStartConnector().owner().getAttribute("id");
boolean isSource = true;
int direction = this.getStartConnector().getDirection();
if (direction == Connector.EAST_DIRECTION || direction == Connector.SOUTH_DIRECTION)
isSource = false;
if (modelValidation.canConnect(featureId, constraintId, isSource))
FigureHelper.setConnectorVisible(getTargetFigure(), true);
else
c = null;
}
}
}
Connector cc = null;
if (c != null) {
cc = findConnector(x, y, c);
}
if (cc != getTargetConnector()) {
setTargetConnector(cc);