protected void initNode(Node node) { node.setScaleX(0); node.setScaleY(0); node.getStyleClass().add("sub-node"); } }
@Override public void initAnimation(Node contentContainer, Node overlay) { overlay.setOpacity(0); contentContainer.setScaleX(0); contentContainer.setScaleY(0); }
private BiFunction<Boolean, Duration, Collection<KeyFrame>> initDefaultAnimation(Node child) { return (expanded, duration) -> { ArrayList<KeyFrame> frames = new ArrayList<>(); frames.add(new KeyFrame(duration, event -> { child.setScaleX(expanded ? 1 : 0); child.setScaleY(expanded ? 1 : 0); }, new KeyValue(child.scaleXProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH), new KeyValue(child.scaleYProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH) )); return frames; }; }
OpenWithDialog initFor(InputPdfArgumentsLoadRequest event) { this.messageTitle .setText(DefaultI18nContext.getInstance().i18n("Select the task to perform on the following files")); filesList .setItems(FXCollections.observableArrayList(event.pdfs.stream().map(Path::toString).collect(toList()))); modules.forEach(m -> { if (m.descriptor().hasInputType(event.requiredInputTyle())) { Button current = new Button(m.descriptor().getName()); current.getStyleClass().addAll(Style.FOOTER_BUTTON.css()); Optional.ofNullable(m.graphic()).ifPresent(g -> { g.setScaleX(0.7); g.setScaleY(0.7); current.setGraphic(g); }); current.setOnAction((e) -> { eventStudio().broadcast(new ClearModuleEvent(), m.id()); eventStudio().broadcast(activeteModule(m.id())); hide(); PdfLoadRequestEvent loadEvent = new PdfLoadRequestEvent(m.id()); event.pdfs.stream().map(Path::toFile).map(PdfDocumentDescriptor::newDescriptorNoPassword) .forEach(loadEvent::add); eventStudio().broadcast(loadEvent, m.id()); }); buttons.getChildren().add(current); } }); return this; }
protected void initNode(Node node) { node.setScaleX(0); node.setScaleY(0); node.getStyleClass().add("sub-node"); } }
@Override public void initAnimation(Node contentContainer, Node overlay) { overlay.setOpacity(0); contentContainer.setScaleX(0); contentContainer.setScaleY(0); }
private BiFunction<Boolean, Duration, Collection<KeyFrame>> initDefaultAnimation(Node child) { return (expanded, duration) -> { ArrayList<KeyFrame> frames = new ArrayList<>(); frames.add(new KeyFrame(duration, event -> { child.setScaleX(expanded ? 1 : 0); child.setScaleY(expanded ? 1 : 0); }, new KeyValue(child.scaleXProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH), new KeyValue(child.scaleYProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH) )); return frames; }; }
/** * Inits the sprite. * * @param aSprite the sprite * @param aCheckerboard the checkerboard * @param <N> The type of the sprite to be used. * @return the node */ protected <N extends Node> N toInitNode( N aSprite, FxCheckerboardViewer<?, ?> aCheckerboard ) { double theScaleX = getScaleX( aSprite, aCheckerboard ) - (1 - _scaleFactor); double theScaleY = getScaleY( aSprite, aCheckerboard ) - (1 - _scaleFactor); double theScale = theScaleX > theScaleY ? theScaleX : theScaleY; aSprite.setScaleX( theScale ); aSprite.setScaleY( theScale ); aSprite.setOpacity( getOpacity() ); return aSprite; }
/** * Inits the sprite. * * @param aSprite the sprite * @param aScale The scale between 0 and 1. * @param aCheckerboard the checkerboard. * @param <N> The type of the sprite to be used. * @return the node */ protected <N extends Node> N toInitNode( double aScale, N aSprite, FxCheckerboardViewer<?, ?> aCheckerboard ) { double theScaleX = getScaleX( aSprite, aCheckerboard ) - (1 - _scaleFactor); double theScaleY = getScaleY( aSprite, aCheckerboard ) - (1 - _scaleFactor); double theScale = theScaleX > theScaleY ? theScaleX : theScaleY; aSprite.setScaleX( theScale * aScale ); aSprite.setScaleY( theScale * aScale ); aSprite.setOpacity( getOpacity() ); return aSprite; }
/** * Fx scale player. * * @param aPlayer the player * @param aFieldDimension the field dimension * @param aPrecedingFieldDimension the preceding field dimension */ private void fxScalePlayer( P aPlayer, FieldDimension aFieldDimension, FieldDimension aPrecedingFieldDimension ) { Node theSprite; synchronized ( _playerToSprite ) { theSprite = _playerToSprite.get( aPlayer ); } theSprite.setScaleX( aFieldDimension.getFieldWidth() / theSprite.getBoundsInLocal().getWidth() ); theSprite.setScaleY( aFieldDimension.getFieldHeight() / theSprite.getBoundsInLocal().getHeight() ); double theLayoutX = (aFieldDimension.getFieldWidth() - theSprite.getBoundsInLocal().getWidth()) / 2; double theLayoutY = (aFieldDimension.getFieldHeight() - theSprite.getBoundsInLocal().getHeight()) / 2; theSprite.setLayoutX( theLayoutX ); theSprite.setLayoutY( theLayoutY ); theSprite.setTranslateX( toPixelPositionX( aPlayer ) ); theSprite.setTranslateY( toPixelPositionY( aPlayer ) ); }