@Override public double valueToJava2D(double value,Rectangle2D dataArea,RectangleEdge edge){
  Range range=getRange();
  double vmin=range.getLowerBound();
  double vmax=range.getUpperBound();
  double vp=getCycleBound();
  if ((value < vmin) || (value > vmax)) {
    return Double.NaN;
  }
  double jmin=0.0;
  double jmax=0.0;
  if (RectangleEdge.isTopOrBottom(edge)) {
    jmin=dataArea.getMinX();
    jmax=dataArea.getMaxX();
  }
 else   if (RectangleEdge.isLeftOrRight(edge)) {
    jmax=dataArea.getMinY();
    jmin=dataArea.getMaxY();
  }
  if (isInverted()) {
    if (value == vp) {
      return this.boundMappedToLastCycle ? jmin : jmax;
    }
 else     if (value > vp) {
      return jmax - (value - vp) * (jmax - jmin) / this.period;
    }
 else {
      return jmin + (vp - value) * (jmax - jmin) / this.period;
    }
  }
 else {
    if (value == vp) {
      return this.boundMappedToLastCycle ? jmax : jmin;
    }
 else     if (value >= vp) {
      return jmin + (value - vp) * (jmax - jmin) / this.period;
    }
 else {
      return jmax - (vp - value) * (jmax - jmin) / this.period;
    }
  }
}

@ Override public double valueToJava2D ( double value , Rectangle2D dataArea , RectangleEdge edge ) { Range range = getRange ( ) ; double vmin = range . getLowerBound ( ) ; double vmax = range . getUpperBound ( ) ; double vp = getCycleBound ( ) ; if ( ( value < vmin ) || ( value > vmax ) ) { return Double . NaN ; } double jmin = 0.0 ; double jmax = 0.0 ; if ( RectangleEdge . isTopOrBottom ( edge ) ) { jmin = dataArea . getMinX ( ) ; jmax = dataArea . getMaxX ( ) ; } else if ( RectangleEdge . isLeftOrRight ( edge ) ) { jmax = dataArea . getMinY ( ) ; jmin = dataArea . getMaxY ( ) ; } if ( isInverted ( ) ) { if ( value == vp ) { return this . boundMappedToLastCycle ? jmin : jmax ; } else if ( value > vp ) { return jmax - ( value - vp ) * ( jmax - jmin ) / this . period ; } else { return jmin + ( vp - value ) * ( jmax - jmin ) / this . period ; } } else { if ( value == vp ) { return this . boundMappedToLastCycle ? jmax : jmin ; } else if ( value >= vp ) { return jmin + ( value - vp ) * ( jmax - jmin ) / this . period ; } else { return jmax - ( vp - value ) * ( jmax - jmin ) / this . period ; } } }
translates a value from data space to java 2d space .
