Java Code Examples for javax.swing.plaf.TextUI#damageRange()

The following examples show how to use javax.swing.plaf.TextUI#damageRange() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SnippetHighlighter.java    From littleluck with Apache License 2.0 6 votes vote down vote up
/**
 * Executes range(s) damage and cleans range queue.
 */
public synchronized void run() {
    if (component != null) {
        TextUI mapper = component.getUI();
        if (mapper != null && lastDoc == component.getDocument()) {
            // the Document should be the same to properly
            // display highlights
            int len = p0.size();
            for (int i = 0; i < len; i++){
                mapper.damageRange(component,
                        p0.get(i).getOffset(),
                        p1.get(i).getOffset());
            }
        }
    }
    p0.clear();
    p1.clear();

    // release reference
    lastDoc = null;
}
 
Example 2
Source File: SnippetHighlighter.java    From beautyeye with Apache License 2.0 6 votes vote down vote up
/**
 * Executes range(s) damage and cleans range queue.
 */
public synchronized void run() {
    if (component != null) {
        TextUI mapper = component.getUI();
        if (mapper != null && lastDoc == component.getDocument()) {
            // the Document should be the same to properly
            // display highlights
            int len = p0.size();
            for (int i = 0; i < len; i++){
                mapper.damageRange(component,
                        p0.get(i).getOffset(),
                        p1.get(i).getOffset());
            }
        }
    }
    p0.clear();
    p1.clear();

    // release reference
    lastDoc = null;
}
 
Example 3
Source File: SnippetHighlighter.java    From Darcula with Apache License 2.0 6 votes vote down vote up
/**
 * Executes range(s) damage and cleans range queue.
 */
public synchronized void run() {
    if (component != null) {
        TextUI mapper = component.getUI();
        if (mapper != null && lastDoc == component.getDocument()) {
            // the Document should be the same to properly
            // display highlights
            int len = p0.size();
            for (int i = 0; i < len; i++){
                mapper.damageRange(component,
                        p0.get(i).getOffset(),
                        p1.get(i).getOffset());
            }
        }
    }
    p0.clear();
    p1.clear();

    // release reference
    lastDoc = null;
}