Class Settings

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class Settings
    extends java.lang.Object
    implements java.lang.Cloneable, java.io.Serializable
    Contains all settings that need to be amde persist.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<Alarm> alarms
      The alarms.
      protected boolean ampm
      The ampm time format.
      protected boolean autosave
      The autosave flag.
      protected java.lang.String filename
      The actual filename for this settings.
      protected int fontsize
      The font size.
    • Constructor Summary

      Constructors 
      Constructor Description
      Settings()
      Create new settings.
      Settings​(boolean ampm, int fontsize, Alarm[] alarms, boolean autosave, java.lang.String filename)
      Create new settings.
      Settings​(java.lang.String filename)
      Create new settings.
    • Field Detail

      • ampm

        protected boolean ampm
        The ampm time format.
      • fontsize

        protected int fontsize
        The font size.
      • alarms

        protected java.util.List<Alarm> alarms
        The alarms.
      • filename

        protected java.lang.String filename
        The actual filename for this settings.
      • autosave

        protected boolean autosave
        The autosave flag.
    • Constructor Detail

      • Settings

        public Settings()
        Create new settings.
      • Settings

        public Settings​(java.lang.String filename)
        Create new settings.
        Parameters:
        filename - The filename.
      • Settings

        public Settings​(boolean ampm,
                        int fontsize,
                        Alarm[] alarms,
                        boolean autosave,
                        java.lang.String filename)
        Create new settings.
        Parameters:
        ampm - The ampm format indicator.
        alarms - The alarms.
        autosave - The autosave option.
        filename - The filename.
    • Method Detail

      • isAMPM

        public boolean isAMPM()
        Test is ampm format.
        Returns:
        True, if ampm format.
      • setAMPM

        public void setAMPM​(boolean ampm)
        Set the ampm mode.
        Parameters:
        ampm - The ampm mode.
      • getFontsize

        public int getFontsize()
        Get the font size.
        Returns:
        The font size.
      • setFontsize

        public void setFontsize​(int fontsize)
        Set the font size
        Parameters:
        fontsize - The fontsize.
      • getAlarms

        public Alarm[] getAlarms()
        Get the alarms.
        Returns:
        The alarms.
      • addAlarm

        public void addAlarm​(Alarm alarm)
        Add a new alarm.
        Parameters:
        alarm - The alarm.
      • removeAlarm

        public void removeAlarm​(Alarm alarm)
        Remove an alarm.
        Parameters:
        alarm - The alarm.
      • isAutosave

        public boolean isAutosave()
        Test if autosave.
        Returns:
        True, if autosave.
      • setAutosave

        public void setAutosave​(boolean autosave)
        Test the autosave option.
        Parameters:
        autosave -
      • setAlarms

        public void setAlarms​(Alarm[] alarms)
        Set the alarms.
        Parameters:
        alarms - The alarms.
      • getFilename

        public java.lang.String getFilename()
        Get the filename.
        Returns:
        The filename.
      • setFilename

        public void setFilename​(java.lang.String filename)
        Set the filename.
        Parameters:
        filename - The filename.
      • save0

        protected void save0()
        Save settings without exception.
      • clone

        protected java.lang.Object clone()
        Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object
        Overrides:
        clone in class java.lang.Object
        Returns:
        a clone of this instance.
      • save

        public void save()
                  throws java.io.IOException
        Save the settings.
        Throws:
        java.io.IOException
      • loadSettings

        public static Settings loadSettings​(java.lang.String settings_loc)
        Load the settings.
        Parameters:
        settings_loc - The settings location.
        Returns:
        The loaded settings.