Skip to content

Commit 6d21817

Browse files
committed
Rename PointD to MPPointD
1 parent 43fa1e6 commit 6d21817

15 files changed

+81
-80
lines changed

MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarLineChartBase.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
import com.github.mikephil.charting.listener.OnDrawListener;
3232
import com.github.mikephil.charting.renderer.XAxisRenderer;
3333
import com.github.mikephil.charting.renderer.YAxisRenderer;
34+
import com.github.mikephil.charting.utils.MPPointD;
3435
import com.github.mikephil.charting.utils.MPPointF;
35-
import com.github.mikephil.charting.utils.PointD;
3636
import com.github.mikephil.charting.utils.Transformer;
3737
import com.github.mikephil.charting.utils.Utils;
3838

@@ -683,14 +683,14 @@ public void zoomAndCenterAnimated(float scaleX, float scaleY, float xValue, floa
683683

684684
if (android.os.Build.VERSION.SDK_INT >= 11) {
685685

686-
PointD origin = getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentTop(), axis);
686+
MPPointD origin = getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentTop(), axis);
687687

688688
Runnable job = AnimatedZoomJob.getInstance(mViewPortHandler, this, getTransformer(axis), getAxis(axis), mXAxis
689689
.mAxisRange, scaleX, scaleY, mViewPortHandler.getScaleX(), mViewPortHandler.getScaleY(),
690690
xValue, yValue, (float) origin.x, (float) origin.y, duration);
691691
addViewportJob(job);
692692

693-
PointD.recycleInstance(origin);
693+
MPPointD.recycleInstance(origin);
694694

695695
} else {
696696
Log.e(LOG_TAG, "Unable to execute zoomAndCenterAnimated(...) on API level < 11");
@@ -848,7 +848,7 @@ public void moveViewToAnimated(float xValue, float yValue, AxisDependency axis,
848848

849849
if (android.os.Build.VERSION.SDK_INT >= 11) {
850850

851-
PointD bounds = getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentTop(), axis);
851+
MPPointD bounds = getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentTop(), axis);
852852

853853
float yInView = getDeltaY(axis) / mViewPortHandler.getScaleY();
854854

@@ -857,7 +857,7 @@ public void moveViewToAnimated(float xValue, float yValue, AxisDependency axis,
857857

858858
addViewportJob(job);
859859

860-
PointD.recycleInstance(bounds);
860+
MPPointD.recycleInstance(bounds);
861861
} else {
862862
Log.e(LOG_TAG, "Unable to execute moveViewToAnimated(...) on API level < 11");
863863
}
@@ -915,7 +915,7 @@ public void centerViewToAnimated(float xValue, float yValue, AxisDependency axis
915915

916916
if (android.os.Build.VERSION.SDK_INT >= 11) {
917917

918-
PointD bounds = getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentTop(), axis);
918+
MPPointD bounds = getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentTop(), axis);
919919

920920
float yInView = getDeltaY(axis) / mViewPortHandler.getScaleY();
921921
float xInView = getXAxis().mAxisRange / mViewPortHandler.getScaleX();
@@ -926,7 +926,7 @@ public void centerViewToAnimated(float xValue, float yValue, AxisDependency axis
926926

927927
addViewportJob(job);
928928

929-
PointD.recycleInstance(bounds);
929+
MPPointD.recycleInstance(bounds);
930930
} else {
931931
Log.e(LOG_TAG, "Unable to execute centerViewToAnimated(...) on API level < 11");
932932
}
@@ -1202,40 +1202,40 @@ public void setKeepPositionOnRotation(boolean keepPositionOnRotation) {
12021202
}
12031203

12041204
/**
1205-
* Returns a recyclable PointD instance
1205+
* Returns a recyclable MPPointD instance
12061206
* Returns the x and y values in the chart at the given touch point
1207-
* (encapsulated in a PointD). This method transforms pixel coordinates to
1207+
* (encapsulated in a MPPointD). This method transforms pixel coordinates to
12081208
* coordinates / values in the chart. This is the opposite method to
12091209
* getPixelsForValues(...).
12101210
*
12111211
* @param x
12121212
* @param y
12131213
* @return
12141214
*/
1215-
public PointD getValuesByTouchPoint(float x, float y, AxisDependency axis) {
1216-
PointD result = PointD.getInstance(0,0);
1215+
public MPPointD getValuesByTouchPoint(float x, float y, AxisDependency axis) {
1216+
MPPointD result = MPPointD.getInstance(0,0);
12171217
getValuesByTouchPoint(x,y,axis,result);
12181218
return result;
12191219
}
12201220

1221-
public void getValuesByTouchPoint(float x, float y, AxisDependency axis, PointD outputPoint){
1221+
public void getValuesByTouchPoint(float x, float y, AxisDependency axis, MPPointD outputPoint){
12221222
getTransformer(axis).getValuesByTouchPoint(x, y, outputPoint);
12231223
}
12241224

12251225
/**
1226-
* Returns a recyclable PointD instance
1226+
* Returns a recyclable MPPointD instance
12271227
* Transforms the given chart values into pixels. This is the opposite
12281228
* method to getValuesByTouchPoint(...).
12291229
*
12301230
* @param x
12311231
* @param y
12321232
* @return
12331233
*/
1234-
public PointD getPixelsForValues(float x, float y, AxisDependency axis) {
1234+
public MPPointD getPixelsForValues(float x, float y, AxisDependency axis) {
12351235
return getTransformer(axis).getPixelsForValues(x, y);
12361236
}
12371237

1238-
PointD pointForGetYValueByTouchPoint = PointD.getInstance(0,0);
1238+
MPPointD pointForGetYValueByTouchPoint = MPPointD.getInstance(0,0);
12391239
/**
12401240
* Returns y value at the given touch position (must not necessarily be
12411241
* a value contained in one of the datasets)
@@ -1281,7 +1281,7 @@ public IBarLineScatterCandleBubbleDataSet getDataSetByTouchPoint(float x, float
12811281
}
12821282

12831283
/** buffer for storing lowest visible x point */
1284-
protected PointD posForGetLowestVisibleX = PointD.getInstance(0,0);
1284+
protected MPPointD posForGetLowestVisibleX = MPPointD.getInstance(0,0);
12851285

12861286
/**
12871287
* Returns the lowest x-index (value on the x-axis) that is still visible on
@@ -1298,7 +1298,7 @@ public float getLowestVisibleX() {
12981298
}
12991299

13001300
/** buffer for storing highest visible x point */
1301-
protected PointD posForGetHighestVisibleX = PointD.getInstance(0,0);
1301+
protected MPPointD posForGetHighestVisibleX = MPPointD.getInstance(0,0);
13021302

13031303
/**
13041304
* Returns the highest x-index (value on the x-axis) that is still visible

MPChartLib/src/main/java/com/github/mikephil/charting/highlight/BarHighlighter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import com.github.mikephil.charting.data.BarLineScatterCandleBubbleData;
66
import com.github.mikephil.charting.interfaces.dataprovider.BarDataProvider;
77
import com.github.mikephil.charting.interfaces.datasets.IBarDataSet;
8-
import com.github.mikephil.charting.utils.PointD;
8+
import com.github.mikephil.charting.utils.MPPointD;
99

1010
/**
1111
* Created by Philipp Jahoda on 22/07/15.
@@ -24,7 +24,7 @@ public Highlight getHighlight(float x, float y) {
2424
return null;
2525
}
2626

27-
PointD pos = getValsForTouch(x, y);
27+
MPPointD pos = getValsForTouch(x, y);
2828

2929
BarData barData = mChart.getBarData();
3030

@@ -37,7 +37,7 @@ public Highlight getHighlight(float x, float y) {
3737
(float) pos.y);
3838
}
3939

40-
PointD.recycleInstance(pos);
40+
MPPointD.recycleInstance(pos);
4141

4242
return high;
4343
}
@@ -68,7 +68,7 @@ public Highlight getStackedHighlight(Highlight high, IBarDataSet set, float xVal
6868
if (ranges.length > 0) {
6969
int stackIndex = getClosestStackIndex(ranges, yVal);
7070

71-
PointD pixels = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(high.getX(), ranges[stackIndex].to);
71+
MPPointD pixels = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(high.getX(), ranges[stackIndex].to);
7272

7373
Highlight stackedHigh = new Highlight(
7474
entry.getX(),
@@ -80,7 +80,7 @@ public Highlight getStackedHighlight(Highlight high, IBarDataSet set, float xVal
8080
high.getAxis()
8181
);
8282

83-
PointD.recycleInstance(pixels);
83+
MPPointD.recycleInstance(pixels);
8484

8585
return stackedHigh;
8686
}

MPChartLib/src/main/java/com/github/mikephil/charting/highlight/ChartHighlighter.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import com.github.mikephil.charting.data.Entry;
77
import com.github.mikephil.charting.interfaces.dataprovider.BarLineScatterCandleBubbleDataProvider;
88
import com.github.mikephil.charting.interfaces.datasets.IDataSet;
9-
import com.github.mikephil.charting.utils.PointD;
9+
import com.github.mikephil.charting.utils.MPPointD;
1010

1111
import java.util.ArrayList;
1212
import java.util.List;
@@ -33,26 +33,26 @@ public ChartHighlighter(T chart) {
3333
@Override
3434
public Highlight getHighlight(float x, float y) {
3535

36-
PointD pos = getValsForTouch(x, y);
36+
MPPointD pos = getValsForTouch(x, y);
3737
float xVal = (float) pos.x;
38-
PointD.recycleInstance(pos);
38+
MPPointD.recycleInstance(pos);
3939

4040
Highlight high = getHighlightForX(xVal, x, y);
4141
return high;
4242
}
4343

4444
/**
45-
* Returns a recyclable PointD instance.
45+
* Returns a recyclable MPPointD instance.
4646
* Returns the corresponding xPos for a given touch-position in pixels.
4747
*
4848
* @param x
4949
* @param y
5050
* @return
5151
*/
52-
protected PointD getValsForTouch(float x, float y) {
52+
protected MPPointD getValsForTouch(float x, float y) {
5353

5454
// take any transformer to determine the x-axis value
55-
PointD pos = mChart.getTransformer(YAxis.AxisDependency.LEFT).getValuesByTouchPoint(x, y);
55+
MPPointD pos = mChart.getTransformer(YAxis.AxisDependency.LEFT).getValuesByTouchPoint(x, y);
5656
return pos;
5757
}
5858

@@ -167,7 +167,7 @@ protected Highlight buildHighlight(IDataSet set, int dataSetIndex, float xVal, D
167167
if (e == null)
168168
return null;
169169

170-
PointD pixels = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(e.getX(), e.getY());
170+
MPPointD pixels = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(e.getX(), e.getY());
171171

172172
return new Highlight(e.getX(), e.getY(), (float) pixels.x, (float) pixels.y, dataSetIndex, set.getAxisDependency());
173173
}

MPChartLib/src/main/java/com/github/mikephil/charting/highlight/HorizontalBarHighlighter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import com.github.mikephil.charting.interfaces.dataprovider.BarDataProvider;
77
import com.github.mikephil.charting.interfaces.datasets.IBarDataSet;
88
import com.github.mikephil.charting.interfaces.datasets.IDataSet;
9-
import com.github.mikephil.charting.utils.PointD;
9+
import com.github.mikephil.charting.utils.MPPointD;
1010

1111
/**
1212
* Created by Philipp Jahoda on 22/07/15.
@@ -22,7 +22,7 @@ public Highlight getHighlight(float x, float y) {
2222

2323
BarData barData = mChart.getBarData();
2424

25-
PointD pos = getValsForTouch(y, x);
25+
MPPointD pos = getValsForTouch(y, x);
2626

2727
Highlight high = getHighlightForX((float) pos.y, y, x);
2828
if (high == null)
@@ -37,7 +37,7 @@ public Highlight getHighlight(float x, float y) {
3737
(float) pos.x);
3838
}
3939

40-
PointD.recycleInstance(pos);
40+
MPPointD.recycleInstance(pos);
4141

4242
return high;
4343
}
@@ -47,7 +47,7 @@ protected Highlight buildHighlight(IDataSet set, int dataSetIndex, float xVal, D
4747

4848
final Entry e = set.getEntryForXPos(xVal, rounding);
4949

50-
PointD pixels = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(e.getY(), e.getX());
50+
MPPointD pixels = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(e.getY(), e.getX());
5151

5252
return new Highlight(e.getX(), e.getY(), (float) pixels.x, (float) pixels.y, dataSetIndex, set.getAxisDependency());
5353
}

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/AxisRenderer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import android.graphics.Paint.Style;
88

99
import com.github.mikephil.charting.components.AxisBase;
10-
import com.github.mikephil.charting.utils.PointD;
10+
import com.github.mikephil.charting.utils.MPPointD;
1111
import com.github.mikephil.charting.utils.Transformer;
1212
import com.github.mikephil.charting.utils.Utils;
1313
import com.github.mikephil.charting.utils.ViewPortHandler;
@@ -121,8 +121,8 @@ public void computeAxis(float min, float max, boolean inverted) {
121121
// zoom / contentrect bounds)
122122
if (mViewPortHandler != null && mViewPortHandler.contentWidth() > 10 && !mViewPortHandler.isFullyZoomedOutY()) {
123123

124-
PointD p1 = mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentTop());
125-
PointD p2 = mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentBottom());
124+
MPPointD p1 = mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentTop());
125+
MPPointD p2 = mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentBottom());
126126

127127
if (!inverted) {
128128

@@ -134,8 +134,8 @@ public void computeAxis(float min, float max, boolean inverted) {
134134
max = (float) p2.y;
135135
}
136136

137-
PointD.recycleInstance(p1);
138-
PointD.recycleInstance(p2);
137+
MPPointD.recycleInstance(p1);
138+
MPPointD.recycleInstance(p2);
139139
}
140140

141141
computeAxisValues(min, max);

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/CandleStickChartRenderer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import com.github.mikephil.charting.interfaces.dataprovider.CandleDataProvider;
1212
import com.github.mikephil.charting.interfaces.datasets.ICandleDataSet;
1313
import com.github.mikephil.charting.utils.ColorTemplate;
14-
import com.github.mikephil.charting.utils.PointD;
14+
import com.github.mikephil.charting.utils.MPPointD;
1515
import com.github.mikephil.charting.utils.Transformer;
1616
import com.github.mikephil.charting.utils.Utils;
1717
import com.github.mikephil.charting.utils.ViewPortHandler;
@@ -326,7 +326,7 @@ public void drawHighlighted(Canvas c, Highlight[] indices) {
326326
float highValue = e.getHigh() * mAnimator.getPhaseY();
327327
float y = (lowValue + highValue) / 2f;
328328

329-
PointD pix = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(e.getX(), y);
329+
MPPointD pix = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(e.getX(), y);
330330

331331
high.setDraw((float) pix.x, (float) pix.y);
332332

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/LineChartRenderer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import com.github.mikephil.charting.interfaces.datasets.IDataSet;
1818
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
1919
import com.github.mikephil.charting.utils.ColorTemplate;
20-
import com.github.mikephil.charting.utils.PointD;
20+
import com.github.mikephil.charting.utils.MPPointD;
2121
import com.github.mikephil.charting.utils.Transformer;
2222
import com.github.mikephil.charting.utils.ViewPortHandler;
2323

@@ -750,7 +750,7 @@ public void drawHighlighted(Canvas c, Highlight[] indices) {
750750
if (!isInBoundsX(e, set))
751751
continue;
752752

753-
PointD pix = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(e.getX(), e.getY() * mAnimator
753+
MPPointD pix = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(e.getX(), e.getY() * mAnimator
754754
.getPhaseY());
755755

756756
high.setDraw((float) pix.x, (float) pix.y);

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/ScatterChartRenderer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import com.github.mikephil.charting.interfaces.dataprovider.ScatterDataProvider;
1212
import com.github.mikephil.charting.interfaces.datasets.IScatterDataSet;
1313
import com.github.mikephil.charting.renderer.scatter.ShapeRenderer;
14-
import com.github.mikephil.charting.utils.PointD;
14+
import com.github.mikephil.charting.utils.MPPointD;
1515
import com.github.mikephil.charting.utils.Transformer;
1616
import com.github.mikephil.charting.utils.Utils;
1717
import com.github.mikephil.charting.utils.ViewPortHandler;
@@ -148,7 +148,7 @@ public void drawHighlighted(Canvas c, Highlight[] indices) {
148148
if (!isInBoundsX(e, set))
149149
continue;
150150

151-
PointD pix = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(e.getX(), e.getY() * mAnimator
151+
MPPointD pix = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(e.getX(), e.getY() * mAnimator
152152
.getPhaseY());
153153

154154
high.setDraw((float) pix.x, (float) pix.y);

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/XAxisRenderer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import com.github.mikephil.charting.components.XAxis;
1212
import com.github.mikephil.charting.components.XAxis.XAxisPosition;
1313
import com.github.mikephil.charting.utils.FSize;
14+
import com.github.mikephil.charting.utils.MPPointD;
1415
import com.github.mikephil.charting.utils.MPPointF;
15-
import com.github.mikephil.charting.utils.PointD;
1616
import com.github.mikephil.charting.utils.Transformer;
1717
import com.github.mikephil.charting.utils.Utils;
1818
import com.github.mikephil.charting.utils.ViewPortHandler;
@@ -46,8 +46,8 @@ public void computeAxis(float min, float max, boolean inverted) {
4646
// zoom / contentrect bounds)
4747
if (mViewPortHandler.contentWidth() > 10 && !mViewPortHandler.isFullyZoomedOutX()) {
4848

49-
PointD p1 = mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentTop());
50-
PointD p2 = mTrans.getValuesByTouchPoint(mViewPortHandler.contentRight(), mViewPortHandler.contentTop());
49+
MPPointD p1 = mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentTop());
50+
MPPointD p2 = mTrans.getValuesByTouchPoint(mViewPortHandler.contentRight(), mViewPortHandler.contentTop());
5151

5252
if (inverted) {
5353

@@ -59,8 +59,8 @@ public void computeAxis(float min, float max, boolean inverted) {
5959
max = (float) p2.x;
6060
}
6161

62-
PointD.recycleInstance(p1);
63-
PointD.recycleInstance(p2);
62+
MPPointD.recycleInstance(p1);
63+
MPPointD.recycleInstance(p2);
6464
}
6565

6666
computeAxisValues(min, max);

0 commit comments

Comments
 (0)