/* * Update a function. */ private void updatePlot( Function oldFunc, String newExpr[], Color3f newColor, String[] bounds, float[] stepSize) throws IllegalExpressionException { // Try evaluating the function. Function newFunc = createNewFunction(newExpr, newColor, bounds, stepSize); newFunc.setView(oldFunc.getView()); funcList.set(funcList.indexOf(oldFunc), newFunc); updateReferences(newFunc); FunctionLabel label = map.get(oldFunc); label.setMother(newFunc); map.remove(oldFunc); map.put(newFunc, label); setSelected(newFunc); plotter.removePlot(oldFunc); spawnNewPlotterThread(newFunc); }