private void updateArcLayout(double radius, double arcSize) { arc.setRadiusX(radius); arc.setRadiusY(radius); arc.setCenterX(arcSize / 2); arc.setCenterY(arcSize / 2); track.setRadiusX(radius); track.setRadiusY(radius); track.setCenterX(arcSize / 2); track.setCenterY(arcSize / 2); track.setStrokeWidth(arc.getStrokeWidth()); }
@Override protected Node getMask() { double radius = ripplerPane.getWidth() / 2; return new Circle(radius, radius, radius); }
/** * creates empty drawers stack */ public JFXDrawersStack() { final Rectangle clip = new Rectangle(); clip.widthProperty().bind(this.widthProperty()); clip.heightProperty().bind(this.heightProperty()); this.setClip(clip); }
private void addTabContentHolder(Tab tab) { // create new content place holder TabContentHolder tabContentHolder = new TabContentHolder(tab); tabContentHolder.setClip(new Rectangle()); tabContentHolders.add(tabContentHolder); // always add tab content holder below its header tabsContainer.getChildren().add(0, tabContentHolder); }
public void layoutLines(double x, double y, double w, double h, double controlHeight, double translateY) { this.contentHeight = translateY; clip.setY(-contentHeight); clip.setHeight(controlHeight + contentHeight); focusedLine.resizeRelocate(x, controlHeight, w, focusedLine.prefHeight(-1)); line.resizeRelocate(x, controlHeight, w, line.prefHeight(-1)); promptContainer.resizeRelocate(x, y, w, h); scale.setPivotX(w / 2); }
private void updateClipHeight(double newHeight) { clip.setHeight(newHeight - getGap()); }
public void layoutPane(final double x, final double y, final double w, final double h) { relocate(x, y); // resize error container if animation is disabled if (control.isDisableAnimation() || isErrorVisible()) { resize(w, computeErrorHeight(computeErrorWidth(w))); errorContainerClip.setWidth(w); } }
public void moveCircle(Circle circle, Scene scene) { Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { Platform.runLater(() -> { circle.setCenterX(random((int) scene.getX())); circle.setCenterY(random((int) scene.getY())); }); } }, 1000, 1000); }
private Point2D makeControlPoint(final double endX, final double endY, final Circle circle, final int numSegments, int direction) { final double controlPointDistance = (4.0 / 3.0) * Math.tan(Math.PI / (2 * numSegments)) * circle.getRadius(); final Point2D center = new Point2D(circle.getCenterX(), circle.getCenterY()); final Point2D end = new Point2D(endX, endY); Point2D perp = rotate(center, end, direction * Math.PI / 2.); Point2D diff = perp.subtract(end); diff = diff.normalize(); diff = scale(diff, controlPointDistance); return end.add(diff); }
private void initialize() { if (getSkinnable().isIndeterminate()) { if (timeline == null) { createTransition(); if (getSkinnable().impl_isTreeVisible()) { timeline.play(); } } } else { clearAnimation(); arc.setStartAngle(90); updateProgress(); } }
@Override protected double computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) { if (Region.USE_COMPUTED_SIZE == control.getRadius()) { return super.computeMaxHeight(width, topInset, rightInset, bottomInset, leftInset); } else { return control.getRadius() * 2 + arc.getStrokeWidth() * 2; } }
@Override protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { return super.computePrefWidth(height, topInset, rightInset, bottomInset, leftInset) + snapSize(radio.prefWidth(-1)) + padding / 3; }
@Override protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { return super.computeMinWidth(height, topInset, rightInset, bottomInset, leftInset) + snapSize(radio.minWidth(-1)) + padding / 3; }
private double computeTranslation(double circleRadius, Line line) { return (getSkinnable().isSelected() ? 1 : -1) * ((line.getLayoutBounds().getWidth() / 2) - circleRadius + 2); }
@Override protected double computeMaxWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { if (Region.USE_COMPUTED_SIZE == control.getRadius()) { return super.computeMaxHeight(height, topInset, rightInset, bottomInset, leftInset); } else { return control.getRadius() * 2 + arc.getStrokeWidth() * 2; } }
public void invalid(double w) { final ValidatorBase activeValidator = control.getActiveValidator(); if (activeValidator != null) { showError(activeValidator); final double errorContainerWidth = w - errorIcon.prefWidth(-1); setOpacity(1); resize(w, computeErrorHeight(errorContainerWidth)); errorContainerClip.setWidth(w); errorContainerClip.setHeight(getHeight()); errorClipScale.setY(1); } }