edu.rice.cs.drjava.ui
Class ReverseHighlighter.SafeDamager

java.lang.Object
  extended by edu.rice.cs.drjava.ui.ReverseHighlighter.SafeDamager
All Implemented Interfaces:
Runnable
Enclosing class:
ReverseHighlighter

 class ReverseHighlighter.SafeDamager
extends Object
implements Runnable

This class invokes mapper.damageRange in EventDispatchThread. The only one instance per Highlighter is cretaed. When a number of ranges should be damaged it collects them into queue and damages them in consecutive order in run call.


Field Summary
private  Document lastDoc
           
private  ArrayList<Position> p0
           
private  ArrayList<Position> p1
           
 
Constructor Summary
ReverseHighlighter.SafeDamager()
           
 
Method Summary
 void damageRange(Position pos0, Position pos1)
          Adds range to be damaged to the range queue.
 void run()
          Executes range(s) damage and cleans range queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

p0

private ArrayList<Position> p0

p1

private ArrayList<Position> p1

lastDoc

private Document lastDoc
Constructor Detail

ReverseHighlighter.SafeDamager

ReverseHighlighter.SafeDamager()
Method Detail

run

public void run()
Executes range(s) damage and cleans range queue.

Specified by:
run in interface Runnable

damageRange

public void damageRange(Position pos0,
                        Position pos1)
Adds range to be damaged to the range queue. If the range queue is empty (the first call or run() was already invoked) then adds this class instance into EventDispatch queue. The method also tracks if the current document changed or component is null. In this case it removes all ranges added before from range queue.