if (!evt.getTriggeredObjects().isEmpty()){
Object obj = evt.getTriggeredObjects().get(0);
if (obj instanceof GemEntity) {
GemEntity gemEntity = (GemEntity) obj;
IntellicutInfo intellicutInfo = intellicutManager.getIntellicutInfo(gemEntity);
AutoburnUnifyStatus autoburnStatus = intellicutInfo.getAutoburnUnifyStatus();
if (autoburnStatus != AutoburnUnifyStatus.NOT_POSSIBLE) {
tableTop.getUndoableEditSupport().beginUpdate();
// Add the new gem to the table top.
DisplayedGem dGem = gemCutter.getTableTop().createDisplayedFunctionalAgentGem(new Point(), gemEntity);
Point location = tableTop.findAvailableDisplayedGemLocation(dGem);
tableTop.doAddGemUserAction(dGem, location);
intellicutManager.attemptIntellicutAutoConnect(dGem);
intellicutManager.stopIntellicut();
// Set the proper undo name.
tableTop.getUndoableEditSupport().setEditName(GemCutterMessages.getString("UndoText_Add", dGem.getDisplayText()));
tableTop.getUndoableEditSupport().endUpdate();
}
}
}
} else {
gemCutter.getTableTop().getUndoableEditSupport().beginUpdate();
List<Object> triggeredObjects = evt.getTriggeredObjects();
for (final Object triggeredObj : triggeredObjects) {
if (triggeredObj instanceof GemEntity) {
GemEntity gemEntity = (GemEntity) triggeredObj;
if (browserTreeModel.isVisibleGem(gemEntity)) {
DisplayedGem dGem = gemCutter.getTableTop().createDisplayedFunctionalAgentGem(new Point(), gemEntity);
gemCutter.getTableTop().doAddGemUserAction(dGem);
}