Class SettingsManager

java.lang.Object
gaiasky.util.SettingsManager

public class SettingsManager extends Object
Contains utilities to initialize and manage the Gaia Sky Settings objects.
  • Constructor Details

    • SettingsManager

      public SettingsManager()
      Creates a new empty settings manager object.
  • Method Details

    • loadSettings

      public Settings loadSettings(InputStream settingsStream, InputStream versionStream)
      Loads the given settings and version files into a Settings object and returns it.
      Parameters:
      settingsStream - Input stream to the settings file (config.yaml).
      versionStream - Input stream to the version file.
      Returns:
      The loaded Settings object.
    • loadSettings

      public Settings loadSettings(boolean vrFlag)
      Loads the default settings file into a Settings object and returns it.
      Parameters:
      vrFlag - Whether we are in VR mode.
      Returns:
      The loaded Settings object.
    • loadSettings

      public Settings loadSettings(File configFile) throws IOException
      Loads a Settings object from a YAML configuration file and returns it.
      Parameters:
      configFile - The YAML configuration file.
      Returns:
      The Settings object.
      Throws:
      IOException
    • getConfigFileName

      public static String getConfigFileName(boolean vr)
    • persist

      public void persist(Settings settings)
      Persists the given settings object to the default settings file path.
    • persist

      public void persist(Settings settings, File settingsFile)
      Persists the given settings object to the given file.
      Parameters:
      settings - The settings object to persist.
      settingsFile - The file to save the settings to.