 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.settings;
23 import java.util.prefs.PreferenceChangeListener;
24 import java.util.prefs.Preferences;
27 import org.jetbrains.annotations.NotNull;
120 final PreferenceChangeListener preferenceChangeListener = evt -> {
121 switch (evt.getKey()) {
143 PREFERENCES.addPreferenceChangeListener(preferenceChangeListener);
161 if (this.archDirectory.equals(effectiveArchDirectory)) {
165 this.archDirectory = effectiveArchDirectory;
187 if (this.mapsDirectory.equals(effectiveMapsDirectory)) {
191 this.mapsDirectory = effectiveMapsDirectory;
192 if (updatePreferences) {
210 if (this.mediaDirectory.equals(effectiveMediaDirectory)) {
214 this.mediaDirectory = effectiveMediaDirectory;
229 if (this.imageSet.equals(
imageSet)) {
File mediaDirectory
The media directory.
boolean hasMediaDirectory()
Returns whether a media directory is used.
final EditorSettings editorSettings
The EditorSettings for retrieving default values.
Base package of all Gridarta classes.
String configSourceName
Do we load arches from the collected archives.
boolean hasImageSet()
Returns whether an image set is used.
File archDirectory
The archetype directory.
File getMediaDirectory()
Returns the media directory.
static final String MEDIA_DIRECTORY_KEY
The preferences key for the media directory.
void fireMapsDirectoryChanged()
Notifies all listeners about a changed maps directory.
String getImageSet()
Returns the image set.
File getMapsDirectory()
Returns the default maps directory.
String getConfigSourceName()
Returns the name of the configuration source.
Settings that apply to the editor.
void setMapsDirectoryInt(@NotNull final File mapsDirectory, final boolean updatePreferences)
Sets the mapsDirectory.
void setMediaDirectory(@NotNull final File mediaDirectory)
Sets the media directory.
void setArchDirectory(@NotNull final File archDirectory)
Sets the archetype directory.
String getImageSetDefault()
Returns the default image set.
File getArchDirectoryDefault()
Returns the default archetype directory.
String getUserName()
Returns the user name.
static final String ARCH_DIRECTORY_KEY
The preferences key for the archetype directory.
Default implementation of ProjectSettings.
static final String MAP_DIRECTORY_KEY
The preferences key for the archetype directory.
boolean saveIndices()
Returns whether indices should be saved to disk.
void setMapsDirectory(@NotNull final File mapsDirectory)
Sets the default maps directory.
static final Preferences PREFERENCES
Preferences.
File getArchDirectory()
Returns the archetype directory.
File mapsDirectory
The default maps directory.
static File getCanonicalFile(@NotNull final File file)
Calls File#getCanonicalFile().
String imageSet
The image set.
void setConfigSourceName(@NotNull final String configSourceName)
Sets the name of the configuration source.
File getMapsDirectoryDefault()
Returns the default maps directory.
Utility-class for Gridarta's I/O.
static final String PREFERENCES_USER_NAME
Preferences key for user name.
static final String CONFIG_SOURCE_KEY
The preferences key for configuration source.
Abstract base class for ProjectSettings implementations.
void setImageSet(@NotNull final String imageSet)
Sets the image set.
AbstractDefaultProjectSettings(@NotNull final EditorSettings editorSettings)
Creates a new instance.
static final String IMAGE_SET_KEY
The preferences key for the selected image set.
File getMediaDirectoryDefault()
Returns the default media directory.
String getUserNameDefault()
Returns the default user name.
void setUserName(@NotNull final String userName)
Sets the user name.
Interface used as preferences location.