Class AbstractPropertyMap

    • Field Detail

      • DEFAULT_FONT

        public static final Font DEFAULT_FONT
      • DEFAULT_COLOR

        public static final Color DEFAULT_COLOR
    • Constructor Detail

      • AbstractPropertyMap

        public AbstractPropertyMap()
    • Method Detail

      • getPropertyBool

        public boolean getPropertyBool​(String key)
        Gets a value of type boolean.
        Specified by:
        getPropertyBool in interface PropertyMap
        Parameters:
        key - the key
        Returns:
        the value for the given key, or false if the key is not contained in this property set.
      • getPropertyBool

        public Boolean getPropertyBool​(String key,
                                       Boolean defaultValue)
        Gets a value of type Boolean.
        Specified by:
        getPropertyBool in interface PropertyMap
        Parameters:
        key - the key
        defaultValue - the default value that is returned if the key was not found in this property set.
        Returns:
        the value for the given key, or defaultValue if the key is not contained in this property set.
      • getPropertyInt

        public int getPropertyInt​(String key)
        Gets a value of type int.
        Specified by:
        getPropertyInt in interface PropertyMap
        Parameters:
        key - the key
        Returns:
        the value for the given key, or 0 (zero) if the key is not contained in this property set.
      • getPropertyInt

        public Integer getPropertyInt​(String key,
                                      Integer defaultValue)
        Gets a value of type Integer.
        Specified by:
        getPropertyInt in interface PropertyMap
        Parameters:
        key - the key
        defaultValue - the default value that is returned if the key was not found in this property set.
        Returns:
        the value for the given key, or defaultValue if the key is not contained in this property set.
      • getPropertyDouble

        public double getPropertyDouble​(String key)
        Gets a value of type double.
        Specified by:
        getPropertyDouble in interface PropertyMap
        Parameters:
        key - the key
        Returns:
        the value for the given key, or 0.0 (zero) if the key is not contained in this property set.
      • getPropertyDouble

        public Double getPropertyDouble​(String key,
                                        Double defaultValue)
        Gets a value of type Double.
        Specified by:
        getPropertyDouble in interface PropertyMap
        Parameters:
        key - the key
        defaultValue - the default value that is returned if the key was not found in this property set.
        Returns:
        the value for the given key, or defaultValue if the key is not contained in this property set.
      • getPropertyString

        public String getPropertyString​(String key)
        Gets a value of type String.
        Specified by:
        getPropertyString in interface PropertyMap
        Parameters:
        key - the key
        Returns:
        the value for the given key, or "" (empty string) if the key is not contained in this property set, never null.
      • getPropertyString

        public String getPropertyString​(String key,
                                        String defaultValue)
        Gets a value of type String.
        Specified by:
        getPropertyString in interface PropertyMap
        Parameters:
        key - the key
        defaultValue - the default value that is returned if the key was not found in this property set.
        Returns:
        the value for the given key, or defaultValue if the key is not contained in this property set.
      • getPropertyColor

        public Color getPropertyColor​(String key)
        Gets a value of type Color.
        Specified by:
        getPropertyColor in interface PropertyMap
        Parameters:
        key - the key
        Returns:
        the value for the given key, or Color.black if the key is not contained in this property set, never null.
      • getPropertyColor

        public Color getPropertyColor​(String key,
                                      Color defaultValue)
        Gets a value of type Color.
        Specified by:
        getPropertyColor in interface PropertyMap
        Parameters:
        key - the key
        defaultValue - the default value that is returned if the key was not found in this property set.
        Returns:
        the value for the given key, or defaultValue if the key is not contained in this property set.
      • getPropertyFont

        public Font getPropertyFont​(String key)
        Gets a value of type Font.
        Specified by:
        getPropertyFont in interface PropertyMap
        Parameters:
        key - the key
        Returns:
        the value for the given key, or a plain, 12-point "SandSerif" font if the key is not contained in this property set, never null.
      • getPropertyFont

        public Font getPropertyFont​(String key,
                                    Font defaultValue)
        Gets a value of type Font.
        Specified by:
        getPropertyFont in interface PropertyMap
        Parameters:
        key - the key
        defaultValue - the default value that is returned if the key was not found in this property set.
        Returns:
        the value for the given key, or defaultValue if the key is not contained in this property set.
      • setPropertyFont

        public void setPropertyFont​(String key,
                                    Font font)
        Sets a font of type Font. The method actually puts three keys in this property set in order to store the font's properties:
        • <key>.name for the font's name
        • <key>.style for the font's style (an integer font)
        • <key>.name for the font's size in points (an integer font)
        Specified by:
        setPropertyFont in interface PropertyMap
        Parameters:
        key - the key
        font - the font
        Throws:
        IllegalArgumentException
      • firePropertyChange

        protected abstract void firePropertyChange​(String key,
                                                   String oldValue,
                                                   String newValue)