20 package net.sf.gridarta.model.mapviewsettings;
25 import org.jetbrains.annotations.NotNull;
26 import org.jetbrains.annotations.Nullable;
96 listenerList.
add(listener);
101 listenerList.
remove(listener);
111 if (this.gridVisible == gridVisible) {
127 if (this.lightVisible == lightVisible) {
143 if (this.smoothing == smoothing) {
159 if (this.tileStretching == tileStretching) {
175 if (this.doubleFaces == doubleFaces) {
186 return v > 0 && (alphaType & v) == v;
218 if ((this.editType & editType) == editType) {
228 if ((this.editType & editType) == 0) {
232 this.editType &= ~editType;
239 return (this.editType & mask) != 0;
244 return editType == 0 ||
isEditType(gameObject.getEditType());
268 if (this.autojoin == autojoin) {
282 listener.gridVisibleChanged(gridVisible);
291 listener.lightVisibleChanged(lightVisible);
300 listener.smoothingChanged(smoothing);
310 listener.tileStretchingChanged(tileStretching);
320 listener.doubleFacesChanged(doubleFaces);
329 listener.alphaTypeChanged(alphaType);
338 listener.editTypeChanged(editType);
347 listener.autojoinChanged(autojoin);
abstract boolean loadDoubleFaces()
Loads the default value for doubleFaces.
abstract boolean loadGridVisible()
Loads the default value for gridVisible.
abstract boolean loadTileStretching()
Loads the default value for tileStretching.
void setTileStretching(final boolean tileStretching)
Sets the tile-stretching setting.
void fireTileStretchingChanged()
Informs all registered listeners that the tile-stretching setting has changed.
T [] getListeners()
Returns an array of all the listeners.
This package contains classes related to matching GameObjects, so called GameObjectMatchers.
void fireAutojoinChanged()
Notify all listeners about changed autojoin.
void fireSmoothingChanged()
Informs all registered listeners that the smoothing setting has changed.
void setSmoothing(final boolean smoothing)
Sets the smoothing setting.
boolean isEditType(final int editType)
Get information on the current state of edit type.
boolean isAutojoin()
Returns whether "autojoin" is enabled.
abstract void saveSmoothing(boolean smoothing)
Saves the smoothing value.
void clearAlpha()
Clear the transparency.
void addMapViewSettingsListener(@NotNull final MapViewSettingsListener listener)
Register a MapViewSettingsListener.
boolean isEditTypeSet()
Returns whether a editType value is set so that not all squares are displayed.
abstract void saveDoubleFaces(boolean doubleFaces)
Saves the doubleFaces value.
void fireEditTypeChanged()
Notify all listeners about changed editType.
void setEditType(final int editType)
Set the map view to show squares of the given type.
void setAlphaType(final int v, final boolean state)
Sets whether the specified edit type is to be shown transparent.
void removeMapViewSettingsListener(@NotNull final MapViewSettingsListener listener)
Unregister a MapViewSettingsListener.
void toggleEditType(final int editType)
Toggle an edit type.
final ViewGameObjectMatcherManager visibilityManager
The visibility settings.
Abstract base class for MapViewSettings implementations.
boolean doubleFaces
Whether double faces should be drawn double height.
Base package of all Gridarta classes.
boolean tileStretching
Whether tile-stretching display is active.
void fireAlphaTypeChanged()
Informs all registered listeners that the alpha type haves changed.
Manages GameObjectMatchers.
void setGridVisible(final boolean gridVisible)
Set the visibility of the grid.
int editType
Bit field of edit types to show only.
boolean isGridVisible()
Get the visibility of the grid.
abstract int loadEditType()
Loads the default value for editType.
void remove(@NotNull final T listener)
Removes a listener.
Interface for event listeners that are interested in changes on MapViewSettings.
boolean isDoubleFaces()
Get whether double faces are drawn double height.
abstract void saveGridVisible(boolean gridVisible)
Saves the gridVisible value.
Container for settings that affect the rendering of maps.
abstract void saveAlphaType(int alphaType)
Saves the alphaType value.
void add(@NotNull final T listener)
Adds a listener.
abstract void saveAutojoin(boolean autojoin)
Saves the autojoin value.
void fireGridVisibleChanged()
Informs all registered listeners that the grid visibility has changed.
int alphaType
Bit field of edit types to show transparent.
final EventListenerList2< MapViewSettingsListener > listenerList
The MapViewSettingsListeners to inform of changes.
boolean isAlphaType(final int v)
Returns whether the specified edit type is to be shown transparent.
boolean autojoin
Whether autojoining is on/off.
boolean isLightVisible()
Get the visibility of the light.
boolean gridVisible
The visibility of the grid.
abstract void saveLightVisible(boolean lightVisible)
Saves the lightVisible value.
final ViewGameObjectMatcherManager transparencyManager
The transparency settings.
abstract boolean loadLightVisible()
Loads the default value for lightVisible.
void fireDoubleFacesChanged()
Informs all registered listeners that the double faces visibility has changed.
Type-safe version of EventListenerList.
boolean smoothing
Whether smoothing display is active.
void setAutojoin(final boolean autojoin)
Sets the "autojoin" state.
int getEditType()
Returns the currently set edit type.
boolean isEditType(@NotNull final BaseObject<?, ?, ?, ?> gameObject)
Get information whether the gameObject is edited.
abstract boolean loadSmoothing()
Loads the default value for smoothing.
boolean lightVisible
The visibility of the light.
boolean isTileStretching()
Returns the tile-stretching setting.
abstract void saveTileStretching(boolean tileStretching)
Saves the tileStretching value.
void unsetEditType(final int editType)
Set the map view to hide squares of the given type.
boolean isSmoothing()
Returns the smoothing setting.
void setLightVisible(final boolean lightVisible)
Set the visibility of the light.
abstract boolean loadAutojoin()
Loads the default value for autojoin.
abstract int loadAlphaType()
Loads the default value for alphaType.
void setDoubleFaces(final boolean doubleFaces)
Sets whether double faces should be drawn double height.
void fireLightVisibleChanged()
Informs all registered listeners that the light visibility has changed.