mirror of
https://github.com/processing/processing4.git
synced 2026-02-11 17:40:48 +01:00
notes on text modified
This commit is contained in:
@@ -264,13 +264,13 @@ public class ASTGenerator {
|
||||
|
||||
protected void done() {
|
||||
if (codeTree != null) {
|
||||
if (jtree.hasFocus() || frame2.hasFocus())
|
||||
return;
|
||||
jtree.setModel(new DefaultTreeModel(codeTree));
|
||||
((DefaultTreeModel) jtree.getModel()).reload();
|
||||
if (!frame2.isVisible()) {
|
||||
frame2.setVisible(true);
|
||||
}
|
||||
// if (jtree.hasFocus() || frame2.hasFocus())
|
||||
// return;
|
||||
// jtree.setModel(new DefaultTreeModel(codeTree));
|
||||
// ((DefaultTreeModel) jtree.getModel()).reload();
|
||||
// if (!frame2.isVisible()) {
|
||||
// frame2.setVisible(true);
|
||||
// }
|
||||
// if (!frameAutoComp.isVisible()) {
|
||||
//
|
||||
// frameAutoComp.setVisible(true);
|
||||
@@ -288,7 +288,7 @@ public class ASTGenerator {
|
||||
// .getY(), 450, 600));
|
||||
// jdocWindow.setVisible(true);
|
||||
// }
|
||||
jtree.validate();
|
||||
// jtree.validate();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -286,7 +286,13 @@ public class ErrorCheckerService implements Runnable{
|
||||
}
|
||||
|
||||
protected ASTGenerator astGenerator;
|
||||
private AtomicInteger textModified = new AtomicInteger();
|
||||
/**
|
||||
* This thing acts as an event queue counter of sort.
|
||||
* Since error checking happens on demand, anytime this counter
|
||||
* goes above 0, error check is triggered, and counter reset.
|
||||
* It's thread safe to avoid any mess.
|
||||
*/
|
||||
protected AtomicInteger textModified = new AtomicInteger();
|
||||
|
||||
/**
|
||||
* Triggers error check
|
||||
@@ -332,12 +338,12 @@ public class ErrorCheckerService implements Runnable{
|
||||
updatePaintedThingys();
|
||||
int x = textModified.get();
|
||||
//log("TM " + x);
|
||||
if(x>=3){
|
||||
textModified.set(3);
|
||||
x = 3;
|
||||
if (x >= 2) {
|
||||
textModified.set(2);
|
||||
x = 2;
|
||||
}
|
||||
|
||||
if(x>0)
|
||||
|
||||
if (x > 0)
|
||||
textModified.set(x - 1);
|
||||
else
|
||||
textModified.set(0);
|
||||
|
||||
Reference in New Issue
Block a user