Class AbstractMapViewSettings
- java.lang.Object
-
- net.sf.gridarta.model.mapviewsettings.AbstractMapViewSettings
-
- All Implemented Interfaces:
MapViewSettings
- Direct Known Subclasses:
DefaultMapViewSettings
public abstract class AbstractMapViewSettings extends java.lang.Object implements MapViewSettings
Abstract base class forMapViewSettingsimplementations.
-
-
Constructor Summary
Constructors Constructor Description AbstractMapViewSettings()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddMapViewSettingsListener(@NotNull MapViewSettingsListener listener)Register a MapViewSettingsListener.voidclearAlpha()Clear the transparency.intgetEditType()Returns the currently set edit type.booleanisAlphaType(int v)Returns whether the specified edit type is to be shown transparent.booleanisAutojoin()Returns whether "autojoin" is enabled.booleanisDoubleFaces()Get whether double faces are drawn double height.booleanisEditType(int editType)Get information on the current state of edit type.booleanisEditType(@NotNull BaseObject<?,?,?,?> gameObject)Get information whether the gameObject is edited.booleanisEditTypeSet()Returns whether a editType value is set so that not all squares are displayed.booleanisGridVisible()Get the visibility of the grid.booleanisLightVisible()Get the visibility of the light.booleanisSmoothing()Returns the smoothing setting.booleanisTileStretching()Returns the tile-stretching setting.protected abstract intloadAlphaType()Loads the default value foralphaType.protected abstract booleanloadAutojoin()Loads the default value forautojoin.protected abstract booleanloadDoubleFaces()Loads the default value fordoubleFaces.protected abstract intloadEditType()Loads the default value foreditType.protected abstract booleanloadGridVisible()Loads the default value forgridVisible.protected abstract booleanloadLightVisible()Loads the default value forlightVisible.protected abstract booleanloadSmoothing()Loads the default value forsmoothing.protected abstract booleanloadTileStretching()Loads the default value fortileStretching.voidremoveMapViewSettingsListener(@NotNull MapViewSettingsListener listener)Unregister a MapViewSettingsListener.protected abstract voidsaveAlphaType(int alphaType)Saves thealphaTypevalue.protected abstract voidsaveAutojoin(boolean autojoin)Saves the autojoin value.protected abstract voidsaveDoubleFaces(boolean doubleFaces)Saves thedoubleFacesvalue.protected abstract voidsaveGridVisible(boolean gridVisible)Saves thegridVisiblevalue.protected abstract voidsaveLightVisible(boolean lightVisible)Saves thelightVisiblevalue.protected abstract voidsaveSmoothing(boolean smoothing)Saves thesmoothingvalue.protected abstract voidsaveTileStretching(boolean tileStretching)Saves thetileStretchingvalue.voidsetAlphaType(int v, boolean state)Sets whether the specified edit type is to be shown transparent.voidsetAutojoin(boolean autojoin)Sets the "autojoin" state.voidsetDoubleFaces(boolean doubleFaces)Sets whether double faces should be drawn double height.voidsetGridVisible(boolean gridVisible)Set the visibility of the grid.voidsetLightVisible(boolean lightVisible)Set the visibility of the light.voidsetSmoothing(boolean smoothing)Sets the smoothing setting.voidsetTileStretching(boolean tileStretching)Sets the tile-stretching setting.voidtoggleEditType(int editType)Toggle an edit type.voidunsetEditType(int editType)Set the map view to hide squares of the given type.
-
-
-
Method Detail
-
addMapViewSettingsListener
public void addMapViewSettingsListener(@NotNull @NotNull MapViewSettingsListener listener)Description copied from interface:MapViewSettingsRegister a MapViewSettingsListener.- Specified by:
addMapViewSettingsListenerin interfaceMapViewSettings- Parameters:
listener- MapViewSettingsListener to register
-
removeMapViewSettingsListener
public void removeMapViewSettingsListener(@NotNull @NotNull MapViewSettingsListener listener)Description copied from interface:MapViewSettingsUnregister a MapViewSettingsListener.- Specified by:
removeMapViewSettingsListenerin interfaceMapViewSettings- Parameters:
listener- MapViewSettingsListener to unregister
-
isGridVisible
public boolean isGridVisible()
Description copied from interface:MapViewSettingsGet the visibility of the grid.- Specified by:
isGridVisiblein interfaceMapViewSettings- Returns:
- visibility of the grid (
truefor visible,falsefor invisible)
-
setGridVisible
public void setGridVisible(boolean gridVisible)
Description copied from interface:MapViewSettingsSet the visibility of the grid.- Specified by:
setGridVisiblein interfaceMapViewSettings- Parameters:
gridVisible- new visibility of the grid (truefor making the grid visible,falsefor invisible)
-
isLightVisible
public boolean isLightVisible()
Description copied from interface:MapViewSettingsGet the visibility of the light.- Specified by:
isLightVisiblein interfaceMapViewSettings- Returns:
- visibility of the light (
truefor visible,falsefor invisible)
-
setLightVisible
public void setLightVisible(boolean lightVisible)
Description copied from interface:MapViewSettingsSet the visibility of the light.- Specified by:
setLightVisiblein interfaceMapViewSettings- Parameters:
lightVisible- new visibility of the light (truefor making the light visible,falsefor invisible)
-
isSmoothing
public boolean isSmoothing()
Description copied from interface:MapViewSettingsReturns the smoothing setting.- Specified by:
isSmoothingin interfaceMapViewSettings- Returns:
- the smoothing setting
-
setSmoothing
public void setSmoothing(boolean smoothing)
Description copied from interface:MapViewSettingsSets the smoothing setting.- Specified by:
setSmoothingin interfaceMapViewSettings- Parameters:
smoothing- the new smoothing setting
-
isTileStretching
public boolean isTileStretching()
Description copied from interface:MapViewSettingsReturns the tile-stretching setting.- Specified by:
isTileStretchingin interfaceMapViewSettings- Returns:
- the tile-stretching setting
-
setTileStretching
public void setTileStretching(boolean tileStretching)
Description copied from interface:MapViewSettingsSets the tile-stretching setting.- Specified by:
setTileStretchingin interfaceMapViewSettings- Parameters:
tileStretching- the new tile-stretching setting
-
isDoubleFaces
public boolean isDoubleFaces()
Description copied from interface:MapViewSettingsGet whether double faces are drawn double height.- Specified by:
isDoubleFacesin interfaceMapViewSettings- Returns:
trueif double faces are drawn double height, otherwisefalse
-
setDoubleFaces
public void setDoubleFaces(boolean doubleFaces)
Description copied from interface:MapViewSettingsSets whether double faces should be drawn double height.- Specified by:
setDoubleFacesin interfaceMapViewSettings- Parameters:
doubleFaces- whether double faces should be drawn double height
-
isAlphaType
public boolean isAlphaType(int v)
Description copied from interface:MapViewSettingsReturns whether the specified edit type is to be shown transparent.- Specified by:
isAlphaTypein interfaceMapViewSettings- Parameters:
v- edit type to check- Returns:
trueif to be displayed transparent, otherwisefalse
-
setAlphaType
public void setAlphaType(int v, boolean state)Description copied from interface:MapViewSettingsSets whether the specified edit type is to be shown transparent.- Specified by:
setAlphaTypein interfaceMapViewSettings- Parameters:
v- edit type to setstate- state,trueto make edit typetruetransparent,falsefor opaque
-
clearAlpha
public void clearAlpha()
Description copied from interface:MapViewSettingsClear the transparency.- Specified by:
clearAlphain interfaceMapViewSettings
-
getEditType
public int getEditType()
Description copied from interface:MapViewSettingsReturns the currently set edit type.- Specified by:
getEditTypein interfaceMapViewSettings- Returns:
- the currently set edit type
-
unsetEditType
public void unsetEditType(int editType)
Description copied from interface:MapViewSettingsSet the map view to hide squares of the given type. (If no edit type is set, everything is displayed)- Specified by:
unsetEditTypein interfaceMapViewSettings- Parameters:
editType- edit type bitmask of types to hide
-
isEditType
public boolean isEditType(int editType)
Description copied from interface:MapViewSettingsGet information on the current state of edit type. Are squares of type 'editType' displayed?- Specified by:
isEditTypein interfaceMapViewSettings- Parameters:
editType- are squares of this type displayed?- Returns:
trueif these squares are currently displayed
-
isEditType
public boolean isEditType(@NotNull @NotNull BaseObject<?,?,?,?> gameObject)Description copied from interface:MapViewSettingsGet information whether the gameObject is edited. Are squares of type 'v' displayed?- Specified by:
isEditTypein interfaceMapViewSettings- Parameters:
gameObject- are squares of this type displayed?- Returns:
- true if these squares are currently displayed
-
isEditTypeSet
public boolean isEditTypeSet()
Description copied from interface:MapViewSettingsReturns whether a editType value is set so that not all squares are displayed.- Specified by:
isEditTypeSetin interfaceMapViewSettings- Returns:
trueif a editType value is set, otherwisefalse.
-
toggleEditType
public void toggleEditType(int editType)
Description copied from interface:MapViewSettingsToggle an edit type.- Specified by:
toggleEditTypein interfaceMapViewSettings- Parameters:
editType- the edit type to toggle
-
isAutojoin
public boolean isAutojoin()
Description copied from interface:MapViewSettingsReturns whether "autojoin" is enabled.- Specified by:
isAutojoinin interfaceMapViewSettings- Returns:
- the autojoin state
-
setAutojoin
public void setAutojoin(boolean autojoin)
Description copied from interface:MapViewSettingsSets the "autojoin" state.- Specified by:
setAutojoinin interfaceMapViewSettings- Parameters:
autojoin- if set, enable autojoining
-
loadGridVisible
protected abstract boolean loadGridVisible()
Loads the default value forgridVisible.- Returns:
- the default value
-
saveGridVisible
protected abstract void saveGridVisible(boolean gridVisible)
Saves thegridVisiblevalue.- Parameters:
gridVisible- the grid visible value
-
loadLightVisible
protected abstract boolean loadLightVisible()
Loads the default value forlightVisible.- Returns:
- the default value
-
saveLightVisible
protected abstract void saveLightVisible(boolean lightVisible)
Saves thelightVisiblevalue.- Parameters:
lightVisible- the light visible value
-
loadSmoothing
protected abstract boolean loadSmoothing()
Loads the default value forsmoothing.- Returns:
- the default value
-
saveSmoothing
protected abstract void saveSmoothing(boolean smoothing)
Saves thesmoothingvalue.- Parameters:
smoothing- the smoothing value
-
loadTileStretching
protected abstract boolean loadTileStretching()
Loads the default value fortileStretching.- Returns:
- the default value
-
saveTileStretching
protected abstract void saveTileStretching(boolean tileStretching)
Saves thetileStretchingvalue.- Parameters:
tileStretching- the smoothing value
-
loadDoubleFaces
protected abstract boolean loadDoubleFaces()
Loads the default value fordoubleFaces.- Returns:
- the default value
-
saveDoubleFaces
protected abstract void saveDoubleFaces(boolean doubleFaces)
Saves thedoubleFacesvalue.- Parameters:
doubleFaces- the double faces value
-
loadAlphaType
protected abstract int loadAlphaType()
Loads the default value foralphaType.- Returns:
- the default value
-
saveAlphaType
protected abstract void saveAlphaType(int alphaType)
Saves thealphaTypevalue.- Parameters:
alphaType- the alpha type value
-
loadEditType
protected abstract int loadEditType()
Loads the default value foreditType.- Returns:
- the default value
-
loadAutojoin
protected abstract boolean loadAutojoin()
Loads the default value forautojoin.- Returns:
- the default value
-
saveAutojoin
protected abstract void saveAutojoin(boolean autojoin)
Saves the autojoin value.- Parameters:
autojoin- the autojoin value
-
-