1 package erland.game.tileadventure;
2
3 import java.awt.*;
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 public class RoomMapEditor extends TileMapEditor {
25 /*** The draw map implementation to use */
26 protected DrawMap drawMap;
27 /*** The level manager to use */
28 protected LevelManager levelManager;
29 /*** The level manager to use for palette bitmap */
30 protected LevelManager paletteLevelManager;
31 /*** The palette bitmap */
32 protected Image paletteBitmap;
33
34 protected String getLevelFileLabel() {
35 return null;
36 }
37
38 protected String getLevelFileGroupLabel() {
39 return null;
40 }
41
42 protected int getSizeX() {
43 return 10;
44 }
45
46 protected int getSizeY() {
47 return 10;
48 }
49 protected int getSizeZ() {
50 return 10;
51 }
52
53 protected int getSelectSizeX() {
54 return 2;
55 }
56
57 protected int getSelectSizeY() {
58 return 10;
59 }
60
61 protected Image getMapBlockImage() {
62 if(paletteBitmap==null) {
63 paletteBitmap = paletteLevelManager.getImage();
64 }
65 return paletteBitmap;
66 }
67
68 public void drawMapBlocks(Graphics g, MapObjectContainerInterface blocks) {
69 drawMap.setContainer(getMapContainer());
70 drawMap.removeAllObjectMaps();
71 drawMap.addObjectMap(blocks);
72 drawMap.draw(g);
73 }
74
75 protected LevelManager getLevelManager()
76 {
77 levelManager.setContainer(getMapContainer());
78 return levelManager;
79 }
80
81 protected void initFinish() {
82 super.initFinish();
83 drawMap = ((TileGameEnvironmentInterface)getEnvironment().getCustomEnvironment()).createBlockMap();
84 levelManager = new RoomEditorLevelManager();
85 levelManager.init(getEnvironment());
86 paletteLevelManager = new MapObjectEditorLevelManager();
87 paletteLevelManager.init(getEnvironment());
88 paletteBitmap = null;
89 }
90 }