@Override protected double computeRippleRadius() { double width = ripplerPane.getWidth(); double width2 = width * width; return Math.min(Math.sqrt(width2 + width2), RIPPLE_MAX_RADIUS) * 1.1 + 5; }
@Override protected Node getMask() { double radius = ripplerPane.getWidth() / 2; return new Circle(radius, radius, radius); }
@Override protected void setOverLayBounds(Rectangle overlay) { overlay.setWidth(ripplerPane.getWidth()); overlay.setHeight(ripplerPane.getHeight()); }
private void refreshPopup() { Bounds contentBound = this.getLayoutBounds(); double offsetX = Math.ceil(snackbarContainer.getWidth() / 2) - Math.ceil(contentBound.getWidth() / 2); double offsetY = snackbarContainer.getHeight() - contentBound.getHeight(); this.setLayoutX(offsetX); this.setLayoutY(offsetY); }
private void updateColor() { final ColorPicker colorPicker = (ColorPicker) getSkinnable(); Color color = colorPicker.getValue(); // update picker box color Color circleColor = color == null ? Color.WHITE : color; Circle colorCircle = new Circle(); colorCircle.setFill(circleColor); colorCircle.setLayoutX(colorBox.getWidth() / 4); colorCircle.setLayoutY(colorBox.getHeight() / 2); colorBox.getChildren().add(colorCircle); Timeline animateColor = new Timeline(new KeyFrame(Duration.millis(240), new KeyValue(colorCircle.radiusProperty(), 200, Interpolator.EASE_BOTH))); animateColor.setOnFinished((finish) -> { JFXNodeUtils.updateBackground(colorBox.getBackground(), colorBox, colorCircle.getFill()); colorBox.getChildren().remove(colorCircle); }); animateColor.play(); // update label color displayNode.setTextFill(circleColor.grayscale().getRed() < 0.5 ? Color.valueOf( "rgba(255, 255, 255, 0.87)") : Color.valueOf("rgba(0, 0, 0, 0.87)")); if (colorLabelVisible.get()) { displayNode.setText(JFXNodeUtils.colorToHex(circleColor)); } else { displayNode.setText(""); } }
snapShotparams.setFill(Color.TRANSPARENT); WritableImage temp = monthContent.snapshot(snapShotparams, new WritableImage((int) monthContent.getWidth(), (int) monthContent.getHeight())); ImageView tempImage = new ImageView(temp);
private double getAnimationPaneWidth() { return animationPane.getWidth(); }
@Override protected double computeRippleRadius() { double width = ripplerPane.getWidth(); double width2 = width * width; return Math.min(Math.sqrt(width2 + width2), RIPPLE_MAX_RADIUS) * 1.1 + 5; }
@Override protected Node getMask() { double radius = ripplerPane.getWidth() / 2; return new Circle(radius, radius, radius); }
@Override public void layout(Pane node, TextNode textNode) { Line l = (Line) textNode.getUserData(); if( l != null ) { l.setEndX(node.getWidth()); } }
@Override protected void setOverLayBounds(Rectangle overlay) { overlay.setWidth(ripplerPane.getWidth()); overlay.setHeight(ripplerPane.getHeight()); }
/** * To bounds X. * * @param aTranslateX the translate X * @param aSprite the sprite * @return the double */ private double toBoundsX( double aTranslateX, Node aSprite ) { return toBounds( aTranslateX, aSprite.getBoundsInParent().getWidth(), _scene.getWidth() ); }
public void setTitle(String title) { getLabel().setText(title); originalTitleWidth = getLabel().getBoundsInParent().getWidth(); double maxIconWidth = Math.max( leftIconPane.getWidth(), rightIconPane.getWidth()); if (originalTitleWidth + maxIconWidth * 2 + offset >= getWidth()) { getLabel().setText("..."); } }
private void refreshPopup() { Bounds contentBound = this.getLayoutBounds(); double offsetX = Math.ceil(snackbarContainer.getWidth() / 2) - Math.ceil(contentBound.getWidth() / 2); double offsetY = snackbarContainer.getHeight() - contentBound.getHeight(); this.setLayoutX(offsetX); this.setLayoutY(offsetY); }
/** * To snap X. * * @param aTranslateX the translate X * @param aSprite the sprite * @return the double */ private double toSnapX( double aTranslateX, Node aSprite ) { return toSnap( aTranslateX, aSprite.getBoundsInParent().getWidth(), getFieldWidth(), _scene.getWidth() ); }
public void setTitle(String title) { getLabel().setText(title); originalTitleWidth = getLabel().getBoundsInParent().getWidth(); double maxIconWidth = Math.max( leftIconPane.getWidth(), rightIconPane.getWidth()); if (originalTitleWidth + maxIconWidth * 2 + offset >= getWidth()) { getLabel().setText("..."); } labelWidth = com.sun.javafx.tk.Toolkit.getToolkit().getFontLoader(). computeStringWidth(title, label.getFont()); control.layout(); layout(); }
public void setTitle(String title) { getLabel().setText(title); originalTitleWidth = getLabel().getBoundsInParent().getWidth(); double maxIconWidth = Math.max( leftIconPane.getWidth(), rightIconPane.getWidth()); if (originalTitleWidth + maxIconWidth * 2 + offset >= getWidth()) { getLabel().setText("..."); } // TODO replace with official API labelWidth = com.sun.javafx.tk.Toolkit.getToolkit().getFontLoader(). computeStringWidth(title, label.getFont()); requestLayout(); requestParentLayout(); }
@Override protected void layoutChildren() { super.layoutChildren(); leftIconPane.resizeRelocate(getInsets().getLeft(), getInsets().getTop(), leftIconPane.prefWidth(USE_PREF_SIZE), getHeight() - getInsets().getTop() - getInsets().getBottom()); rightIconPane.resize(rightIconPane.prefWidth(USE_PREF_SIZE), getHeight() - getInsets().getTop() - getInsets().getBottom()); rightIconPane.relocate(getWidth() - rightIconPane.getWidth() - getInsets().getRight(), getInsets().getTop()); }
@Override protected void layoutChildren() { super.layoutChildren(); leftIconPane.resizeRelocate(getInsets().getLeft(), getInsets().getTop(), leftIconPane.prefWidth(USE_PREF_SIZE), getHeight() - getInsets().getTop() - getInsets().getBottom()); rightIconPane.resize(rightIconPane.prefWidth(USE_PREF_SIZE), getHeight() - getInsets().getTop() - getInsets().getBottom()); rightIconPane.relocate(getWidth() - rightIconPane.getWidth() - getInsets().getRight(), getInsets().getTop()); }
@Override protected void layoutChildren() { super.layoutChildren(); leftIconPane.resizeRelocate(getInsets().getLeft(), getInsets().getTop(), leftIconPane.prefWidth(USE_PREF_SIZE), getHeight() - getInsets().getTop() - getInsets().getBottom()); rightIconPane.resize(rightIconPane.prefWidth(USE_PREF_SIZE), getHeight() - getInsets().getTop() - getInsets().getBottom()); rightIconPane.relocate(getWidth() - rightIconPane.getWidth() - getInsets().getRight(), getInsets().getTop()); }