use of cbit.vcell.graph.StructureMappingShape in project vcell by virtualcell.
the class StructureMappingCartoonTool method menuAction.
protected void menuAction(Shape shape, String menuAction) {
//
if (shape == null) {
return;
}
//
if (menuAction.equals(CartoonToolEditActions.Delete.MENU_ACTION)) {
if (shape instanceof StructureMappingShape) {
try {
StructureMapping sm = (StructureMapping) ((StructureMappingShape) shape).getModelObject();
getStructureMappingCartoon().getGeometryContext().assignStructure(sm.getStructure(), null);
getStructureMappingCartoon().refreshAll();
} catch (IllegalMappingException e) {
e.printStackTrace(System.out);
PopupGenerator.showErrorDialog(getGraphPane(), e.getMessage());
} catch (java.beans.PropertyVetoException e) {
e.printStackTrace(System.out);
PopupGenerator.showErrorDialog(getGraphPane(), e.getMessage());
} catch (MappingException e) {
e.printStackTrace(System.out);
PopupGenerator.showErrorDialog(getGraphPane(), e.getMessage());
}
}
} else {
// default action is to ignore
System.out.println("unsupported menu action '" + menuAction + "' on shape '" + shape + "'");
}
}
Aggregations