private void pauseTimeline(boolean pause) { if (getSkinnable().isIndeterminate()) { if (timeline == null) { createTransition(); } if (pause) { timeline.pause(); } else { timeline.play(); } } }
private void initialize() { if (getSkinnable().isIndeterminate()) { if (timeline == null) { createTransition(); if (getSkinnable().impl_isTreeVisible()) { timeline.play(); } } } else { clearAnimation(); arc.setStartAngle(90); updateProgress(); } }
/** * {@inheritDoc} */ @Override protected void layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight) { final double strokeWidth = arc.getStrokeWidth(); final double radius = Math.min(contentWidth, contentHeight) / 2 - strokeWidth / 2; final double arcSize = snapSize(radius * 2 + strokeWidth); arcPane.resizeRelocate((contentWidth - arcSize) / 2 + 1, (contentHeight - arcSize) / 2 + 1, arcSize, arcSize); updateArcLayout(radius, arcSize); fillRect.setWidth(arcSize); fillRect.setHeight(arcSize); if (!isValid) { initialize(); isValid = true; } if (!getSkinnable().isIndeterminate()) { arc.setLength(arcLength); if (text.isVisible()) { final double progress = control.getProgress(); int intProgress = (int) Math.round(progress * 100.0); Font font = text.getFont(); text.setFont(Font.font(font.getFamily(), radius / 1.7)); text.setText((progress > 1 ? 100 : intProgress) + "%"); text.relocate((arcSize - text.getLayoutBounds().getWidth()) / 2, (arcSize - text.getLayoutBounds().getHeight()) / 2); } } }
private void createTransition() { if(!getSkinnable().isIndeterminate()) return; final Paint initialColor = arc.getStroke(); if (initialColor == null) {
private void pauseTimeline(boolean pause) { if (getSkinnable().isIndeterminate()) { if (timeline == null) { createTransition(); } if (pause) { timeline.pause(); } else { timeline.play(); } } }
private void initialize() { if (getSkinnable().isIndeterminate()) { if (timeline == null) { createTransition(); if (NodeHelper.isTreeShowing(getSkinnable())) { timeline.play(); } } } else { clearAnimation(); arc.setStartAngle(90); updateProgress(); } }
/** * {@inheritDoc} */ @Override protected void layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight) { final double strokeWidth = arc.getStrokeWidth(); final double radius = Math.min(contentWidth, contentHeight) / 2 - strokeWidth / 2; final double arcSize = snapSize(radius * 2 + strokeWidth); arcPane.resizeRelocate((contentWidth - arcSize) / 2 + 1, (contentHeight - arcSize) / 2 + 1, arcSize, arcSize); updateArcLayout(radius, arcSize); fillRect.setWidth(arcSize); fillRect.setHeight(arcSize); if (!isValid) { initialize(); isValid = true; } if (!getSkinnable().isIndeterminate()) { arc.setLength(arcLength); if (text.isVisible()) { final double progress = control.getProgress(); int intProgress = (int) Math.round(progress * 100.0); Font font = text.getFont(); text.setFont(Font.font(font.getFamily(), radius / 1.7)); text.setText((progress > 1 ? 100 : intProgress) + "%"); text.relocate((arcSize - text.getLayoutBounds().getWidth()) / 2, (arcSize - text.getLayoutBounds().getHeight()) / 2); } } }
private void createTransition() { if(!getSkinnable().isIndeterminate()) return; final Paint initialColor = arc.getStroke(); if (initialColor == null) {