new plotter

This commit is contained in:
Sergey Solovyev
2013-01-14 18:05:23 +04:00
parent f08e03761b
commit c9770cef4b
2 changed files with 21 additions and 8 deletions

View File

@@ -13,7 +13,7 @@ public class PlotFunction {
private XyFunction xyFunction;
@NotNull
private PlotLineDef mPlotLineDef;
private PlotLineDef plotLineDef;
private boolean pinned = false;
@@ -21,26 +21,34 @@ public class PlotFunction {
public PlotFunction(@NotNull XyFunction xyFunction) {
this.xyFunction = xyFunction;
this.mPlotLineDef = PlotLineDef.newDefaultInstance();
this.plotLineDef = PlotLineDef.newDefaultInstance();
}
public PlotFunction(@NotNull XyFunction xyFunction,
@NotNull PlotLineDef plotLineDef) {
this.xyFunction = xyFunction;
this.mPlotLineDef = plotLineDef;
this.plotLineDef = plotLineDef;
}
@NotNull
private PlotFunction copy() {
final PlotFunction copy = new PlotFunction(this.xyFunction);
copy.mPlotLineDef = this.mPlotLineDef;
copy.plotLineDef = this.plotLineDef;
copy.pinned = this.pinned;
copy.visible = this.visible;
return copy;
}
@NotNull
public static PlotFunction changePlotLineDef(@NotNull PlotFunction that, @NotNull PlotLineDef newPlotLineDef) {
final PlotFunction copy = that.copy();
copy.plotLineDef = newPlotLineDef;
return copy;
}
@NotNull
public static PlotFunction pin(@NotNull PlotFunction that) {
return togglePinned(that, true);
}
@@ -81,7 +89,7 @@ public class PlotFunction {
@NotNull
public PlotLineDef getPlotLineDef() {
return mPlotLineDef;
return plotLineDef;
}
public boolean isPinned() {