App
CancelableToolCommitCommand.java
Go to the documentation of this file.
1 package mhr.appcore.commands.toolcommands;
2 
3 import mhr.appcore.AppCore;
4 import mhr.appcore.commands.AppCommand;
5 import mhr.appcore.tools.actiondata.BrushLikeToolActionData;
6 import mhr.appcore.tools.actiondata.BrushLikeToolActionData.Action;
7 import mhr.appcore.tools.actiondata.CancelableToolActionData;
8 import mhr.appcore.utils.NotImplementedException;
9 
14 
16 
18  this.data = data;
19  }
20 
21  @Override
22  protected void action(AppCore target) {
23  synchronized (this) {
24  target.getRenderer().susepnd(this);
25  try {
26  this.wait();
27  } catch (InterruptedException e) {
28 
29  }
30  try {
31  target.getTool().applyTo(target.getImg(), data);
32  } finally {
33  target.getRenderer().wake(this);
34  target.getRenderer().render();
35  }
36  }
37  }
38 }