Package javafx.scene

Examples of javafx.scene.Node


        Model hideModel = getWaveBean(wave).getHideModel();
        if (hideModel == null && getWaveBean(wave).getHideModelKey() != null) {
            hideModel = getLocalFacade().getGlobalFacade().getUiFacade().retrieve(getWaveBean(wave).getHideModelKey());
        }

        Node hideNode = null;

        if (hideModel == null) {
            LOGGER.warn("Impossible to dettach a model because hideModel is null");
        } else {
            hideModel.doHideView(wave);
View Full Code Here


                    selectedSlideModel.doShowView(null);
                }

                // Hide all other slides
                if (psm != null) {
                    Node node;
                    for (int i = getView().getRootNode().getChildren().size() - 1; i > 0; i--) {
                        node = getView().getRootNode().getChildren().get(i);
                        if (csm.getRootNode() != node) {
                            getView().getRootNode().getChildren().remove(node);
                        }
View Full Code Here

     */
    @Override
    protected void perform(final Wave wave) {

        // The old node is the one that exists into the parent container (or null if none)
        Node oldNode = getWaveBean(wave).getHideModel() == null ? null : getWaveBean(wave).getHideModel().getRootNode();

        if (oldNode == null) {
            final ObservableList<Node> parentContainer = getWaveBean(wave).getChidrenPlaceHolder();
            oldNode = parentContainer.size() > 1 ? parentContainer.get(getWaveBean(wave).getChidrenPlaceHolder().size() - 1) : null;
        }

        // The new node is the one create by PrepareModelCommand
        final Node newNode = getWaveBean(wave).getShowModel() == null ? null : getWaveBean(wave).getShowModel().getRootNode();

        if (oldNode != null || newNode != null) {
            final ParallelTransition animation = ParallelTransitionBuilder.create()
                    .build();

            if (oldNode != null) {
                animation.getChildren().add(
                        FadeTransitionBuilder.create()
                                .duration(Duration.millis(600))
                                .node(oldNode)
                                .fromValue(1.0)
                                .toValue(0.0)
                                .build());
            }
            if (newNode != null) {
                animation.getChildren().add(
                        FadeTransitionBuilder.create()
                                .duration(Duration.millis(600))
                                .node(newNode)
                                .fromValue(0.0)
                                .toValue(1.0)
                                .build());
            }

            final Node oldNodeLink = oldNode;

            // When animation is finished remove the hidden node from the stack to let only one node at the same time
            animation.setOnFinished(new EventHandler<ActionEvent>() {

                /**
                 * {@inheritDoc}
                 */
                @Override
                public void handle(final ActionEvent arg0) {
                    if (oldNodeLink != null) {
                        // remove the old nod from the stack to hide it
                        getWaveBean(wave).getChidrenPlaceHolder().remove(oldNodeLink);

                        LOGGER.info("Remove " + oldNodeLink.toString() + " from stack container");
                    }
                    // FIXME do it in the right way
                    getWaveBean(wave).getShowModel().doShowView(wave);
                }
            });
View Full Code Here

     */
    @Override
    protected void perform(final Wave wave) {

        // final Pane parentNode = getWaveBean(wave).getParentNode();
        final Node createdNode = getWaveBean(wave).getShowModel().getRootNode();

        if (createdNode == null) {
            LOGGER.warn("Impossible to attach model {} because the created node is null", getWaveBean(wave).getShowModelKey().toString());
        } else {
            if (getWaveBean(wave).getUniquePlaceHolder() != null) {
View Full Code Here

        // initialize the begin properties for the transition
        this.slideContent.setScaleX(0);
        this.slideContent.setScaleY(0);
        this.slideContent.setRotate(-180);

        final Node header = getHeaderPanel();
        // final Node footer = getFooterPanel();

        AnchorPane.setTopAnchor(header, 0.0);
        AnchorPane.setTopAnchor(this.slideContent, 109.0);
        AnchorPane.setLeftAnchor(this.slideContent, 48.0);
View Full Code Here

     * @param vbox the layout node
     * @param item the slide item to add
     */
    protected void addSlideItem(final VBox vbox, final SlideItem item) {

        Node node = null;
        if (item.getLink()) {

            final Hyperlink link = HyperlinkBuilder.create()
                    .opacity(1.0)
                    .text(item.getValue())
                    .build();

            link.getStyleClass().add("link" + item.getLevel());

            link.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(final ActionEvent e) {
                    final ClipboardContent content = new ClipboardContent();
                    content.putString("http://" + ((Hyperlink) e.getSource()).getText());
                    Clipboard.getSystemClipboard().setContent(content);
                }
            });
            node = link;

        } else if (item.getHtml()) {

            final WebView web = WebViewBuilder.create()
                    .fontScale(1.4)
                    // .effect(ReflectionBuilder.create().fraction(0.4).build())
                    .build();
            web.getEngine().loadContent(item.getValue());

            VBox.setVgrow(web, Priority.NEVER);

            node = web; // StackPaneBuilder.create().children(web).style("-fx-border-width:2;-fx-border-color:#000000").build();

        } else if (item.getImage() != null) {

            final Image image = Resources.create(new LocalImage(item.getImage())).get();
            final ImageView imageViewer = ImageViewBuilder.create()
                    .styleClass(ITEM_CLASS_PREFIX + item.getLevel())
                    .image(image)
                    // .effect(ReflectionBuilder.create().fraction(0.9).build())
                    .build();

            node = imageViewer;
        } else {

            final Text text = TextBuilder.create()
                    .styleClass(ITEM_CLASS_PREFIX + item.getLevel())
                    .text(item.getValue() == null ? "" : item.getValue())
                    .build();

            node = text;
        }

        if (item.getStyle() != null) {
            node.getStyleClass().add(item.getStyle());
        }

        if (item.getScale() != 1.0) {
            node.setScaleX(item.getScale());
            node.setScaleY(item.getScale());
        }

        vbox.getChildren().add(node);
    }
View Full Code Here

    public void showSlideStep(final SlideStep slideStep) {

        if (this.subSlides.size() >= getModel().getStepPosition() || this.subSlides.get(getModel().getStepPosition()) == null) {
            addSubSlide(buildDefaultContent(getModel().getContent(slideStep)));
        }
        final Node nextSlide = this.subSlides.get(getModel().getStepPosition());

        if (this.currentSubSlide == null || nextSlide == null) {
            // No Animation
            this.currentSubSlide = nextSlide;
        } else {
View Full Code Here

     * @param node the node built programmatically
     */
    protected void showCustomSlideStep(final Node node) {

        addSubSlide(node);
        final Node nextSlide = this.subSlides.get(getModel().getStepPosition());

        if (this.currentSubSlide == null || nextSlide == null) {
            // No Animation
            this.currentSubSlide = nextSlide;
        } else {
View Full Code Here

                // Manage only JRebirth OnXxxxx annotations
                if (a.annotationType().getName().startsWith(BASE_ANNOTATION_NAME)) {

                    try {
                        // Retrieve the property value
                        final Node node = (Node) property.get(this);

                        // Process the annotation if the node is not null
                        if (node != null && getController() instanceof AbstractController) {
                            addHandler(node, a);
                        }
View Full Code Here

            }
        } catch (final MissingResourceException e) {
            LOGGER.log(MISSING_RESOURCE_BUNDLE, e, bundlePath);
        }

        Node node = null;
        boolean error = false;
        try {
            error = fxmlLoader.getLocation() == null;
            if (error) {
                node = TextBuilder.create().text(FXML_ERROR_NODE_LABEL.getText(fxmlPath)).build();
View Full Code Here

TOP

Related Classes of javafx.scene.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.