/** * Sets the array of <code>giny.view.GraphView</code> objects * that this <code>GraphViewController</code> will keep synchronized with * their corresponding <code>giny.model.GraphPerspective</code> objects * available through their <code>getGraphPerspective()</code> method, the * DEFAULT_GRAPH_VIEW_HANDLER is set for all the views. Any previous <code>GraphView</code> * objects are removed from this listener * * @param graph_views an array of <code>giny.view.GraphView</code> objects */ public void setGraphViews(GraphView[] graph_views) { removeAllGraphViews(); for (int i = 0; i < graph_views.length; i++) { GraphPerspective graphPerspective = graph_views[i].getGraphPerspective(); graphPerspective.addGraphPerspectiveChangeListener(this); this.gpToGv.put(graphPerspective, graph_views[i]); this.graphViewToHandler.put(graph_views[i], DEFAULT_GRAPH_VIEW_HANDLER); } //for i } //setGraphViews
/** * Sets the array of <code>giny.view.GraphView</code> objects * that this <code>GraphViewController</code> will keep synchronized with * their corresponding <code>giny.model.GraphPerspective</code> objects * available through their <code>getGraphPerspective()</code> method, the * <code>cytoscape.view.GraphViewHandler</code> objects for the * <code>GraphView</code>s are obtained from the given <code>Map</code>, * if a <code>GraphView</code> in the array is not a key in the <code>Map</code> * then DEFAULT_GRAPH_VIEW_HANDLER is used. Any previous <code>GraphView</code> * objects are removed from this listener * * @param graph_views an array of <code>giny.view.GraphView</code> objects * @param gv_to_handler a <code>Map</code> with <code>giny.view.GraphView</code> * for keys and <code>cytoscape.view.GraphViewHandler</code> objects for values */ public void setGraphViews(GraphView[] graph_views, Map gv_to_handler) { removeAllGraphViews(); for (int i = 0; i < graph_views.length; i++) { GraphPerspective graphPerspective = graph_views[i].getGraphPerspective(); graphPerspective.addGraphPerspectiveChangeListener(this); this.gpToGv.put(graphPerspective, graph_views[i]); GraphViewHandler handler = (GraphViewHandler) gv_to_handler.get(graph_views[i]); if (handler == null) { this.graphViewToHandler.put(graph_views[i], DEFAULT_GRAPH_VIEW_HANDLER); } else { this.graphViewToHandler.put(graph_views[i], handler); } } //for i } //setGraphViews