App

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

DrawBgnCommand.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
13 public class DrawBgnCommand extends AppCommand {
14
15 BrushLikeToolActionData data;
16
22 public DrawBgnCommand(int x, int y) {
23 data = new BrushLikeToolActionData(Action.DRAW_BEGIN, x, y);
24 }
25
26 @Override
27 protected void action(AppCore target) {
28 synchronized (this) { // Uspání zde dříve nebylo, ale to byla asi chyba...
29 target.getRenderer().susepnd(this); // možná zbytečné...
30 try {
31 this.wait();
32 } catch (InterruptedException e) {
33 }
34 try {
35 target.getTool().applyTo(target.getImg(), data);
36 } finally {
37 target.getRenderer().wake(this);
38 target.getRenderer().render(); // Optimalizovat, jake se bude volat renderovani, rozhoduje o tom RenderingTask
39 }
40 }
41 }
42 }