if (source instanceof LayerEvent) {
_sourceType = CANVAS_TYPE;
// Action activated using an ActionInteractor.
LayerEvent event = (LayerEvent) source;
CanvasLayer layer = event.getLayerSource();
GraphPane pane = (GraphPane) layer.getCanvasPane();
GraphController controller = pane.getGraphController();
GraphModel model = controller.getGraphModel();
_figure = event.getFigureSource();
// Set the target.
if (_figure == null) {
_target = (NamedObj) model.getRoot();
} else {
Object object = _figure.getUserObject();
_target = (NamedObj) model.getSemanticObject(object);
}
// Set the position.
_x = event.getX();
_y = event.getY();
// Set the parent.
CanvasPane canvasPane = layer.getCanvasPane();
parent = canvasPane.getCanvas();
} else if (source instanceof JMenuItem) {