com.androidplot.util
Class ValPixConverter

java.lang.Object
  extended by com.androidplot.util.ValPixConverter

public class ValPixConverter
extends Object

Converts pixel coordinates to and from Dataset values.


Constructor Summary
ValPixConverter()
           
 
Method Summary
static double pixToVal(float pix, double min, double max, float lengthPix, boolean flip)
          Convert a value in pixels to the type passed into min/max
static double range(double min, double max)
           
static double valPerPix(double min, double max, float lengthPix)
           
static float valToPix(double val, double min, double max, float lengthPix, boolean flip)
           
static android.graphics.PointF valToPix(Number x, Number y, android.graphics.RectF plotArea, Number minX, Number maxX, Number minY, Number maxY)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValPixConverter

public ValPixConverter()
Method Detail

valToPix

public static float valToPix(double val,
                             double min,
                             double max,
                             float lengthPix,
                             boolean flip)

range

public static double range(double min,
                           double max)

valPerPix

public static double valPerPix(double min,
                               double max,
                               float lengthPix)

pixToVal

public static double pixToVal(float pix,
                              double min,
                              double max,
                              float lengthPix,
                              boolean flip)
Convert a value in pixels to the type passed into min/max

Parameters:
pix -
min -
max -
lengthPix -
flip - True if the axis should be reversed before calculated. This is the case with the y axis for screen coords.
Returns:

valToPix

public static android.graphics.PointF valToPix(Number x,
                                               Number y,
                                               android.graphics.RectF plotArea,
                                               Number minX,
                                               Number maxX,
                                               Number minY,
                                               Number maxY)


Copyright © 2011. All Rights Reserved.