Search in sources :

Example 6 with PluginReport

use of au.gov.asd.tac.constellation.plugins.reporting.PluginReport in project constellation by constellation-app.

the class PluginReporterPane method updateReports.

/**
 * Update the reports shown in the report box to reflect those recorded
 * against the current graph.
 *
 * @param refresh
 */
private void updateReports(boolean refresh) {
    Platform.runLater(() -> {
        if (refresh) {
            nextReport = nextReport > MAXIMUM_REPORT_PANES ? nextReport - MAXIMUM_REPORT_PANES : 0;
            // remove the listeners before clearing the PluginReportPane's
            for (int i = 0; i < reportBox.getChildren().size(); i++) {
                ((PluginReportPane) reportBox.getChildren().get(i)).removeListener();
            }
            reportBox.getChildren().clear();
        }
        if (graphReport != null) {
            while (nextReport < graphReport.getPluginReports().size()) {
                PluginReport pluginReport = graphReport.getPluginReports().get(nextReport++);
                if ((pluginReportFilter == null || pluginReportFilter.includePluginReport(pluginReport)) && !pluginReport.containsAllTags(filteredTags)) {
                    PluginReportPane reportPane = new PluginReportPane(this, pluginReport, filteredTags, pluginReportFilter);
                    reportBox.getChildren().add(reportPane);
                    reportPane.updateChildren();
                }
            }
            // TODO: do a better job here of not adding older reports in the first place. The idea here was to reduce memory so this logic is less useful of adding and removing.
            // remove the oldest one if we have reached the maximum
            final int size = reportBox.getChildren().size();
            if (size > MAXIMUM_REPORT_PANES) {
                ((PluginReportPane) reportBox.getChildren().get(size - MAXIMUM_REPORT_PANES)).removeListener();
                reportBox.getChildren().remove(size - MAXIMUM_REPORT_PANES);
            }
        }
        updateTags();
    });
}
Also used : PluginReport(au.gov.asd.tac.constellation.plugins.reporting.PluginReport)

Example 7 with PluginReport

use of au.gov.asd.tac.constellation.plugins.reporting.PluginReport in project constellation by constellation-app.

the class PluginReportPane method updateChildren.

/**
 * Updates the UI to reflect any new child plugin reports that have been
 * added to this plugin report since the UI was last updated.
 */
public void updateChildren() {
    Platform.runLater(() -> {
        synchronized (PluginReportPane.this) {
            while (nextChild < pluginReport.getUChildReports().size()) {
                PluginReport childReport = pluginReport.getUChildReports().get(nextChild++);
                BorderPane borderPane = new BorderPane();
                if ((pluginReportFilter == null || pluginReportFilter.includePluginReport(childReport)) && !childReport.containsAllTags(filteredTags)) {
                    PluginReportPane childPane = new PluginReportPane(reporterPane, childReport, filteredTags, pluginReportFilter);
                    Pane paddingPane = new Pane();
                    paddingPane.setPrefWidth(20);
                    paddingPane.setMinWidth(USE_PREF_SIZE);
                    paddingPane.setMaxWidth(USE_PREF_SIZE);
                    borderPane.setLeft(paddingPane);
                    borderPane.setCenter(childPane);
                }
                sequencePane.getChildren().add(borderPane);
            }
        }
    });
}
Also used : BorderPane(javafx.scene.layout.BorderPane) PluginReport(au.gov.asd.tac.constellation.plugins.reporting.PluginReport) GridPane(javafx.scene.layout.GridPane) Pane(javafx.scene.layout.Pane) BorderPane(javafx.scene.layout.BorderPane)

Aggregations

PluginReport (au.gov.asd.tac.constellation.plugins.reporting.PluginReport)7 GraphReport (au.gov.asd.tac.constellation.plugins.reporting.GraphReport)5 PluginException (au.gov.asd.tac.constellation.plugins.PluginException)4 PluginInteraction (au.gov.asd.tac.constellation.plugins.PluginInteraction)4 ExecutionException (java.util.concurrent.ExecutionException)4 PluginGraphs (au.gov.asd.tac.constellation.plugins.PluginGraphs)2 DualGraph (au.gov.asd.tac.constellation.graph.locking.DualGraph)1 PluginSynchronizer (au.gov.asd.tac.constellation.plugins.PluginSynchronizer)1 BorderPane (javafx.scene.layout.BorderPane)1 GridPane (javafx.scene.layout.GridPane)1 Pane (javafx.scene.layout.Pane)1 BeforeMethod (org.testng.annotations.BeforeMethod)1