Skip to content
This repository has been archived by the owner on Jul 10, 2020. It is now read-only.

Commit

Permalink
feat(zoom): #60: cleanup and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Oberwasserlechner committed Dec 20, 2017
1 parent 2716545 commit 021357a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 76 deletions.
49 changes: 11 additions & 38 deletions src/main/java/com/byteowls/vaadin/chartjs/options/Pan.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,6 @@
*/
public class Pan<T> extends And<T> implements JsonBuilder, Serializable {

// /**
// * Embedded class to make future changes easier
// * @param <R>
// */
// public class Range<R> extends And<Pan<R>> implements JsonBuilder, Serializable {
//
// private Double x;
// private Double y;
//
// public Range(Pan<R> parent) {
// super(parent);
// }
//
// /**
// * X Value
// */
// public Range x(double x) {
// this.x = x;
// return this;
// }
//
// /**
// * Y Value
// */
// public Range y(double y) {
// this.y = y;
// return this;
// }
//
// @Override
// public JsonObject buildJson() {
// JsonObject obj = Json.createObject();
// JUtils.putNotNull(obj, "x", x);
// JUtils.putNotNull(obj, "y", y);
// return obj;
// }
// }

private boolean enabled = true;
private Double speed;
private Double threshold;
Expand Down Expand Up @@ -83,18 +45,29 @@ public Pan<T> threshold(double threshold) {
return this;
}

/**
* Axes on which pan is enabled.
*/
public Pan<T> mode(XYMode mode) {
this.mode = mode;
return this;
}

/**
* Minimum range limits for pan.
* Range currently supports Double and String values. Usage depends on the datatypes in your scales.
*/
public PanRange<T> rangeMin() {
if (rangeMin == null) {
rangeMin = new PanRange<>(this);
}
return rangeMin;
}

/**
* Maximum range limits for pan.
* Range currently supports Double and String values. Usage depends on the datatypes in your scales.
*/
public PanRange<T> rangeMax() {
if (rangeMax == null) {
rangeMax = new PanRange<>(this);
Expand Down
49 changes: 11 additions & 38 deletions src/main/java/com/byteowls/vaadin/chartjs/options/Zoom.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,6 @@
*/
public class Zoom<T> extends And<T> implements JsonBuilder, Serializable {

// /**
// * Embedded class to make future changes easier
// * @param <R>
// */
// public class Range<R> extends And<Zoom<R>> implements JsonBuilder, Serializable {
//
// private Double x;
// private Double y;
//
// public Range(Zoom<R> parent) {
// super(parent);
// }
//
// /**
// * X Value
// */
// public Range x(double x) {
// this.x = x;
// return this;
// }
//
// /**
// * Y Value
// */
// public Range y(double y) {
// this.y = y;
// return this;
// }
//
// @Override
// public JsonObject buildJson() {
// JsonObject obj = Json.createObject();
// JUtils.putNotNull(obj, "x", x);
// JUtils.putNotNull(obj, "y", y);
// return obj;
// }
// }

private boolean enabled = true;
private boolean drag;
private Double sensitivity;
Expand Down Expand Up @@ -86,18 +48,29 @@ public Zoom<T> sensitivity(double sensitivity) {
return this;
}

/**
* Axes on which zoom is enabled.
*/
public Zoom<T> mode(XYMode mode) {
this.mode = mode;
return this;
}

/**
* Minimum range limits for zoom.
* Range currently supports Double and String values. Usage depends on the datatypes in your scales.
*/
public ZoomRange<T> rangeMin() {
if (rangeMin == null) {
rangeMin = new ZoomRange<>(this);
}
return rangeMin;
}

/**
* Maximum range limits for zoom.
* Range currently supports Double and String values. Usage depends on the datatypes in your scales.
*/
public ZoomRange<T> rangeMax() {
if (rangeMax == null) {
rangeMax = new ZoomRange<>(this);
Expand Down

0 comments on commit 021357a

Please sign in to comment.