/*************************************************************************** * * * public properties * * * **************************************************************************/ public double getDefaultDrawerSize() { return defaultSizeProperty.get(); }
public double getSecondaryProgress() { return secondaryProgress == null ? INDETERMINATE_PROGRESS : secondaryProgress.get(); }
public double getMiniDrawerSize() { return miniDrawerSize.get(); }
/** * @return the cell width of the masonry pane grid */ public final double getCellWidth() { return this.cellWidthProperty().get(); }
/** * @return the horizontal spacing between nodes in the grid */ public final double getHSpacing() { return this.hSpacingProperty().get(); }
/** * @return the cell height of the masonry pane grid */ public final double getCellHeight() { return this.cellHeightProperty().get(); }
/** * @return the vertical spacing between nodes in the grid */ public final double getVSpacing() { return this.vSpacingProperty().get(); }
public final double getScalingFactor() { return this.scalingFactorProperty().get(); }
public final double getFixedCellSize() { return fixedCellSizeProperty().get(); } public final DoubleProperty fixedCellSizeProperty() { return fixedCellSize; }
/** * This indicates whether or not the drawer is completely shown. * * @return True if the drawer is totally visible and not transitioning, otherwise false. */ public boolean isOpened() { if (hasMiniSize()) { return resizeTo == getDefaultDrawerSize() || prefSizeProperty.get() >= getDefaultDrawerSize(); } return (translateTo == 0 || translateProperty.get() == 0) && !translateTimer.isRunning(); }
private void tryPartialAnimation(double direction) { if (hasMiniSize()) { if (prefSizeProperty.get() > (getMiniDrawerSize() + getDefaultDrawerSize()) / 2 && prefSizeProperty.get() < getDefaultDrawerSize()) { // show side pane partialOpen(); } else if (prefSizeProperty.get() <= (getMiniDrawerSize() + getDefaultDrawerSize()) / 2) { // hide the sidePane partialClose(); } else if (prefSizeProperty.get() >= getDefaultDrawerSize()) { resizeTo = getDefaultDrawerSize(); overlayPane.setMouseTransparent(!isOverLayVisible()); } } else { if (direction * translateProperty.get() > direction * initTranslate.get() / 2) { if (translateProperty.get() != 0.0) { // show side pane partialOpen(); } } else if (translateProperty.get() != initTranslate.get()) { // hide the sidePane partialClose(); } } }
/** * This indicates whether or not the drawer is in the process of being hidden. * * @return True if the drawer is transitioning from open to closed, otherwise false. */ public boolean isClosing() { boolean condition = hasMiniSize() ? resizeTo == getMiniDrawerSize() : translateTo == initTranslate.get(); return condition && translateTimer.isRunning(); }
/** * This indicates whether or not the drawer is completely hidden. * * @return True if the drawer is hidden and not in the process of transitioning, otherwise false. */ public boolean isClosed() { if (hasMiniSize()) { return resizeTo == getMiniDrawerSize(); } return translateTo == initTranslate.get() && !translateTimer.isRunning(); }
private void updateTempDrawerSize() { if (sizeProperty.get() > getDefaultDrawerSize()) { tempDrawerSize = prefSizeProperty.get(); } else { tempDrawerSize = getDefaultDrawerSize(); } }
private void partialClose() { for (Map.Entry<WritableValue<?>, JFXDrawerKeyValue<?>> entry : initValues.entrySet()) { currentValue.put(entry.getKey(), entry.getValue().getCloseValueSupplier()); } translateTo = initTranslate.get(); resizeTo = getMiniDrawerSize(); translateTimer.setOnFinished(() -> { overlayPane.setMouseTransparent(true); fireEvent(new JFXDrawerEvent(JFXDrawerEvent.CLOSED)); }); getCachePolicy().cache(contentHolder); translateTimer.start(); }
/** * Starts the animation to transition this drawer to closed. */ public void close() { translateTimer.setOnFinished(() -> { overlayPane.setMouseTransparent(true); fireEvent(new JFXDrawerEvent(JFXDrawerEvent.CLOSED)); }); if (hasMiniSize()) { if (resizeTo != getMiniDrawerSize()) { resizeTo = getMiniDrawerSize(); for (Map.Entry<WritableValue<?>, JFXDrawerKeyValue<?>> entry : initValues.entrySet()) { currentValue.put(entry.getKey(), entry.getValue().getCloseValueSupplier()); } } } else { updateTempDrawerSize(); if (translateTo != initTranslate.get()) { translateTo = initTranslate.get(); for (Map.Entry<WritableValue<?>, JFXDrawerKeyValue<?>> entry : initValues.entrySet()) { currentValue.put(entry.getKey(), entry.getValue().getCloseValueSupplier()); } } } getCachePolicy().cache(contentHolder); translateTimer.reverseAndContinue(); }
private double computePaddingSize() { if (!isResizeContent()) { return 0; } if (hasMiniSize()) { return resizeTo; } else if (translateTo == 0 && tempDrawerSize > getDefaultDrawerSize()) { return tempDrawerSize; } else if (translateTo == 0) { return getDefaultDrawerSize(); } else if (translateTo == initTranslate.get()) { return 0; } else { return getDefaultDrawerSize() + getDirection().doubleValue() * translateTo; } }
new KeyFrame(Duration.ZERO, new KeyValue(shadowEffect.radiusProperty(), JFXDepthManager.getShadowAt(2).radiusProperty().get(), Interpolator.EASE_BOTH), new KeyValue(shadowEffect.spreadProperty(), JFXDepthManager.getShadowAt(2).spreadProperty().get(), Interpolator.EASE_BOTH), new KeyValue(shadowEffect.offsetXProperty(), JFXDepthManager.getShadowAt(2).offsetXProperty().get(), Interpolator.EASE_BOTH), new KeyValue(shadowEffect.offsetYProperty(), JFXDepthManager.getShadowAt(2).offsetYProperty().get(), Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), new KeyValue(shadowEffect.radiusProperty(), JFXDepthManager.getShadowAt(5).radiusProperty().get(), Interpolator.EASE_BOTH), new KeyValue(shadowEffect.spreadProperty(), JFXDepthManager.getShadowAt(5).spreadProperty().get(), Interpolator.EASE_BOTH), new KeyValue(shadowEffect.offsetXProperty(), JFXDepthManager.getShadowAt(5).offsetXProperty().get(), Interpolator.EASE_BOTH), new KeyValue(shadowEffect.offsetYProperty(), JFXDepthManager.getShadowAt(5).offsetYProperty().get(), Interpolator.EASE_BOTH)
return prefWidthProperty().get() - actionWidth; }, prefWidthProperty(), actionContainer.widthProperty(), actionContainer.visibleProperty()));