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();
});
}
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);
}
}
});
}
Aggregations