forked from daveyliam/mapwriter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMergeTask.java
More file actions
42 lines (34 loc) · 1.07 KB
/
MergeTask.java
File metadata and controls
42 lines (34 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package mapwriter;
import java.io.File;
import mapwriter.region.MergeToImage;
import mapwriter.region.RegionManager;
public class MergeTask extends Task {
final RegionManager regionManager;
final File outputDir;
final String basename;
final int x, z, w, h, dimension;
String msg = "";
public MergeTask(RegionManager regionManager, int x, int z, int w, int h, int dimension, File outputDir, String basename) {
this.regionManager = regionManager;
this.x = x;
this.z = z;
this.w = w;
this.h = h;
this.dimension = dimension;
this.outputDir = outputDir;
this.basename = basename;
}
@Override
public void run() {
int count = MergeToImage.merge(this.regionManager, this.x, this.z, this.w, this.h, this.dimension, this.outputDir, this.basename);
if (count > 0) {
this.msg = String.format("successfully wrote merged images to %s/%s.*.*.png", this.outputDir, this.basename);
} else {
this.msg = String.format("merge error: could not write images to %s", this.outputDir);
}
}
@Override
public void onComplete() {
MwUtil.printBoth(this.msg);
}
}