/** * Removes all of the current <code>giny.view.GraphView</code> objects that this * <code>GraphViewController</code> keeps synchronized to their corresponding * <code>giny.model.GraphPerspective</code> members. This <code>GraphViewController</code> * will no longer receive events from <code>giny.model.GraphPerspective</code>s after * this call. * * @return the array of removed <code>giny.view.GraphView</code> objects */ public GraphView[] removeAllGraphViews() { GraphView[] gViews = getGraphViews(); for (int i = 0; i < gViews.length; i++) { GraphPerspective graphPerspective = gViews[i].getGraphPerspective(); graphPerspective.removeGraphPerspectiveChangeListener(this); } //for i this.gpToGv.clear(); this.graphViewToHandler.clear(); return gViews; } //removeAllGraphViews
/** * It temporarily removes this <code>GraphViewController</code> as a listener for * all <code>giny.model.GraphPerspective</code> objects that it currently * listens to * * @see #resumeListening() resumeListening */ public void stopListening() { GraphView[] graphViews = getGraphViews(); for (int i = 0; i < graphViews.length; i++) { GraphPerspective graphPerspective = graphViews[i].getGraphPerspective(); graphPerspective.removeGraphPerspectiveChangeListener(this); } //for i } //stopListening
/** * It adds this <code>GraphViewController</code> as a listener for * all <code>giny.model.GraphPerspective</code> that were temporarily * "removed" by calling <code>stopListening()</code>, it updates the <code>GraphViews</code> * of the <code>GraphPerspectives</code> so that they are synchronized to reflect changes that * may have occured while not listening. * * @see #stopListening() stopListening */ public void resumeListening() { GraphView[] graphViews = getGraphViews(); for (int i = 0; i < graphViews.length; i++) { GraphPerspective graphPerspective = graphViews[i].getGraphPerspective(); GraphViewHandler handler = (GraphViewHandler) this.graphViewToHandler.get(graphViews[i]); handler.updateGraphView(graphViews[i]); graphPerspective.addGraphPerspectiveChangeListener(this); } //for i } //resumeListening