Search in sources :

Example 1 with StructureMappingShape

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 + "'");
    }
}
Also used : StructureMappingShape(cbit.vcell.graph.StructureMappingShape) IllegalMappingException(cbit.vcell.mapping.IllegalMappingException) StructureMapping(cbit.vcell.mapping.StructureMapping) IllegalMappingException(cbit.vcell.mapping.IllegalMappingException) MappingException(cbit.vcell.mapping.MappingException)

Aggregations

StructureMappingShape (cbit.vcell.graph.StructureMappingShape)1 IllegalMappingException (cbit.vcell.mapping.IllegalMappingException)1 MappingException (cbit.vcell.mapping.MappingException)1 StructureMapping (cbit.vcell.mapping.StructureMapping)1