dtde.dropComplete(true);
DropTarget dropTarget = (DropTarget) dtde.getSource();
DrawingView drawingView = (DrawingView) dropTarget.getComponent();
if (feature != null) {
FeatureFigure ff = new FeatureFigure();
ff.setAttribute("id", id);
ff.setAttribute(FeatureFigure.IS_A_LINK, Boolean.TRUE);
ff.setAttribute("text", feature.getName());
ff.setAttribute(FeatureProperties.VARIABILITY, feature.getVariability().getName());
ff.setAttribute(FeatureProperties.BINDINGTIME, feature.getBindingTime().getName());
Point location = dtde.getLocation();
double scale = drawingView.getScale();
int realX = (int) (location.getX() / scale + 0.5);
int realY = (int) (location.getY() / scale + 0.5);
ff.basicDisplayBox(new Point(realX, realY), null);
idToFigureMap.add(id, ff);
drawingView.add(ff);
} else if (rc != null) {
ResourceComponentFigure rcf = new ResourceComponentFigure();
rcf.setAttribute("id", id);
rcf.setAttribute(FeatureFigure.IS_A_LINK, Boolean.TRUE);
rcf.setAttribute("text", rc.getName());
rcf.setAttribute(FeatureProperties.VARIABILITY, rc.getVariability().getName());
Point location = dtde.getLocation();
double scale = drawingView.getScale();
int realX = (int) (location.getX() / scale + 0.5);
int realY = (int) (location.getY() / scale + 0.5);
rcf.basicDisplayBox(new Point(realX, realY), null);
idToFigureMap.add(id, rcf);
drawingView.add(rcf);
}
drawingView.repairDamage();
}