/** * @param graphSelectionEvent GraphSelectionEvent * @param cell Object */ private void handleSelection(GraphSelectionEvent graphSelectionEvent, Object cell) { if (selected(graphSelectionEvent.getCells(), cell)) { if (graphSelectionEvent.isAddedCell(cell)) { addAll(cell); } else { removeAll(cell); } } }
/** * Invoked whenever the selection of the graph changes. * * @param graphSelectionEvent GraphSelectionEvent * @todo Implement this org.jgraph.event.GraphSelectionListener method */ public void valueChanged(GraphSelectionEvent graphSelectionEvent) { Object[] cells = graphSelectionEvent.getCells(); for (int i = 0; i < cells.length; i++) { handleSelection(graphSelectionEvent, cells[i]); } }