plot changes

This commit is contained in:
Sergey Solovyev
2013-01-21 01:26:54 +04:00
parent 62eb80c89d
commit fa7727d666
6 changed files with 49 additions and 43 deletions

View File

@@ -58,11 +58,11 @@ public interface CalculatorPlotter {
boolean isPlotPossibleFor(@NotNull Generic expression);
void setPlot3d(boolean plot3d);
void setPlotData(boolean plot3d, @NotNull PlotBoundaries plotBoundaries);
void removeAllUnpinned();
void setPlotImag(boolean plotImag);
void savePlotBoundaries(@NotNull PlotBoundaries plotBoundaries);
void setPlotBoundaries(@NotNull PlotBoundaries plotBoundaries);
}

View File

@@ -372,18 +372,13 @@ public class CalculatorPlotterImpl implements CalculatorPlotter {
}
}
@Override
public void setPlotData(boolean plot3d, @NotNull PlotBoundaries plotBoundaries) {
if (this.plot3d != plot3d || this.plotBoundaries.equals(plotBoundaries)) {
this.plot3d = plot3d;
this.plotBoundaries = plotBoundaries;
firePlotDataChangedEvent();
}
private void firePlotDataChangedEvent() {
updatePlotData();
calculator.fireCalculatorEvent(CalculatorEventType.plot_data_changed, plotData);
}
private void firePlotDataChangedEvent() {
private void updatePlotData() {
plotData = new PlotData(getVisibleFunctions(), plot3d, plotBoundaries);
calculator.fireCalculatorEvent(CalculatorEventType.plot_data_changed, plotData);
}
@Override
@@ -396,6 +391,14 @@ public class CalculatorPlotterImpl implements CalculatorPlotter {
}
}
@Override
public void savePlotBoundaries(@NotNull PlotBoundaries plotBoundaries) {
if ( !this.plotBoundaries.equals(plotBoundaries) ) {
this.plotBoundaries = plotBoundaries;
updatePlotData();
}
}
@Override
public void setPlotBoundaries(@NotNull PlotBoundaries plotBoundaries) {
if ( !this.plotBoundaries.equals(plotBoundaries) ) {