use of org.netbeans.swing.outline.OutlineModel in project gephi by gephi.
the class ReportPanel method fillIssues.
private void fillIssues(Report report) {
final List<Issue> issues = new ArrayList<>();
Iterator<Issue> itr = report.getIssues(ISSUES_LIMIT);
while (itr.hasNext()) {
issues.add(itr.next());
}
if (issues.isEmpty()) {
JLabel label = new JLabel(NbBundle.getMessage(getClass(), "ReportPanel.noIssues"));
label.setHorizontalAlignment(SwingConstants.CENTER);
tab1ScrollPane.setViewportView(label);
} else {
//Busy label
final BusyUtils.BusyLabel busyLabel = BusyUtils.createCenteredBusyLabel(tab1ScrollPane, "Retrieving issues...", issuesOutline);
//Thread
Thread thread = new Thread(fillingThreads, new Runnable() {
@Override
public void run() {
busyLabel.setBusy(true);
final TreeModel treeMdl = new IssueTreeModel(issues);
final OutlineModel mdl = DefaultOutlineModel.createOutlineModel(treeMdl, new IssueRowModel(), true);
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
issuesOutline.setRootVisible(false);
issuesOutline.setRenderDataProvider(new IssueRenderer());
issuesOutline.setModel(mdl);
busyLabel.setBusy(false);
}
});
}
}, "Report Panel Issues Outline");
if (NbPreferences.forModule(ReportPanel.class).getBoolean(SHOW_ISSUES, true)) {
thread.start();
}
}
}
Aggregations