user exceptions fixed

This commit is contained in:
Sergey Solovyev 2012-12-05 13:09:22 +04:00
parent 5ac1f7405a
commit ff52c09006

View File

@ -335,12 +335,14 @@ public class CalculatorPlotFragment extends CalculatorFragment implements Calcul
} }
try { try {
if (dr != null) {
if (PlotUtils.addXY(dr.getXAxisMin(), dr.getXAxisMax(), expression, variable, realSeries, imagSeries, true, PlotUtils.DEFAULT_NUMBER_OF_STEPS)) { if (PlotUtils.addXY(dr.getXAxisMin(), dr.getXAxisMax(), expression, variable, realSeries, imagSeries, true, PlotUtils.DEFAULT_NUMBER_OF_STEPS)) {
if (chart.getDataset().getSeriesCount() <= 1) { if (chart.getDataset().getSeriesCount() <= 1) {
chart.getDataset().addSeries(imagSeries); chart.getDataset().addSeries(imagSeries);
chart.getRenderer().addSeriesRenderer(PlotUtils.createImagRenderer(imagLineColor.getColor())); chart.getRenderer().addSeriesRenderer(PlotUtils.createImagRenderer(imagLineColor.getColor()));
} }
} }
}
} catch (ArithmeticException e) { } catch (ArithmeticException e) {
PlotUtils.handleArithmeticException(e, CalculatorPlotFragment.this); PlotUtils.handleArithmeticException(e, CalculatorPlotFragment.this);
} }