private void updateTickVisibility(){
  tickVisibilities.clear();
  for (int i=0; i < tickLabelPositions.size(); i++) {
    tickVisibilities.add(Boolean.TRUE);
  }
  if (tickLabelPositions.size() == 0) {
    return;
  }
  int previousPosition=0;
  String previousLabel=null;
  for (int i=0; i < tickLabelPositions.size(); i++) {
    boolean hasSpaceToDraw=true;
    if (i != 0) {
      hasSpaceToDraw=hasSpaceToDraw(previousPosition,tickLabelPositions.get(i),previousLabel,tickLabels.get(i));
    }
    String currentLabel=tickLabels.get(i);
    boolean isRepeatSameTickAndNotEnd=currentLabel.equals(previousLabel) && (i != 0 && i != tickLabelPositions.size() - 1);
    boolean isMajorTickOrEnd=true;
    if (scale.isLogScaleEnabled()) {
      isMajorTickOrEnd=isMajorTick(tickLabelValues.get(i)) || i == 0 || i == tickLabelPositions.size() - 1;
    }
    if (!hasSpaceToDraw || isRepeatSameTickAndNotEnd || !isMajorTickOrEnd) {
      tickVisibilities.set(i,Boolean.FALSE);
    }
 else {
      previousPosition=tickLabelPositions.get(i);
      previousLabel=currentLabel;
    }
  }
}

private void updateTickVisibility ( ) { tickVisibilities . clear ( ) ; for ( int i = 0 ; i < tickLabelPositions . size ( ) ; i ++ ) { tickVisibilities . add ( Boolean . TRUE ) ; } if ( tickLabelPositions . size ( ) == 0 ) { return ; } int previousPosition = 0 ; String previousLabel = null ; for ( int i = 0 ; i < tickLabelPositions . size ( ) ; i ++ ) { boolean hasSpaceToDraw = true ; if ( i != 0 ) { hasSpaceToDraw = hasSpaceToDraw ( previousPosition , tickLabelPositions . get ( i ) , previousLabel , tickLabels . get ( i ) ) ; } String currentLabel = tickLabels . get ( i ) ; boolean isRepeatSameTickAndNotEnd = currentLabel . equals ( previousLabel ) && ( i != 0 && i != tickLabelPositions . size ( ) - 1 ) ; boolean isMajorTickOrEnd = true ; if ( scale . isLogScaleEnabled ( ) ) { isMajorTickOrEnd = isMajorTick ( tickLabelValues . get ( i ) ) || i == 0 || i == tickLabelPositions . size ( ) - 1 ; } if ( ! hasSpaceToDraw || isRepeatSameTickAndNotEnd || ! isMajorTickOrEnd ) { tickVisibilities . set ( i , Boolean . FALSE ) ; } else { previousPosition = tickLabelPositions . get ( i ) ; previousLabel = currentLabel ; } } }
updates the visibility of tick labels .
