use of org.vcell.util.Issue.Severity in project vcell by virtualcell.
the class IssueManager method updateIssues0.
/**
* @param immediate update now, skip check of {@link #LAST_DIRTY_MILLISECONDS}
*/
private void updateIssues0(boolean immediate) {
if (vcDocument == null) {
return;
}
if (!immediate) {
if (dirtyTimestamp == 0) {
return;
}
long elapsedTime = System.currentTimeMillis() - dirtyTimestamp;
if (elapsedTime < LAST_DIRTY_MILLISECONDS) {
return;
}
}
try {
VCDocumentDecorator decorator = VCDocumentDecorator.getDecorator(vcDocument);
numErrors = 0;
numWarnings = 0;
ArrayList<Issue> oldIssueList = new ArrayList<Issue>(issueList);
ArrayList<Issue> tempIssueList = new ArrayList<Issue>();
IssueContext issueContext = new ManagerContext();
decorator.gatherIssues(issueContext, tempIssueList);
// vcDocument.gatherIssues(issueContext,tempIssueList);
issueList = new ArrayList<Issue>();
for (Issue issue : tempIssueList) {
if (issue instanceof SimpleBoundsIssue) {
continue;
}
issueList.add(issue);
Severity severity = issue.getSeverity();
if (severity == Issue.Severity.ERROR) {
numErrors++;
} else if (severity == Issue.Severity.WARNING) {
numWarnings++;
}
}
fireIssueEventListener(new IssueEvent(vcDocument, oldIssueList, issueList));
// System.out.println("\n................... update performed .................." + System.currentTimeMillis());
} finally {
dirtyTimestamp = 0;
if (bMoreTime) {
setDirty();
bMoreTime = false;
}
}
}
use of org.vcell.util.Issue.Severity in project vcell by virtualcell.
the class IssueTableModel method getComparator.
@Override
protected Comparator<Issue> getComparator(final int col, final boolean ascending) {
return new Comparator<Issue>() {
public int compare(Issue o1, Issue o2) {
VCDocument vcDocument = (issueManager != null) ? (issueManager.getVCDocument()) : null;
int scale = ascending ? 1 : -1;
switch(col) {
case COLUMN_DESCRIPTION:
{
Severity s1 = o1.getSeverity();
Severity s2 = o2.getSeverity();
if (s1 == s2) {
return scale * o1.getMessage().compareTo(o2.getMessage());
} else {
return scale * s1.compareTo(s2);
}
}
case COLUMN_URL:
{
String u1 = o1.getHyperlink();
String u2 = o2.getHyperlink();
return u1 != null ? u1.compareTo(u2) : -1;
}
case COLUMN_SOURCE:
return scale * getSourceObjectDescription(vcDocument, o1).compareTo(getSourceObjectDescription(vcDocument, o2));
case COLUMN_PATH:
return scale * getSourceObjectPathDescription(vcDocument, o1).compareTo(getSourceObjectPathDescription(vcDocument, o2));
}
return 0;
}
};
}
use of org.vcell.util.Issue.Severity in project vcell by virtualcell.
the class IssueTableModel method refreshData.
void refreshData() {
List<Issue> issueList = null;
if (issueManager != null) {
List<Issue> allIssueList = issueManager.getIssueList();
issueList = new ArrayList<Issue>();
for (Issue issue : allIssueList) {
Severity severity = issue.getSeverity();
if (severity == Issue.Severity.ERROR) {
issueList.add(issue);
}
}
if (bShowWarning) {
for (Issue issue : allIssueList) {
Severity severity = issue.getSeverity();
if (severity == Issue.Severity.WARNING) {
issueList.add(issue);
}
}
}
}
setData(issueList);
GuiUtils.flexResizeTableColumns(ownerTable);
}
Aggregations