private void createFillTransition() { select = new JFXFillTransition(Duration.millis(120), box, Color.TRANSPARENT, (Color) getSkinnable().getCheckedColor()); select.setInterpolator(Interpolator.EASE_OUT); }
private void updateRippleColor() { rippler.setRipplerFill(getSkinnable().isSelected() ? getSkinnable().getCheckedColor() : getSkinnable().getUnCheckedColor()); }
boxContainer.setPadding(new Insets(padding)); rippler = new JFXRippler(boxContainer, RipplerMask.CIRCLE); rippler.setRipplerFill(getSkinnable().isSelected() ? control.getUnCheckedColor() : control.getCheckedColor()); rightLine.setStroke(control.getCheckedColor()); rightLine.setStrokeWidth(lineThick); leftLine.setStroke(control.getCheckedColor()); leftLine.setStrokeWidth(lineThick); rightLine.setVisible(false); rippler.setRipplerFill(newVal ? control.getUnCheckedColor() : control.getCheckedColor()); transition.setRate(newVal ? 1 : -1); transition.play();
private void playIndeterminateAnimation(Boolean indeterminate, boolean playAnimation) { if (indeterminate == null) { indeterminate = false; } indeterminateTransition.setRate(indeterminate ? 1 : -1); if (playAnimation) { indeterminateTransition.play(); } else { if (indeterminate) { CornerRadii radii = indeterminateMark.getBackground() == null ? null : indeterminateMark.getBackground().getFills().get(0).getRadii(); Insets insets = indeterminateMark.getBackground() == null ? null : indeterminateMark.getBackground().getFills().get(0).getInsets(); indeterminateMark.setOpacity(1); indeterminateMark.setScaleY(1); indeterminateMark.setScaleX(1); indeterminateMark.setBackground(new Background(new BackgroundFill(getSkinnable().getCheckedColor(), radii, insets))); indeterminateTransition.playFrom(indeterminateTransition.getCycleDuration()); } else { indeterminateMark.setOpacity(0); indeterminateMark.setScaleY(0); indeterminateMark.setScaleX(0); indeterminateTransition.playFrom(Duration.ZERO); } } if(getSkinnable().isSelected()){ playSelectAnimation(!indeterminate, playAnimation); } }
mark.setScaleX(1); mark.setOpacity(1); box.setBackground(new Background(new BackgroundFill(getSkinnable().getCheckedColor(), radii, insets))); select.playFrom(select.getCycleDuration()); transition.playFrom(transition.getCycleDuration()); box.setBorder(new Border(new BorderStroke(selection ? getSkinnable().getCheckedColor() : getSkinnable().getUnCheckedColor(), BorderStrokeStyle.SOLID, new CornerRadii(2),
private void createFillTransition() { select = new JFXFillTransition(Duration.millis(120), box, Color.TRANSPARENT, (Color) ((JFXCheckBox) getSkinnable()).getCheckedColor()); select.setInterpolator(Interpolator.EASE_OUT); }
private void updateRippleColor() { rippler.setRipplerFill(getSkinnable().isSelected() ? ((JFXCheckBox) getSkinnable()).getCheckedColor() : ((JFXCheckBox) getSkinnable()).getUnCheckedColor()); }
boxContainer.setPadding(new Insets(padding)); rippler = new JFXRippler(boxContainer, RipplerMask.CIRCLE); rippler.setRipplerFill(getSkinnable().isSelected() ? control.getUnCheckedColor() : control.getCheckedColor()); rightLine.setStroke(control.getCheckedColor()); rightLine.setStrokeWidth(lineThick); leftLine.setStroke(control.getCheckedColor()); leftLine.setStrokeWidth(lineThick); rightLine.setVisible(false); rippler.setRipplerFill(newVal ? control.getUnCheckedColor() : control.getCheckedColor()); transition.setRate(newVal ? 1 : -1); transition.play();
private void playIndeterminateAnimation(Boolean indeterminate, boolean playAnimation) { if (indeterminate == null) { indeterminate = false; } indeterminateTransition.setRate(indeterminate ? 1 : -1); if (playAnimation) { indeterminateTransition.play(); } else { if (indeterminate) { CornerRadii radii = indeterminateMark.getBackground() == null ? null : indeterminateMark.getBackground().getFills().get(0).getRadii(); Insets insets = indeterminateMark.getBackground() == null ? null : indeterminateMark.getBackground().getFills().get(0).getInsets(); indeterminateMark.setOpacity(1); indeterminateMark.setScaleY(1); indeterminateMark.setScaleX(1); indeterminateMark.setBackground(new Background(new BackgroundFill(((JFXCheckBox) getSkinnable()).getCheckedColor(), radii, insets))); indeterminateTransition.playFrom(indeterminateTransition.getCycleDuration()); } else { indeterminateMark.setOpacity(0); indeterminateMark.setScaleY(0); indeterminateMark.setScaleX(0); indeterminateTransition.playFrom(Duration.ZERO); } } if (getSkinnable().isSelected()) { playSelectAnimation(!indeterminate, playAnimation); } }
mark.setScaleX(1); mark.setOpacity(1); box.setBackground(new Background(new BackgroundFill(((JFXCheckBox) getSkinnable()).getCheckedColor(), radii, insets))); select.playFrom(select.getCycleDuration()); transition.playFrom(transition.getCycleDuration()); box.setBorder(new Border(new BorderStroke(selection ? ((JFXCheckBox) getSkinnable()).getCheckedColor() : ((JFXCheckBox) getSkinnable()).getUnCheckedColor(), BorderStrokeStyle.SOLID, new CornerRadii(2),