/** * Gets a drop target using getDropTarget and imports the cells using * mxGraph.splitEdge or mxGraphComponent.importCells depending on the * drop target and the return values of mxGraph.isSplitEnabled and * mxGraph.isSplitTarget. Selects and returns the cells that have been * imported. */ protected Object[] importCells(mxGraphComponent graphComponent, mxGraphTransferable gt, double dx, double dy) { Object target = getDropTarget(graphComponent, gt); mxGraph graph = graphComponent.getGraph(); Object[] cells = gt.getCells(); cells = graphComponent.getImportableCells(cells); if (graph.isSplitEnabled() && graph.isSplitTarget(target, cells)) { graph.splitEdge(target, cells, dx, dy); } else { cells = graphComponent.importCells(cells, dx, dy, target, location); graph.setSelectionCells(cells); } return cells; }
/** * Gets a drop target using getDropTarget and imports the cells using * mxGraph.splitEdge or mxGraphComponent.importCells depending on the * drop target and the return values of mxGraph.isSplitEnabled and * mxGraph.isSplitTarget. Selects and returns the cells that have been * imported. */ protected Object[] importCells(mxGraphComponent graphComponent, mxGraphTransferable gt, double dx, double dy) { Object target = getDropTarget(graphComponent, gt); mxGraph graph = graphComponent.getGraph(); Object[] cells = gt.getCells(); cells = graphComponent.getImportableCells(cells); if (graph.isSplitEnabled() && graph.isSplitTarget(target, cells)) { graph.splitEdge(target, cells, dx, dy); } else { cells = graphComponent.importCells(cells, dx, dy, target, location); graph.setSelectionCells(cells); } return cells; }