|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object erland.game.tileadventure.MapEditor erland.game.tileadventure.TileMapEditor
public abstract class TileMapEditor
Field Summary | |
---|---|
protected BlockContainerData |
cont
Block container for the editor area |
protected BlockContainerData |
contPalette
Block container for the block select area |
protected ParameterSerializable |
extendedLevelInfo
Extended information about the currently edited level/block |
protected ENumberSpinner |
heightLevelSpinner
Spinner that changes the current height level edited |
protected int |
levelNo
Currently edited level/block number |
protected ENumberSpinner |
levelNoSpinner
Spinner that changes the current level/block edited |
protected MapObjectContainerInterface |
mapBlocks
Blocks in the editor area |
protected MapObjectContainerInterface |
paletteBlocks
Blocks in the select block area |
Fields inherited from class erland.game.tileadventure.MapEditor |
---|
BUTTON_EXIT, BUTTON_LOAD, BUTTON_SAVE |
Constructor Summary | |
---|---|
TileMapEditor()
|
Method Summary | |
---|---|
protected MapObjectInterface |
cloneBlock(MapObjectInterface block,
IrregularBlockContainerInterface cont,
int x,
int y,
int z)
Clone specified block |
void |
drawHoveringFrame(Graphics g,
int posX,
int posY)
|
void |
drawSelectedFrame(Graphics g,
MapObjectInterface selectedBlock)
|
protected ParameterSerializable |
getExtendedLevelInfo()
Get extended information about the currently edited level/block |
protected int |
getFirstPaletteBlock()
Get block number of the first block in the select block area |
protected String |
getHeightLabelText()
Get the text that should be shown to the user that indicates which height level of the map that is currently edited, for example "Height:" If this method returns null, no height spinner will be visible |
protected abstract String |
getLevelFileGroupLabel()
Get the name that is used for the currently edited object type when it is stored to file, for example "level" |
protected abstract String |
getLevelFileLabel()
Get the name that is used for a list of the currently edited object type when it is stored to file, for example "levels" |
protected String |
getLevelLabelText()
Get the text that should be shown to the user that indicates what short of object this editor makes it possible for the user to edit, for example "Level:" |
protected abstract LevelManager |
getLevelManager()
Gets the level manager or create a new one if it does not already exist |
protected int |
getLevelNo()
Get currently edited level/block |
protected abstract Image |
getMapBlockImage()
Get an image which is based on subimages of all blocks in the block select area |
protected MapObjectContainerInterface |
getMapBlocks()
Get matrix with all blocks in the map |
protected IrregularBlockContainerInterface |
getMapContainer()
Get block container for the map area |
protected int |
getMapPosZ()
|
protected int |
getMaxHeight()
Get the maximum height levels of blocks |
protected int |
getMaxLevel()
Get the maximum allowed number of levels/blocks |
protected int |
getNoOfPaletteBlocks()
Get the number of blocks in the select block area |
protected MapObjectInterface |
getPaletteBlock(int blockNo)
Get a new block based on the specified block from the select block area |
protected MapObjectContainerInterface |
getPaletteBlocks()
Get matrix with all blocks in the block selection area |
protected IrregularBlockContainerInterface |
getPaletteContainer()
Get block container for the block selection area |
protected abstract int |
getSelectSizeX()
Get the horizontal number of blocks in the select block area |
protected abstract int |
getSelectSizeY()
Get the vertical number of blocks in the select block area |
protected abstract int |
getSizeX()
Get the horizontal number of blocks in main editor area |
protected abstract int |
getSizeY()
Get the vertical number of blocks in the main editor area |
protected abstract int |
getSizeZ()
Get the height number of blocks in the main editor area |
void |
init(GameEnvironmentInterface environment)
|
protected void |
initButtons(EPanel panel)
Create and initialize all buttons |
protected void |
initHeightChangeButtons(EPanel panel)
Creates buttons for changing currently edited height level |
protected void |
initLevelChangeButtons(EPanel panel)
Creates buttons for changing currently edited level/blocks |
protected boolean |
isEmptyAllowed()
Checks if it is allowed to have positions in the map without any block |
protected void |
loadButton()
Called when the standard load button is pressed, a new map should be loaded |
protected MapObjectContainerInterface |
prepareAfterLoad(MapObjectContainerInterface blocks)
Prepare the map container after loading new map data |
protected MapObjectContainerInterface |
prepareForSave(MapObjectContainerInterface blocks)
Prepare the map container for save |
protected void |
saveButton(MapObjectContainerInterface blocks)
Called when the standard save button is pressed, the current blocks in the map area should be saved to the map |
protected void |
setExtendedLevelInfo(ParameterSerializable info)
Set the extended information for the currently edited level/block |
protected void |
updateBlocks()
Update all blocks |
Methods inherited from class erland.game.tileadventure.MapEditor |
---|
clickedMapBlock, clickedSelectBlock, draw, drawBlock, drawFinish, drawMapBlocks, drawPaletteBlocks, exit, exitButton, exitFinish, getDefaultButtons, getEnvironment, getPalettePosZ, hoverMapBlock, initButtonPanel, initDefaultButtons, initFinish, isExit, leftMouseDragged, leftMousePressed, mouseHovering, prepareNewBlock, setCheatmode, setMapBlock, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected BlockContainerData cont
protected BlockContainerData contPalette
protected MapObjectContainerInterface mapBlocks
protected MapObjectContainerInterface paletteBlocks
protected ENumberSpinner levelNoSpinner
protected int levelNo
protected ParameterSerializable extendedLevelInfo
protected ENumberSpinner heightLevelSpinner
Constructor Detail |
---|
public TileMapEditor()
Method Detail |
---|
public void init(GameEnvironmentInterface environment)
init
in interface GamePanelInterface
init
in class MapEditor
protected abstract String getLevelFileLabel()
protected abstract String getLevelFileGroupLabel()
protected abstract int getSizeX()
protected abstract int getSizeY()
protected abstract int getSizeZ()
protected abstract int getSelectSizeX()
protected abstract int getSelectSizeY()
protected abstract Image getMapBlockImage()
protected IrregularBlockContainerInterface getMapContainer()
MapEditor
getMapContainer
in class MapEditor
protected IrregularBlockContainerInterface getPaletteContainer()
MapEditor
getPaletteContainer
in class MapEditor
protected MapObjectInterface getPaletteBlock(int blockNo)
blockNo
- Block number of the block to get
protected int getFirstPaletteBlock()
protected int getNoOfPaletteBlocks()
protected MapObjectContainerInterface getPaletteBlocks()
MapEditor
getPaletteBlocks
in class MapEditor
protected MapObjectContainerInterface getMapBlocks()
MapEditor
getMapBlocks
in class MapEditor
protected MapObjectInterface cloneBlock(MapObjectInterface block, IrregularBlockContainerInterface cont, int x, int y, int z)
MapEditor
cloneBlock
in class MapEditor
block
- Block to clonecont
- Block container to put new block inx
- X position to put new block aty
- Y position to put new block atz
- Z position to put new block at
protected boolean isEmptyAllowed()
MapEditor
isEmptyAllowed
in class MapEditor
protected String getLevelLabelText()
protected String getHeightLabelText()
protected int getMaxHeight()
protected int getMaxLevel()
protected void initLevelChangeButtons(EPanel panel)
panel
- protected void initHeightChangeButtons(EPanel panel)
panel
- protected void initButtons(EPanel panel)
MapEditor
initButtons
in class MapEditor
panel
- EPanel to put buttons onprotected int getLevelNo()
protected ParameterSerializable getExtendedLevelInfo()
protected void setExtendedLevelInfo(ParameterSerializable info)
info
- Extended level/block informationprotected MapObjectContainerInterface prepareForSave(MapObjectContainerInterface blocks)
blocks
- The map container with all the blocks
protected void saveButton(MapObjectContainerInterface blocks)
MapEditor
saveButton
in class MapEditor
blocks
- The blocks in the map areaprotected MapObjectContainerInterface prepareAfterLoad(MapObjectContainerInterface blocks)
blocks
- The map container with all the blocks
protected void loadButton()
MapEditor
loadButton
in class MapEditor
protected void updateBlocks()
MapEditor
updateBlocks
in class MapEditor
protected int getMapPosZ()
getMapPosZ
in class MapEditor
protected abstract LevelManager getLevelManager()
public void drawSelectedFrame(Graphics g, MapObjectInterface selectedBlock)
drawSelectedFrame
in class MapEditor
public void drawHoveringFrame(Graphics g, int posX, int posY)
drawHoveringFrame
in class MapEditor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |