private void drawTickMarks(final GraphicsContext CTX) {
        if (Double.compare(stepSize, 0) <= 0) return;

        CTX.setFont(Fonts.robotoLight(0.06 * size));
        CTX.setStroke(gauge.getTickMarkColor());
        CTX.setFill(gauge.getTickLabelColor());

        Point2D innerPoint;
        Point2D innerMediumPoint;
        Point2D innerMinorPoint;
        Point2D outerPoint;
        Point2D textPoint;

        double minPosition;
        double maxPosition;
        if (Orientation.VERTICAL == orientation) {
            minPosition = barBackground.getLayoutY() + size * 0.0035;
            maxPosition = barBackground.getLayoutY() + barBackground.getLayoutBounds().getHeight();
        } else {
            minPosition = barBackground.getLayoutX();
            maxPosition = barBackground.getLayoutX() + barBackground.getLayoutBounds().getWidth();
        }

        double anchorX        = barBackground.getLayoutX() - 0.075 * width;
        double anchorY        = barBackground.getLayoutY() + barBackground.getHeight() + 0.075 * height;
        double majorTickSpace = gauge.getMajorTickSpace();
        double minorTickSpace = gauge.getMinorTickSpace();
        double minValue       = gauge.getMinValue();
        double maxValue       = gauge.getMaxValue();

        if (gauge.getSectionsVisible()) drawSections(CTX);

        int counter = 0;
        for (double i = minPosition ; Double.compare(i, maxPosition + 1) <= 0 ; i += stepSize) {
            if (Orientation.VERTICAL == orientation) {
                innerPoint       = new Point2D(anchorX, i);
                innerMediumPoint = new Point2D(anchorX + 0.015 * width, i);
                innerMinorPoint  = new Point2D(anchorX + 0.03 * width, i);
                outerPoint       = new Point2D(anchorX + 0.05 * width, i);
                textPoint        = new Point2D(anchorX - 0.02 * width, i);
            } else {
                innerPoint       = new Point2D(i, anchorY);
                innerMediumPoint = new Point2D(i, anchorY - 0.015 * height);
                innerMinorPoint  = new Point2D(i, anchorY - 0.03 * height);
                outerPoint       = new Point2D(i, anchorY - 0.05 * height);
                textPoint        = new Point2D(i, anchorY + 0.05 * height);
            }

            if (counter % majorTickSpace == 0) {
                // Draw major tickmark
                if (gauge.getMajorTickMarksVisible()) {
                    CTX.setLineWidth(size * 0.007);
                    CTX.strokeLine(innerPoint.getX(), innerPoint.getY(), outerPoint.getX(), outerPoint.getY());
                }

                // Draw text
                if (gauge.getTickLabelsVisible()) {
                    CTX.setTextBaseline(VPos.CENTER);
                    if (Orientation.VERTICAL == orientation) {
                        CTX.setTextAlign(TextAlignment.RIGHT);
                        CTX.fillText(String.format(locale, tickLabelFormatString, (maxValue -= majorTickSpace) + majorTickSpace), textPoint.getX(), textPoint.getY());
                    } else {
                        CTX.setTextAlign(TextAlignment.CENTER);
                        CTX.fillText(String.format(locale, tickLabelFormatString, (minValue += majorTickSpace) - majorTickSpace), textPoint.getX(), textPoint.getY());
                    }
                }
            } else if (minorTickSpace % 2 != 0 && counter % 5 == 0) {
                if (gauge.getMediumTickMarksVisible()) {
                    CTX.setLineWidth(size * 0.006);
                    CTX.strokeLine(innerMediumPoint.getX(), innerMediumPoint.getY(), outerPoint.getX(), outerPoint.getY());
                }
            } else if (counter % minorTickSpace == 0) {
                if (gauge.getMinorTickMarksVisible()) {
                    CTX.setLineWidth(size * 0.005);
                    CTX.strokeLine(innerMinorPoint.getX(), innerMinorPoint.getY(), outerPoint.getX(), outerPoint.getY());
                }
            }
            counter++;
        }
    }
private void drawTickMarks ( final GraphicsContext CTX ) { if ( Double . compare ( stepSize , 0 ) <= 0 ) return ; CTX . setFont ( Fonts . robotoLight ( 0.06 * size ) ) ; CTX . setStroke ( gauge . getTickMarkColor ( ) ) ; CTX . setFill ( gauge . getTickLabelColor ( ) ) ; Point2D innerPoint ; Point2D innerMediumPoint ; Point2D innerMinorPoint ; Point2D outerPoint ; Point2D textPoint ; double minPosition ; double maxPosition ; if ( Orientation . VERTICAL == orientation ) { minPosition = barBackground . getLayoutY ( ) + size * 0.0035 ; maxPosition = barBackground . getLayoutY ( ) + barBackground . getLayoutBounds ( ) . getHeight ( ) ; } else { minPosition = barBackground . getLayoutX ( ) ; maxPosition = barBackground . getLayoutX ( ) + barBackground . getLayoutBounds ( ) . getWidth ( ) ; } double anchorX = barBackground . getLayoutX ( ) - 0.075 * width ; double anchorY = barBackground . getLayoutY ( ) + barBackground . getHeight ( ) + 0.075 * height ; double majorTickSpace = gauge . getMajorTickSpace ( ) ; double minorTickSpace = gauge . getMinorTickSpace ( ) ; double minValue = gauge . getMinValue ( ) ; double maxValue = gauge . getMaxValue ( ) ; if ( gauge . getSectionsVisible ( ) ) drawSections ( CTX ) ; int counter = 0 ; for ( double i = minPosition ; Double . compare ( i , maxPosition + 1 ) <= 0 ; i += stepSize ) { if ( Orientation . VERTICAL == orientation ) { innerPoint = new Point2D ( anchorX , i ) ; innerMediumPoint = new Point2D ( anchorX + 0.015 * width , i ) ; innerMinorPoint = new Point2D ( anchorX + 0.03 * width , i ) ; outerPoint = new Point2D ( anchorX + 0.05 * width , i ) ; textPoint = new Point2D ( anchorX - 0.02 * width , i ) ; } else { innerPoint = new Point2D ( i , anchorY ) ; innerMediumPoint = new Point2D ( i , anchorY - 0.015 * height ) ; innerMinorPoint = new Point2D ( i , anchorY - 0.03 * height ) ; outerPoint = new Point2D ( i , anchorY - 0.05 * height ) ; textPoint = new Point2D ( i , anchorY + 0.05 * height ) ; } if ( counter % majorTickSpace == 0 ) { if ( gauge . getMajorTickMarksVisible ( ) ) { CTX . setLineWidth ( size * 0.007 ) ; CTX . strokeLine ( innerPoint . getX ( ) , innerPoint . getY ( ) , outerPoint . getX ( ) , outerPoint . getY ( ) ) ; } if ( gauge . getTickLabelsVisible ( ) ) { CTX . setTextBaseline ( VPos . CENTER ) ; if ( Orientation . VERTICAL == orientation ) { CTX . setTextAlign ( TextAlignment . RIGHT ) ; CTX . fillText ( String . format ( locale , tickLabelFormatString , ( maxValue -= majorTickSpace ) + majorTickSpace ) , textPoint . getX ( ) , textPoint . getY ( ) ) ; } else { CTX . setTextAlign ( TextAlignment . CENTER ) ; CTX . fillText ( String . format ( locale , tickLabelFormatString , ( minValue += majorTickSpace ) - majorTickSpace ) , textPoint . getX ( ) , textPoint . getY ( ) ) ; } } } else if ( minorTickSpace % 2 != 0 && counter % 5 == 0 ) { if ( gauge . getMediumTickMarksVisible ( ) ) { CTX . setLineWidth ( size * 0.006 ) ; CTX . strokeLine ( innerMediumPoint . getX ( ) , innerMediumPoint . getY ( ) , outerPoint . getX ( ) , outerPoint . getY ( ) ) ; } } else if ( counter % minorTickSpace == 0 ) { if ( gauge . getMinorTickMarksVisible ( ) ) { CTX . setLineWidth ( size * 0.005 ) ; CTX . strokeLine ( innerMinorPoint . getX ( ) , innerMinorPoint . getY ( ) , outerPoint . getX ( ) , outerPoint . getY ( ) ) ; } } counter ++ ; } }
******************** Private Methods ***********************************