Program: 171196
Project: 171196
Buggy source:
private void drawAxis(){
  if (Double.compare(stepSize,0) <= 0)   return;
  axisCtx.clearRect(0,0,width,height);
  axisCtx.setFill(getAxisBackgroundColor());
  axisCtx.fillRect(0,0,width,height);
  axisCtx.setFont(tickLabelFont);
  axisCtx.setTextBaseline(VPos.CENTER);
  AxisType axisType=getType();
  double minValue=getMinValue();
  double maxValue=getMaxValue();
  boolean tickLabelsVisible=getTickLabelsVisible();
  boolean isOnlyFirstAndLastTickLabelVisible=isOnlyFirstAndLastTickLabelVisible();
  double tickLabelFontSize=getTickLabelFontSize();
  Color tickLabelColor=getTickLabelColor();
  Color zeroColor=getZeroColor();
  Color majorTickMarkColor=getMajorTickMarkColor();
  boolean majorTickMarksVisible=getMajorTickMarksVisible();
  Color mediumTickMarkColor=getMediumTickMarkColor();
  boolean mediumTickMarksVisible=getMediumTickMarksVisible();
  Color minorTickMarkColor=getMinorTickMarkColor();
  boolean minorTickMarksVisible=getMinorTickMarksVisible();
  double majorLineWidth=size * 0.007 < MIN_MAJOR_LINE_WIDTH ? MIN_MAJOR_LINE_WIDTH : size * 0.007;
  double mediumLineWidth=size * 0.006 < MIN_MEDIUM_LINE_WIDTH ? MIN_MEDIUM_LINE_WIDTH : size * 0.005;
  double minorLineWidth=size * 0.005 < MIN_MINOR_LINE_WIDTH ? MIN_MINOR_LINE_WIDTH : size * 0.003;
  double minPosition;
  double maxPosition;
  if (VERTICAL == getOrientation()) {
    minPosition=0;
    maxPosition=height;
  }
 else {
    minPosition=0;
    maxPosition=width;
  }
  Locale locale=getLocale();
  Orientation orientation=getOrientation();
  Position position=getPosition();
  double anchorX=Position.LEFT == position ? 0 : getZeroPosition();
  double anchorXPlusOffset=anchorX + width;
  double anchorY=Position.BOTTOM == position ? 0 : getZeroPosition();
  double anchorYPlusOffset=anchorY + height;
  boolean isMinValue;
  boolean isZero;
  boolean isMaxValue;
  double innerPointX;
  double innerPointY;
  double outerPointX;
  double outerPointY;
  double mediumPointX;
  double mediumPointY;
  double minorPointX;
  double minorPointY;
  double textPointX;
  double textPointY;
  double maxTextWidth;
  if (AxisType.LINEAR == axisType) {
    boolean fullRange=(minValue < 0 && maxValue > 0);
    double minorTickSpace=getMinorTickSpace();
    double majorTickSpace=getMajorTickSpace();
    double tmpStepSize=minorTickSpace;
    BigDecimal minorTickSpaceBD=BigDecimal.valueOf(minorTickSpace);
    BigDecimal majorTickSpaceBD=BigDecimal.valueOf(majorTickSpace);
    BigDecimal mediumCheck2=BigDecimal.valueOf(2 * minorTickSpace);
    BigDecimal mediumCheck5=BigDecimal.valueOf(5 * minorTickSpace);
    BigDecimal counterBD=BigDecimal.valueOf(minValue);
    double counter=minValue;
    double range=getRange();
    axisCtx.setStroke(getAxisColor());
    axisCtx.setLineWidth(majorLineWidth);
    if (VERTICAL == orientation) {
switch (position) {
case LEFT:
        axisCtx.strokeLine(anchorXPlusOffset,minPosition,anchorXPlusOffset,maxPosition);
      break;
case RIGHT:
    axisCtx.strokeLine(anchorX,minPosition,anchorX,maxPosition);
  break;
default :
axisCtx.strokeLine(anchorX,minPosition,anchorX,maxPosition);
break;
}
}
 else {
switch (position) {
case BOTTOM:
axisCtx.strokeLine(minPosition,anchorY,maxPosition,anchorY);
break;
case TOP:
axisCtx.strokeLine(minPosition,anchorYPlusOffset,maxPosition,anchorYPlusOffset);
break;
default :
axisCtx.strokeLine(minPosition,anchorY,maxPosition,anchorY);
break;
}
}
BigDecimal tmpStepBD=new BigDecimal(tmpStepSize);
tmpStepBD=tmpStepBD.setScale(6,BigDecimal.ROUND_HALF_UP);
double tmpStep=tmpStepBD.doubleValue();
int tickMarkCounter=0;
for (double i=0; Double.compare(-range - tmpStep,i) <= 0; i-=tmpStep) {
double fixedPosition=(counter - minValue) * stepSize;
if (VERTICAL == orientation) {
if (Position.LEFT == position) {
innerPointX=anchorXPlusOffset - 0.5 * width;
innerPointY=fixedPosition;
mediumPointX=anchorXPlusOffset - 0.4 * width;
mediumPointY=fixedPosition;
minorPointX=anchorXPlusOffset - 0.3 * width;
minorPointY=fixedPosition;
outerPointX=anchorXPlusOffset;
outerPointY=fixedPosition;
textPointX=anchorXPlusOffset - 0.6 * width;
textPointY=fixedPosition;
maxTextWidth=0.6 * width;
}
 else if (Position.RIGHT == position) {
innerPointX=anchorX + 0.5 * width;
innerPointY=fixedPosition;
mediumPointX=anchorX + 0.4 * width;
mediumPointY=fixedPosition;
minorPointX=anchorX + 0.3 * width;
minorPointY=fixedPosition;
outerPointX=anchorX;
outerPointY=fixedPosition;
textPointX=anchorXPlusOffset;
textPointY=fixedPosition;
maxTextWidth=0.6 * width;
}
 else {
innerPointX=anchorX - 0.25 * width;
innerPointY=fixedPosition;
mediumPointX=anchorX - 0.2 * width;
mediumPointY=fixedPosition;
minorPointX=anchorX - 0.15 * width;
minorPointY=fixedPosition;
outerPointX=anchorX;
outerPointY=fixedPosition;
textPointX=anchorXPlusOffset;
textPointY=fixedPosition;
maxTextWidth=0.6 * width;
}
}
 else {
if (Position.BOTTOM == position) {
innerPointX=fixedPosition;
innerPointY=anchorY + 0.5 * height;
mediumPointX=fixedPosition;
mediumPointY=anchorY + 0.4 * height;
minorPointX=fixedPosition;
minorPointY=anchorY + 0.3 * height;
outerPointX=fixedPosition;
outerPointY=anchorY;
textPointX=fixedPosition;
textPointY=innerPointY + tickLabelFontSize * 0.6;
maxTextWidth=majorTickSpace * stepSize;
}
 else if (Position.TOP == position) {
innerPointX=fixedPosition;
innerPointY=anchorYPlusOffset - 0.5 * height;
mediumPointX=fixedPosition;
mediumPointY=anchorYPlusOffset - 0.4 * height;
minorPointX=fixedPosition;
minorPointY=anchorYPlusOffset - 0.3 * height;
outerPointX=fixedPosition;
outerPointY=anchorYPlusOffset;
textPointX=fixedPosition;
textPointY=innerPointY - tickLabelFontSize * 0.6;
maxTextWidth=majorTickSpace * stepSize;
}
 else {
innerPointX=fixedPosition;
innerPointY=anchorY - 0.25 * height;
mediumPointX=fixedPosition;
mediumPointY=anchorY - 0.2 * height;
minorPointX=fixedPosition;
minorPointY=anchorY - 0.15 * height;
outerPointX=fixedPosition;
outerPointY=anchorY;
textPointX=fixedPosition;
textPointY=anchorY + 0.2 * height;
maxTextWidth=majorTickSpace * stepSize;
}
}
if (Double.compare(counterBD.setScale(12,BigDecimal.ROUND_HALF_UP).remainder(majorTickSpaceBD).doubleValue(),0.0) == 0) {
isMinValue=Double.compare(minValue,counter) == 0;
isMaxValue=Double.compare(maxValue,counter) == 0;
if (VERTICAL == orientation) {
isZero=Double.compare(0.0,maxValue - counter + minValue) == 0;
}
 else {
isZero=Double.compare(0.0,counter) == 0;
}
if (isZero) {
setZeroPosition(fixedPosition);
}
if (majorTickMarksVisible) {
drawTickMark((fullRange && isZero) ? zeroColor : majorTickMarkColor,majorLineWidth,innerPointX,innerPointY,outerPointX,outerPointY);
}
 else if (minorTickMarksVisible) {
drawTickMark((fullRange && isZero) ? zeroColor : minorTickMarkColor,minorLineWidth,minorPointX,minorPointY,outerPointX,outerPointY);
}
if (tickLabelsVisible && tickLabelFont.getSize() > 6) {
String tickLabelString;
if (AxisType.LINEAR == axisType) {
if (TickLabelFormat.NUMBER == getTickLabelFormat()) {
tickLabelString=Orientation.HORIZONTAL == orientation ? String.format(locale,tickLabelFormatString,(minValue - i)) : String.format(locale,tickLabelFormatString,maxValue - counter + minValue);
}
 else {
tickLabelString=Orientation.HORIZONTAL == orientation ? Helper.secondsToHHMMString(Helper.toSeconds(Helper.toRealValue(minValue - i),Helper.getZoneOffset())) : String.format(locale,tickLabelFormatString,maxValue - counter + minValue);
}
}
 else {
tickLabelString=dateTimeFormatter.format(toLocalDateTime((long)(minValue - i) * 1000));
}
drawTickLabel(isOnlyFirstAndLastTickLabelVisible,isZero,isMinValue,isMaxValue,fullRange,zeroColor,tickLabelColor,textPointX,textPointY,maxTextWidth,tickLabelString,orientation);
}
}
 else if (mediumTickMarksVisible && Double.compare(minorTickSpaceBD.setScale(12,BigDecimal.ROUND_HALF_UP).remainder(mediumCheck2).doubleValue(),0.0) != 0.0 && Double.compare(counterBD.setScale(12,BigDecimal.ROUND_HALF_UP).remainder(mediumCheck5).doubleValue(),0.0) == 0.0) {
drawTickMark(mediumTickMarkColor,mediumLineWidth,mediumPointX,mediumPointY,outerPointX,outerPointY);
}
 else if (minorTickMarksVisible && Double.compare(counterBD.setScale(12,BigDecimal.ROUND_HALF_UP).remainder(minorTickSpaceBD).doubleValue(),0.0) == 0) {
drawTickMark(minorTickMarkColor,minorLineWidth,minorPointX,minorPointY,outerPointX,outerPointY);
}
counterBD=counterBD.add(minorTickSpaceBD);
counter=counterBD.doubleValue();
if (counter > maxValue) break;
}
}
 else {
tickLabelFormatString="String_Node_Str";
double logLowerBound=Math.log10(getMinValue());
double logUpperBound=Math.log10(getMaxValue());
double section;
if (VERTICAL == orientation) {
section=height / logUpperBound;
if (Position.LEFT == position) {
axisCtx.strokeLine(anchorXPlusOffset,minPosition,anchorXPlusOffset,maxPosition);
}
 else if (Position.RIGHT == position) {
axisCtx.strokeLine(anchorX,minPosition,anchorX,maxPosition);
}
}
 else {
section=width / logUpperBound;
if (Position.BOTTOM == position) {
axisCtx.strokeLine(minPosition,anchorY,maxPosition,anchorY);
}
 else if (Position.TOP == position) {
axisCtx.strokeLine(minPosition,anchorYPlusOffset,maxPosition,anchorYPlusOffset);
}
}
for (double i=0; i <= logUpperBound; i+=1) {
for (double j=1; j <= 9; j++) {
BigDecimal value=new BigDecimal(j * Math.pow(10,i));
double stepSize=i > 0 ? (Math.log10(value.doubleValue()) % i) : Math.log10(value.doubleValue());
double fixedPosition;
if (VERTICAL == orientation) {
isMinValue=Double.compare(i,logUpperBound) == 0;
isMaxValue=i == 0;
fixedPosition=maxPosition - i * section - (stepSize * section);
if (Position.LEFT == position) {
innerPointX=anchorXPlusOffset - 0.5 * width;
innerPointY=fixedPosition;
minorPointX=anchorXPlusOffset - 0.3 * width;
minorPointY=fixedPosition;
outerPointX=anchorXPlusOffset;
outerPointY=fixedPosition;
textPointX=anchorXPlusOffset - 0.6 * width;
textPointY=fixedPosition;
maxTextWidth=0.6 * width;
}
 else {
innerPointX=anchorX + 0.5 * width;
innerPointY=fixedPosition;
minorPointX=anchorX + 0.3 * width;
minorPointY=fixedPosition;
outerPointX=anchorX;
outerPointY=fixedPosition;
textPointX=anchorXPlusOffset;
textPointY=fixedPosition;
maxTextWidth=width;
}
}
 else {
isMinValue=i == 0;
isMaxValue=Double.compare(i,logUpperBound) == 0;
fixedPosition=i * section + (stepSize * section);
if (Position.BOTTOM == position) {
innerPointX=fixedPosition;
innerPointY=anchorY + 0.5 * height;
minorPointX=fixedPosition;
minorPointY=anchorY + 0.3 * height;
outerPointX=fixedPosition;
outerPointY=anchorY;
textPointX=fixedPosition;
textPointY=anchorY + 0.8 * height;
maxTextWidth=section;
}
 else {
innerPointX=fixedPosition;
innerPointY=anchorYPlusOffset - 0.5 * height;
minorPointX=fixedPosition;
minorPointY=anchorYPlusOffset - 0.3 * height;
outerPointX=fixedPosition;
outerPointY=anchorYPlusOffset;
textPointX=fixedPosition;
textPointY=anchorY + 0.2 * height;
maxTextWidth=section;
}
}
if (Helper.isPowerOf10(value.intValue())) {
if (majorTickMarksVisible) {
drawTickMark(majorTickMarkColor,majorLineWidth,innerPointX,innerPointY,outerPointX,outerPointY);
}
 else if (minorTickMarksVisible) {
drawTickMark(minorTickMarkColor,minorLineWidth,minorPointX,minorPointY,outerPointX,outerPointY);
}
if (tickLabelsVisible) {
axisCtx.setFill(tickLabelColor);
if (VERTICAL == orientation) {
axisCtx.setTextAlign(TextAlignment.RIGHT);
}
drawTickLabel(isOnlyFirstAndLastTickLabelVisible,false,isMinValue,isMaxValue,false,zeroColor,tickLabelColor,textPointX,textPointY,maxTextWidth,String.format(locale,tickLabelFormatString,value),orientation);
}
}
 else {
if (minorTickMarksVisible) {
drawTickMark(minorTickMarkColor,minorLineWidth,minorPointX,minorPointY,outerPointX,outerPointY);
}
}
}
}
}
drawAxisTitle(orientation,position);
}

Fixed version (ground truth):
private void drawAxis(){
  if (Double.compare(stepSize,0) <= 0)   return;
  axisCtx.clearRect(0,0,width,height);
  axisCtx.setFill(getAxisBackgroundColor());
  axisCtx.fillRect(0,0,width,height);
  axisCtx.setFont(tickLabelFont);
  axisCtx.setTextBaseline(VPos.CENTER);
  AxisType axisType=getType();
  double minValue=getMinValue();
  double maxValue=getMaxValue();
  boolean tickLabelsVisible=getTickLabelsVisible();
  boolean isOnlyFirstAndLastTickLabelVisible=isOnlyFirstAndLastTickLabelVisible();
  double tickLabelFontSize=getTickLabelFontSize();
  Color tickLabelColor=getTickLabelColor();
  Color zeroColor=getZeroColor();
  Color majorTickMarkColor=getMajorTickMarkColor();
  boolean majorTickMarksVisible=getMajorTickMarksVisible();
  Color mediumTickMarkColor=getMediumTickMarkColor();
  boolean mediumTickMarksVisible=getMediumTickMarksVisible();
  Color minorTickMarkColor=getMinorTickMarkColor();
  boolean minorTickMarksVisible=getMinorTickMarksVisible();
  double majorLineWidth=size * 0.007 < MIN_MAJOR_LINE_WIDTH ? MIN_MAJOR_LINE_WIDTH : size * 0.007;
  double mediumLineWidth=size * 0.006 < MIN_MEDIUM_LINE_WIDTH ? MIN_MEDIUM_LINE_WIDTH : size * 0.005;
  double minorLineWidth=size * 0.005 < MIN_MINOR_LINE_WIDTH ? MIN_MINOR_LINE_WIDTH : size * 0.003;
  double minPosition;
  double maxPosition;
  if (VERTICAL == getOrientation()) {
    minPosition=0;
    maxPosition=height;
  }
 else {
    minPosition=0;
    maxPosition=width;
  }
  Locale locale=getLocale();
  Orientation orientation=getOrientation();
  Position position=getPosition();
  double anchorX=Position.LEFT == position ? 0 : getZeroPosition();
  double anchorXPlusOffset=anchorX + width;
  double anchorY=Position.BOTTOM == position ? 0 : getZeroPosition();
  double anchorYPlusOffset=anchorY + height;
  boolean isMinValue;
  boolean isZero;
  boolean isMaxValue;
  double innerPointX;
  double innerPointY;
  double outerPointX;
  double outerPointY;
  double mediumPointX;
  double mediumPointY;
  double minorPointX;
  double minorPointY;
  double textPointX;
  double textPointY;
  double maxTextWidth;
  if (AxisType.LINEAR == axisType || AxisType.TEXT == axisType) {
    boolean fullRange=(minValue < 0 && maxValue > 0);
    double minorTickSpace=getMinorTickSpace();
    double majorTickSpace=getMajorTickSpace();
    double tmpStepSize=minorTickSpace;
    BigDecimal minorTickSpaceBD=BigDecimal.valueOf(minorTickSpace);
    BigDecimal majorTickSpaceBD=BigDecimal.valueOf(majorTickSpace);
    BigDecimal mediumCheck2=BigDecimal.valueOf(2 * minorTickSpace);
    BigDecimal mediumCheck5=BigDecimal.valueOf(5 * minorTickSpace);
    BigDecimal counterBD=BigDecimal.valueOf(minValue);
    double counter=minValue;
    double range=getRange();
    int noOfCategories=categories.size();
    axisCtx.setStroke(getAxisColor());
    axisCtx.setLineWidth(majorLineWidth);
    if (VERTICAL == orientation) {
switch (position) {
case LEFT:
        axisCtx.strokeLine(anchorXPlusOffset,minPosition,anchorXPlusOffset,maxPosition);
      break;
case RIGHT:
    axisCtx.strokeLine(anchorX,minPosition,anchorX,maxPosition);
  break;
default :
axisCtx.strokeLine(anchorX,minPosition,anchorX,maxPosition);
break;
}
}
 else {
switch (position) {
case BOTTOM:
axisCtx.strokeLine(minPosition,anchorY,maxPosition,anchorY);
break;
case TOP:
axisCtx.strokeLine(minPosition,anchorYPlusOffset,maxPosition,anchorYPlusOffset);
break;
default :
axisCtx.strokeLine(minPosition,anchorY,maxPosition,anchorY);
break;
}
}
BigDecimal tmpStepBD=new BigDecimal(tmpStepSize);
tmpStepBD=tmpStepBD.setScale(6,BigDecimal.ROUND_HALF_UP);
double tmpStep=tmpStepBD.doubleValue();
int tickMarkCounter=0;
int tickLabelCounter=0;
for (double i=0; Double.compare(-range - tmpStep,i) <= 0; i-=tmpStep) {
double fixedPosition=(counter - minValue) * stepSize;
if (VERTICAL == orientation) {
if (Position.LEFT == position) {
innerPointX=anchorXPlusOffset - 0.5 * width;
innerPointY=fixedPosition;
mediumPointX=anchorXPlusOffset - 0.4 * width;
mediumPointY=fixedPosition;
minorPointX=anchorXPlusOffset - 0.3 * width;
minorPointY=fixedPosition;
outerPointX=anchorXPlusOffset;
outerPointY=fixedPosition;
textPointX=anchorXPlusOffset - 0.6 * width;
textPointY=fixedPosition;
maxTextWidth=0.6 * width;
}
 else if (Position.RIGHT == position) {
innerPointX=anchorX + 0.5 * width;
innerPointY=fixedPosition;
mediumPointX=anchorX + 0.4 * width;
mediumPointY=fixedPosition;
minorPointX=anchorX + 0.3 * width;
minorPointY=fixedPosition;
outerPointX=anchorX;
outerPointY=fixedPosition;
textPointX=anchorXPlusOffset;
textPointY=fixedPosition;
maxTextWidth=0.6 * width;
}
 else {
innerPointX=anchorX - 0.25 * width;
innerPointY=fixedPosition;
mediumPointX=anchorX - 0.2 * width;
mediumPointY=fixedPosition;
minorPointX=anchorX - 0.15 * width;
minorPointY=fixedPosition;
outerPointX=anchorX;
outerPointY=fixedPosition;
textPointX=anchorXPlusOffset;
textPointY=fixedPosition;
maxTextWidth=0.6 * width;
}
}
 else {
if (Position.BOTTOM == position) {
innerPointX=fixedPosition;
innerPointY=anchorY + 0.5 * height;
mediumPointX=fixedPosition;
mediumPointY=anchorY + 0.4 * height;
minorPointX=fixedPosition;
minorPointY=anchorY + 0.3 * height;
outerPointX=fixedPosition;
outerPointY=anchorY;
textPointX=fixedPosition;
textPointY=innerPointY + tickLabelFontSize * 0.6;
maxTextWidth=majorTickSpace * stepSize;
}
 else if (Position.TOP == position) {
innerPointX=fixedPosition;
innerPointY=anchorYPlusOffset - 0.5 * height;
mediumPointX=fixedPosition;
mediumPointY=anchorYPlusOffset - 0.4 * height;
minorPointX=fixedPosition;
minorPointY=anchorYPlusOffset - 0.3 * height;
outerPointX=fixedPosition;
outerPointY=anchorYPlusOffset;
textPointX=fixedPosition;
textPointY=innerPointY - tickLabelFontSize * 0.6;
maxTextWidth=majorTickSpace * stepSize;
}
 else {
innerPointX=fixedPosition;
innerPointY=anchorY - 0.25 * height;
mediumPointX=fixedPosition;
mediumPointY=anchorY - 0.2 * height;
minorPointX=fixedPosition;
minorPointY=anchorY - 0.15 * height;
outerPointX=fixedPosition;
outerPointY=anchorY;
textPointX=fixedPosition;
textPointY=anchorY + 0.2 * height;
maxTextWidth=majorTickSpace * stepSize;
}
}
if (Double.compare(counterBD.setScale(12,BigDecimal.ROUND_HALF_UP).remainder(majorTickSpaceBD).doubleValue(),0.0) == 0) {
isMinValue=Double.compare(minValue,counter) == 0;
isMaxValue=Double.compare(maxValue,counter) == 0;
if (VERTICAL == orientation) {
isZero=Double.compare(0.0,maxValue - counter + minValue) == 0;
}
 else {
isZero=Double.compare(0.0,counter) == 0;
}
if (isZero) {
setZeroPosition(fixedPosition);
}
if (majorTickMarksVisible) {
drawTickMark((fullRange && isZero) ? zeroColor : majorTickMarkColor,majorLineWidth,innerPointX,innerPointY,outerPointX,outerPointY);
}
 else if (minorTickMarksVisible) {
drawTickMark((fullRange && isZero) ? zeroColor : minorTickMarkColor,minorLineWidth,minorPointX,minorPointY,outerPointX,outerPointY);
}
if (tickLabelsVisible && tickLabelFont.getSize() > 6) {
String tickLabelString;
if (AxisType.LINEAR == axisType) {
if (TickLabelFormat.NUMBER == getTickLabelFormat()) {
tickLabelString=Orientation.HORIZONTAL == orientation ? String.format(locale,tickLabelFormatString,(minValue - i)) : String.format(locale,tickLabelFormatString,maxValue - counter + minValue);
}
 else {
tickLabelString=Orientation.HORIZONTAL == orientation ? Helper.secondsToHHMMString(Helper.toSeconds(Helper.toRealValue(minValue - i),Helper.getZoneOffset())) : String.format(locale,tickLabelFormatString,maxValue - counter + minValue);
}
}
 else if (AxisType.TEXT == axisType) {
if (tickLabelCounter < noOfCategories) {
tickLabelString=categories.get(tickLabelCounter);
}
 else {
tickLabelString="String_Node_Str";
}
tickLabelCounter++;
}
 else {
tickLabelString=dateTimeFormatter.format(toLocalDateTime((long)(minValue - i) * 1000));
}
drawTickLabel(isOnlyFirstAndLastTickLabelVisible,isZero,isMinValue,isMaxValue,fullRange,zeroColor,tickLabelColor,textPointX,textPointY,maxTextWidth,tickLabelString,orientation);
}
}
 else if (mediumTickMarksVisible && Double.compare(minorTickSpaceBD.setScale(12,BigDecimal.ROUND_HALF_UP).remainder(mediumCheck2).doubleValue(),0.0) != 0.0 && Double.compare(counterBD.setScale(12,BigDecimal.ROUND_HALF_UP).remainder(mediumCheck5).doubleValue(),0.0) == 0.0) {
drawTickMark(mediumTickMarkColor,mediumLineWidth,mediumPointX,mediumPointY,outerPointX,outerPointY);
}
 else if (minorTickMarksVisible && Double.compare(counterBD.setScale(12,BigDecimal.ROUND_HALF_UP).remainder(minorTickSpaceBD).doubleValue(),0.0) == 0) {
drawTickMark(minorTickMarkColor,minorLineWidth,minorPointX,minorPointY,outerPointX,outerPointY);
}
counterBD=counterBD.add(minorTickSpaceBD);
counter=counterBD.doubleValue();
if (counter > maxValue) break;
}
}
 else if (AxisType.LOGARITHMIC == axisType) {
tickLabelFormatString="String_Node_Str";
double logLowerBound=Math.log10(getMinValue());
double logUpperBound=Math.log10(getMaxValue());
double section;
if (VERTICAL == orientation) {
section=height / logUpperBound;
if (Position.LEFT == position) {
axisCtx.strokeLine(anchorXPlusOffset,minPosition,anchorXPlusOffset,maxPosition);
}
 else if (Position.RIGHT == position) {
axisCtx.strokeLine(anchorX,minPosition,anchorX,maxPosition);
}
}
 else {
section=width / logUpperBound;
if (Position.BOTTOM == position) {
axisCtx.strokeLine(minPosition,anchorY,maxPosition,anchorY);
}
 else if (Position.TOP == position) {
axisCtx.strokeLine(minPosition,anchorYPlusOffset,maxPosition,anchorYPlusOffset);
}
}
for (double i=0; i <= logUpperBound; i+=1) {
for (double j=1; j <= 9; j++) {
BigDecimal value=new BigDecimal(j * Math.pow(10,i));
double stepSize=i > 0 ? (Math.log10(value.doubleValue()) % i) : Math.log10(value.doubleValue());
double fixedPosition;
if (VERTICAL == orientation) {
isMinValue=Double.compare(i,logUpperBound) == 0;
isMaxValue=i == 0;
fixedPosition=maxPosition - i * section - (stepSize * section);
if (Position.LEFT == position) {
innerPointX=anchorXPlusOffset - 0.5 * width;
innerPointY=fixedPosition;
minorPointX=anchorXPlusOffset - 0.3 * width;
minorPointY=fixedPosition;
outerPointX=anchorXPlusOffset;
outerPointY=fixedPosition;
textPointX=anchorXPlusOffset - 0.6 * width;
textPointY=fixedPosition;
maxTextWidth=0.6 * width;
}
 else {
innerPointX=anchorX + 0.5 * width;
innerPointY=fixedPosition;
minorPointX=anchorX + 0.3 * width;
minorPointY=fixedPosition;
outerPointX=anchorX;
outerPointY=fixedPosition;
textPointX=anchorXPlusOffset;
textPointY=fixedPosition;
maxTextWidth=width;
}
}
 else {
isMinValue=i == 0;
isMaxValue=Double.compare(i,logUpperBound) == 0;
fixedPosition=i * section + (stepSize * section);
if (Position.BOTTOM == position) {
innerPointX=fixedPosition;
innerPointY=anchorY + 0.5 * height;
minorPointX=fixedPosition;
minorPointY=anchorY + 0.3 * height;
outerPointX=fixedPosition;
outerPointY=anchorY;
textPointX=fixedPosition;
textPointY=anchorY + 0.8 * height;
maxTextWidth=section;
}
 else {
innerPointX=fixedPosition;
innerPointY=anchorYPlusOffset - 0.5 * height;
minorPointX=fixedPosition;
minorPointY=anchorYPlusOffset - 0.3 * height;
outerPointX=fixedPosition;
outerPointY=anchorYPlusOffset;
textPointX=fixedPosition;
textPointY=anchorY + 0.2 * height;
maxTextWidth=section;
}
}
if (Helper.isPowerOf10(value.intValue())) {
if (majorTickMarksVisible) {
drawTickMark(majorTickMarkColor,majorLineWidth,innerPointX,innerPointY,outerPointX,outerPointY);
}
 else if (minorTickMarksVisible) {
drawTickMark(minorTickMarkColor,minorLineWidth,minorPointX,minorPointY,outerPointX,outerPointY);
}
if (tickLabelsVisible) {
axisCtx.setFill(tickLabelColor);
if (VERTICAL == orientation) {
axisCtx.setTextAlign(TextAlignment.RIGHT);
}
drawTickLabel(isOnlyFirstAndLastTickLabelVisible,false,isMinValue,isMaxValue,false,zeroColor,tickLabelColor,textPointX,textPointY,maxTextWidth,String.format(locale,tickLabelFormatString,value),orientation);
}
}
 else {
if (minorTickMarksVisible) {
drawTickMark(minorTickMarkColor,minorLineWidth,minorPointX,minorPointY,outerPointX,outerPointY);
}
}
}
}
}
drawAxisTitle(orientation,position);
}