Search in sources :

Example 1 with VCDocumentDecorator

use of cbit.vcell.client.desktop.VCDocumentDecorator 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;
        }
    }
}
Also used : SimpleBoundsIssue(cbit.vcell.model.SimpleBoundsIssue) Issue(org.vcell.util.Issue) VCDocumentDecorator(cbit.vcell.client.desktop.VCDocumentDecorator) SimpleBoundsIssue(cbit.vcell.model.SimpleBoundsIssue) ArrayList(java.util.ArrayList) IssueContext(org.vcell.util.IssueContext) Severity(org.vcell.util.Issue.Severity)

Aggregations

VCDocumentDecorator (cbit.vcell.client.desktop.VCDocumentDecorator)1 SimpleBoundsIssue (cbit.vcell.model.SimpleBoundsIssue)1 ArrayList (java.util.ArrayList)1 Issue (org.vcell.util.Issue)1 Severity (org.vcell.util.Issue.Severity)1 IssueContext (org.vcell.util.IssueContext)1