Package lighthouse.controls

Examples of lighthouse.controls.ProjectOverviewWidget


        if (contentScrollPane.getVvalue() != contentScrollPane.getVmin()) {
            // Need to scroll to the top before dropping the project widget in.
            scrollToTop().setOnFinished(ev -> slideInNewProject(project));
            return;
        }
        ProjectOverviewWidget projectWidget = buildProjectWidget(project);

        // Hack: Add at the end for the size calculation, then we'll move it to the start after the next frame.
        projectWidget.setVisible(false);
        projectsVBox.getChildren().add(projectWidget);

        // Slide in from above.
        Platform.runLater(() -> {
            double amount = projectWidget.getHeight();
            amount += projectsVBox.getSpacing();
            contentHBox.setTranslateY(-amount);
            TranslateTransition transition = new TranslateTransition(Duration.millis(1500), contentHBox);
            transition.setFromY(-amount);
            transition.setToY(0);
            transition.setInterpolator(new ElasticInterpolator(EasingMode.EASE_OUT));
            transition.setDelay(Duration.millis(1000));
            transition.play();
            // Re-position at the start.
            projectsVBox.getChildren().remove(projectWidget);
            projectsVBox.getChildren().add(0, projectWidget);
            projectWidget.setVisible(true);
        });
    }
View Full Code Here


    }

    private ProjectOverviewWidget buildProjectWidget(Project project) {
        SimpleObjectProperty<LighthouseBackend.ProjectState> state = new SimpleObjectProperty<>(getProjectState(project));
        projectStates.addListener((javafx.beans.InvalidationListener) x -> state.set(getProjectState(project)));
        ProjectOverviewWidget projectWidget = new ProjectOverviewWidget(project,
                Main.backend.makeTotalPledgedProperty(project, UI_THREAD),
                state);
        projectWidget.onCheckStatusChanged(checkStates.get(project));
        checkStates.addListener((MapChangeListener<Project, LighthouseBackend.CheckStatus>) change -> {
            if (change.getKey().equals(project))
                projectWidget.onCheckStatusChanged(change.wasAdded() ? change.getValueAdded() : null);
        });
        projectWidget.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> switchToProject(project));
        return projectWidget;
    }
View Full Code Here

TOP

Related Classes of lighthouse.controls.ProjectOverviewWidget

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.