if (getTypingTarget() != null) {//������ǰ�ı༭״̬
endEdit(false);
flag = true;
}
TextHolder textHolder = null;
double scale = drawingView.getScale();
int realX = (int) (e.getX() / scale + 0.5);
int realY = (int) (e.getY() / scale + 0.5);
Figure pressedFigure = drawingView.getDrawing().findFigureInside(realX, realY);
if (pressedFigure instanceof TextHolder) {
textHolder = (TextHolder) pressedFigure;
if (!textHolder.acceptsTyping())
textHolder = null;
}
if (textHolder != null) {
beginEdit(textHolder);
return;
}
if (flag) {
getPropertyChangeSupport().firePropertyChange(Tool.TOOL_DONE, false, true);
flag = false;
} else {
super.mouseDown(e, x, y);
drawingView.checkDamage();
textHolder = (TextHolder) createdFigure;
if(pressedFigure != null && textHolder != null && pressedFigure != textHolder){
textHolder.connect(pressedFigure);
//((Figure)textHolder).setAttribute("selectivity", Boolean.FALSE);
}
beginEdit(textHolder);
}