Class PropertiesHelper


  • public class PropertiesHelper
    extends java.lang.Object
    This class logically accesses values in a given Properties object
    • Field Detail

      • ADVANCEDSHAPERENDERER

        public static final java.lang.String ADVANCEDSHAPERENDERER
        Property type none: Prefix for advanced shape renderer settings
        See Also:
        Constant Field Values
      • ADVANCEDSHAPERENDERER_COLORS

        public static final java.lang.String ADVANCEDSHAPERENDERER_COLORS
        Property type String: Postfix for advanced share renderer color settings
        See Also:
        Constant Field Values
      • ADVANCEDSHAPERENDERER_CURRENT

        public static final java.lang.String ADVANCEDSHAPERENDERER_CURRENT
        Property type String: Postfix for advanced share renderer current settings
        See Also:
        Constant Field Values
      • ADVANCEDSHAPERENDERER_MAXIMUM

        public static final java.lang.String ADVANCEDSHAPERENDERER_MAXIMUM
        Property type String: Postfix for advanced share renderer maximum settings
        See Also:
        Constant Field Values
      • ADVANCEDSHAPERENDERER_MINIMUM

        public static final java.lang.String ADVANCEDSHAPERENDERER_MINIMUM
        Property type String: Postfix for advanced share renderer minimum settings
        See Also:
        Constant Field Values
      • ADVANCEDSHAPERENDERER_VALUES

        public static final java.lang.String ADVANCEDSHAPERENDERER_VALUES
        Property type String: Postfix for advanced share renderer values settings
        See Also:
        Constant Field Values
      • ADVANCEDSHAPERENDERER_CURRENT_SET

        public static final java.lang.String ADVANCEDSHAPERENDERER_CURRENT_SET
        Property type String: Name of current advanced shape renderer set
        See Also:
        Constant Field Values
      • ADVANCEDSHAPERENDERER_SETS

        public static final java.lang.String ADVANCEDSHAPERENDERER_SETS
        Property type List: List of all available advanced shape rendererers
        See Also:
        Constant Field Values
      • ADVANCEDSHAPERENDERER_TOOLTIP

        public static final java.lang.String ADVANCEDSHAPERENDERER_TOOLTIP
        Property type String: ...
        See Also:
        Constant Field Values
      • ADVANCEDSHAPERENDERER_UNKNOWN

        public static final java.lang.String ADVANCEDSHAPERENDERER_UNKNOWN
        Property type String: ...
        See Also:
        Constant Field Values
      • ATR_HORIZONTAL_ALIGN

        public static final java.lang.String ATR_HORIZONTAL_ALIGN
        See Also:
        Constant Field Values
      • AUTOCOMPLETION_COMPLETION_GUI

        public static final java.lang.String AUTOCOMPLETION_COMPLETION_GUI
        See Also:
        Constant Field Values
      • AUTOCOMPLETION_EMPTY_STUB_MODE

        public static final java.lang.String AUTOCOMPLETION_EMPTY_STUB_MODE
        Property type boolean:
        See Also:
        Constant Field Values
      • AUTOCOMPLETION_HOTKEY_MODE

        public static final java.lang.String AUTOCOMPLETION_HOTKEY_MODE
        Property type boolean:
        See Also:
        Constant Field Values
      • AUTOCOMPLETION_ENABLED

        public static final java.lang.String AUTOCOMPLETION_ENABLED
        Property type boolean:
        See Also:
        Constant Field Values
      • AUTOCOMPLETION_KEYS_BREAK

        public static final java.lang.String AUTOCOMPLETION_KEYS_BREAK
        See Also:
        Constant Field Values
      • AUTOCOMPLETION_KEYS_START

        public static final java.lang.String AUTOCOMPLETION_KEYS_START
        See Also:
        Constant Field Values
      • AUTOCOMPLETION_KEYS_COMPLETE

        public static final java.lang.String AUTOCOMPLETION_KEYS_COMPLETE
        See Also:
        Constant Field Values
      • AUTOCOMPLETION_KEYS_CYCLE_BACKWARD

        public static final java.lang.String AUTOCOMPLETION_KEYS_CYCLE_BACKWARD
        Property type number:
        See Also:
        Constant Field Values
      • AUTOCOMPLETION_KEYS_CYCLE_FORWARD

        public static final java.lang.String AUTOCOMPLETION_KEYS_CYCLE_FORWARD
        Property type number:
        See Also:
        Constant Field Values
      • AUTOCOMPLETION_LIMIT_MAKE_COMPLETION

        public static final java.lang.String AUTOCOMPLETION_LIMIT_MAKE_COMPLETION
        See Also:
        Constant Field Values
      • AUTOCOMPLETION_SELF_DEFINED_COMPLETIONS_COUNT

        public static final java.lang.String AUTOCOMPLETION_SELF_DEFINED_COMPLETIONS_COUNT
        Property type number:
        See Also:
        Constant Field Values
      • AUTOCOMPLETION_TIME

        public static final java.lang.String AUTOCOMPLETION_TIME
        Property type number:
        See Also:
        Constant Field Values
      • BORDERCELLRENDERER_USE_SEASON_IMAGES

        public static final java.lang.String BORDERCELLRENDERER_USE_SEASON_IMAGES
        Property type boolean:
        See Also:
        Constant Field Values
      • CELLRENDERER_CUSTOM_STYLESETS

        public static final java.lang.String CELLRENDERER_CUSTOM_STYLESETS
        Property type String:
        See Also:
        Constant Field Values
      • CELLRENDERER_EMPHASIZE_STYLE

        public static final java.lang.String CELLRENDERER_EMPHASIZE_STYLE
        Property type String:
        See Also:
        Constant Field Values
      • CELLRENDERER_SHOW_TOOLTIPS

        public static final java.lang.String CELLRENDERER_SHOW_TOOLTIPS
        Property type boolean:
        See Also:
        Constant Field Values
      • CELLRENDERER_SKILL_ICON_TEXT_COLOR_MAP

        public static final java.lang.String CELLRENDERER_SKILL_ICON_TEXT_COLOR_MAP
        Property type String:
        See Also:
        Constant Field Values
      • CELLRENDERER_STYLESETS

        public static final java.lang.String CELLRENDERER_STYLESETS
        Property type List:
        See Also:
        Constant Field Values
      • CLIENT_LOOK_AND_FEEL

        public static final java.lang.String CLIENT_LOOK_AND_FEEL
        Property type String:
        See Also:
        Constant Field Values
      • CLIENTPREFERENCES_DONT_SHOW_TABS

        public static final java.lang.String CLIENTPREFERENCES_DONT_SHOW_TABS
        Property type boolean: If true, don't show tabs in docking layout.
        See Also:
        Constant Field Values
      • DESKTOP_ENABLE_WORKSPACE_CHOOSER

        public static final java.lang.String DESKTOP_ENABLE_WORKSPACE_CHOOSER
        Property type boolean: If true, show workspace chooser
        See Also:
        Constant Field Values
      • DESKTOP_SPLITSET

        public static final java.lang.String DESKTOP_SPLITSET
        Property type String: Name of the used Splitset
        See Also:
        Constant Field Values
      • DESKTOP_TYPE

        public static final java.lang.String DESKTOP_TYPE
        Property type String: Name of the used desktop type (SPLIT)
        See Also:
        Constant Field Values
      • MESSAGETYPE_SECTION_EVENTS_COLOR

        public static final java.lang.String MESSAGETYPE_SECTION_EVENTS_COLOR
        Property type Color (#RRGGBB): background color for event messages
        See Also:
        Constant Field Values
      • MESSAGETYPE_SECTION_MOVEMENTS_COLOR

        public static final java.lang.String MESSAGETYPE_SECTION_MOVEMENTS_COLOR
        Property type Color (#RRGGBB): background color for movement messages
        See Also:
        Constant Field Values
      • MESSAGETYPE_SECTION_ECONOMY_COLOR

        public static final java.lang.String MESSAGETYPE_SECTION_ECONOMY_COLOR
        Property type Color (#RRGGBB): background color for economy messages
        See Also:
        Constant Field Values
      • MESSAGETYPE_SECTION_MAGIC_COLOR

        public static final java.lang.String MESSAGETYPE_SECTION_MAGIC_COLOR
        Property type Color (#RRGGBB): background color for magic messages
        See Also:
        Constant Field Values
      • MESSAGETYPE_SECTION_STUDY_COLOR

        public static final java.lang.String MESSAGETYPE_SECTION_STUDY_COLOR
        Property type Color (#RRGGBB): background color for study messages
        See Also:
        Constant Field Values
      • MESSAGETYPE_SECTION_PRODUCTION_COLOR

        public static final java.lang.String MESSAGETYPE_SECTION_PRODUCTION_COLOR
        Property type Color (#RRGGBB): background color for production messages
        See Also:
        Constant Field Values
      • MESSAGETYPE_SECTION_ERRORS_COLOR

        public static final java.lang.String MESSAGETYPE_SECTION_ERRORS_COLOR
        Property type Color (#RRGGBB): background color for error messages
        See Also:
        Constant Field Values
      • MESSAGETYPE_SECTION_BATTLE_COLOR

        public static final java.lang.String MESSAGETYPE_SECTION_BATTLE_COLOR
        Property type Color (#RRGGBB): background color for battle messages
        See Also:
        Constant Field Values
      • CLIENTPREFERENCES_LOAD_LAST_REPORT

        public static final java.lang.String CLIENTPREFERENCES_LOAD_LAST_REPORT
        See Also:
        Constant Field Values
      • CLIENT_LAST_CR_ADDED

        public static final java.lang.String CLIENT_LAST_CR_ADDED
        See Also:
        Constant Field Values
      • CLIENT_LAST_SELECTED_ADD_CR_FILEFILTER

        public static final java.lang.String CLIENT_LAST_SELECTED_ADD_CR_FILEFILTER
        See Also:
        Constant Field Values
      • CLIENT_LAST_SELECTED_ADD_CR_FILEFILTER_ID

        public static final java.lang.String CLIENT_LAST_SELECTED_ADD_CR_FILEFILTER_ID
        See Also:
        Constant Field Values
      • CLIENT_LAST_SELECTED_OPEN_CR_FILEFILTER

        public static final java.lang.String CLIENT_LAST_SELECTED_OPEN_CR_FILEFILTER
        See Also:
        Constant Field Values
      • CLIENT_LAST_SELECTED_OPEN_CR_FILEFILTER_ID

        public static final java.lang.String CLIENT_LAST_SELECTED_OPEN_CR_FILEFILTER_ID
        See Also:
        Constant Field Values
      • BUILDINGRENDERER_RENDER

        public static final java.lang.String BUILDINGRENDERER_RENDER
        See Also:
        Constant Field Values
      • ORDEREDITOR_PREFIX

        public static final java.lang.String ORDEREDITOR_PREFIX
        prefix of OrderWriter's property, not a property itself
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_HOST

        public static final java.lang.String ORDERWRITER_MAILSERVER_HOST
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_PORT

        public static final java.lang.String ORDERWRITER_MAILSERVER_PORT
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_USERNAME

        public static final java.lang.String ORDERWRITER_MAILSERVER_USERNAME
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_PASSWORD

        public static final java.lang.String ORDERWRITER_MAILSERVER_PASSWORD
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_PASSWORD_ENCRYPTED

        public static final java.lang.String ORDERWRITER_MAILSERVER_PASSWORD_ENCRYPTED
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_ASKPWD

        public static final java.lang.String ORDERWRITER_MAILSERVER_ASKPWD
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_USEAUTH

        public static final java.lang.String ORDERWRITER_MAILSERVER_USEAUTH
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_RECIPIENT

        public static final java.lang.String ORDERWRITER_MAILSERVER_RECIPIENT
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_RECIPIENT2

        public static final java.lang.String ORDERWRITER_MAILSERVER_RECIPIENT2
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_SENDER

        public static final java.lang.String ORDERWRITER_MAILSERVER_SENDER
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_SUBJECT

        public static final java.lang.String ORDERWRITER_MAILSERVER_SUBJECT
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_USE_CR_SETTINGS

        public static final java.lang.String ORDERWRITER_MAILSERVER_USE_CR_SETTINGS
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_CC2SENDER

        public static final java.lang.String ORDERWRITER_MAILSERVER_CC2SENDER
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_SSL

        public static final java.lang.String ORDERWRITER_MAILSERVER_SSL
        See Also:
        Constant Field Values
      • ORDERWRITER_MAILSERVER_TLS

        public static final java.lang.String ORDERWRITER_MAILSERVER_TLS
        See Also:
        Constant Field Values
      • ORDERWRITER_OUTPUT_FILE

        public static final java.lang.String ORDERWRITER_OUTPUT_FILE
        See Also:
        Constant Field Values
      • ORDERWRITER_AUTO_FILENAME

        public static java.lang.String ORDERWRITER_AUTO_FILENAME
      • ORDERWRITER_SERVER_URL

        public static java.lang.String ORDERWRITER_SERVER_URL
      • ORDERWRITER_WRITE_TAGS_AS_VORLAGE_COMMENT

        public static final java.lang.String ORDERWRITER_WRITE_TAGS_AS_VORLAGE_COMMENT
        See Also:
        Constant Field Values
      • ORDERWRITER_SELECTED_REGIONS

        public static final java.lang.String ORDERWRITER_SELECTED_REGIONS
        See Also:
        Constant Field Values
      • ORDERWRITER_ADD_ECHECK_COMMENTS

        public static final java.lang.String ORDERWRITER_ADD_ECHECK_COMMENTS
        See Also:
        Constant Field Values
      • ORDERWRITER_REMOVE_SC_COMMENTS

        public static final java.lang.String ORDERWRITER_REMOVE_SC_COMMENTS
        See Also:
        Constant Field Values
      • ORDERWRITER_REMOVE_SS_COMMENTS

        public static final java.lang.String ORDERWRITER_REMOVE_SS_COMMENTS
        See Also:
        Constant Field Values
      • ORDERWRITER_CONFIRMED_ONLY

        public static final java.lang.String ORDERWRITER_CONFIRMED_ONLY
        See Also:
        Constant Field Values
      • ORDERWRITER_FACTION

        public static final java.lang.String ORDERWRITER_FACTION
        See Also:
        Constant Field Values
      • ORDERWRITER_FIXED_WIDTH

        public static final java.lang.String ORDERWRITER_FIXED_WIDTH
        See Also:
        Constant Field Values
      • TASKTABLE_RESTRICT_TO_OWNER

        public static final java.lang.String TASKTABLE_RESTRICT_TO_OWNER
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_RESTRICT_TO_PASSWORD

        public static final java.lang.String TASKTABLE_RESTRICT_TO_PASSWORD
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_RESTRICT_TO_SELECTION

        public static final java.lang.String TASKTABLE_RESTRICT_TO_SELECTION
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_RESTRICT_TO_ACTIVEREGION

        public static final java.lang.String TASKTABLE_RESTRICT_TO_ACTIVEREGION
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_SHOW_GLOBAL

        public static final java.lang.String TASKTABLE_SHOW_GLOBAL
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_INSPECTORS_ATTACK

        public static final java.lang.String TASKTABLE_INSPECTORS_ATTACK
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_INSPECTORS_TRANSFER

        public static final java.lang.String TASKTABLE_INSPECTORS_TRANSFER
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_INSPECTORS_MESSAGE

        public static final java.lang.String TASKTABLE_INSPECTORS_MESSAGE
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_INSPECTORS_MOVEMENT

        public static final java.lang.String TASKTABLE_INSPECTORS_MOVEMENT
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_INSPECTORS_ORDER_SYNTAX

        public static final java.lang.String TASKTABLE_INSPECTORS_ORDER_SYNTAX
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_INSPECTORS_SHIP

        public static final java.lang.String TASKTABLE_INSPECTORS_SHIP
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_INSPECTORS_BUILDING

        public static final java.lang.String TASKTABLE_INSPECTORS_BUILDING
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_INSPECTORS_SKILL

        public static final java.lang.String TASKTABLE_INSPECTORS_SKILL
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_INSPECTORS_TEACH

        public static final java.lang.String TASKTABLE_INSPECTORS_TEACH
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_INSPECTORS_TODO

        public static final java.lang.String TASKTABLE_INSPECTORS_TODO
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_INSPECTORS_GAMEDATA

        public static final java.lang.String TASKTABLE_INSPECTORS_GAMEDATA
        Property type boolean:
        See Also:
        Constant Field Values
      • TASKTABLE_INSPECTORS_MAINTENANCE

        public static final java.lang.String TASKTABLE_INSPECTORS_MAINTENANCE
        Property type boolean:
        See Also:
        Constant Field Values
      • HISTORY_ACCESSORY_DIRECTORY_HISTORY

        public static final java.lang.String HISTORY_ACCESSORY_DIRECTORY_HISTORY
        Property type list (of strings)
        See Also:
        Constant Field Values
      • TASKTABLE_INSPECTORS_LIST

        @Deprecated
        public static final java.lang.String TASKTABLE_INSPECTORS_LIST
        Deprecated.
        we use an ignore list now
        Property type list of names
        See Also:
        Constant Field Values
      • TASKTABLE_INSPECTORS_IGNORE_LIST

        public static final java.lang.String TASKTABLE_INSPECTORS_IGNORE_LIST
        Property type list (of ignored problem types)
        See Also:
        Constant Field Values
      • ORDEREDITOR_EDITALLFACTIONS

        public static final java.lang.String ORDEREDITOR_EDITALLFACTIONS
        Property type boolean: edit orders for all factions
        See Also:
        Constant Field Values
      • ORDEREDITOR_MULTIEDITORLAYOUT

        public static final java.lang.String ORDEREDITOR_MULTIEDITORLAYOUT
        Property type boolean: use multi editor layout
        See Also:
        Constant Field Values
      • ORDEREDITOR_HIDEBUTTONS

        public static final java.lang.String ORDEREDITOR_HIDEBUTTONS
        Property type boolean: hide temp unit buttons
        See Also:
        Constant Field Values
      • BOOKMARKMANAGER_LASTFILE

        public static final java.lang.String BOOKMARKMANAGER_LASTFILE
        Property type String: last file for loading/saving bookmarks
        See Also:
        Constant Field Values
    • Constructor Detail

      • PropertiesHelper

        public PropertiesHelper()
    • Method Detail

      • getBoolean

        public static boolean getBoolean​(java.util.Properties p,
                                         java.lang.String key,
                                         boolean def)
        Searches the property with the given key and if it exists, it tries to convert it into a boolean and returns that value. If something goes wrong or the key couldn't be found the default value def is returned.
      • getColor

        public static java.awt.Color getColor​(java.util.Properties p,
                                              java.lang.String key,
                                              java.awt.Color def)
        Searches the property with the given key and if it exists, it tries to convert it into a Color and returns that value. If something goes wrong or the key couldn't be found the default value def is returned.
      • getFloat

        public static float getFloat​(java.util.Properties p,
                                     java.lang.String key,
                                     float def)
        Searches the property with the given key and if it exists, it tries to convert it into a float and returns that value. If something goes wrong or the key couldn't be found the default value def is returned.
      • getInteger

        public static int getInteger​(java.util.Properties p,
                                     java.lang.String key,
                                     int def)
        Searches the property with the given key and if it exists, it tries to convert it into an integer and returns that value. If something goes wrong or the key couldn't be found the default value def is returned.
      • getList

        public static java.util.List<java.lang.String> getList​(java.util.Properties p,
                                                               java.lang.String prefix)
        Extracts properties by given prefix. If there exists a key called prefix.count this is used as order
        Returns:
        list of strings; empty list if the property is undefined
      • getPrefixedList

        public static java.util.List<java.lang.String> getPrefixedList​(java.util.Properties p,
                                                                       java.lang.String prefix)
        Delivers a list of all keys having the prefix prefix
      • getString

        public static java.lang.String getString​(java.util.Properties p,
                                                 java.lang.String key,
                                                 java.lang.String defaultValue)
        Searches the property with the given key and if it exists, it tries to convert it into a String and returns that value. If something goes wrong or the key couldn't be found the default value defaultValue is returned.
      • loadRect

        public static java.awt.Rectangle loadRect​(java.util.Properties settings,
                                                  java.awt.Rectangle r,
                                                  java.lang.String key)
        Loads a rectangle from the settings using the given key. If r is null, a new object is created. Else the result is stored in r. In either case, the resulting rectangle is returned.
        Returns:
        The loaded rectangle or null if an error occurs.
      • saveRectangle

        public static void saveRectangle​(java.util.Properties settings,
                                         java.awt.Rectangle r,
                                         java.lang.String key)
        Saves the rectangle r with property-key key to the settings. The rectangle is stored as key.x, key.y, key.width, key.height.
      • setColor

        public static void setColor​(java.util.Properties p,
                                    java.lang.String key,
                                    java.awt.Color color)
        Sets the given color to the key using the format #RRGGBB
      • setList

        public static void setList​(java.util.Properties p,
                                   java.lang.String prefix,
                                   java.util.Collection<?> list)
        a) remove old properties b) set prefix.count value c) set prefix.0 .. prefix.n values
      • setBoolean

        public static void setBoolean​(java.util.Properties p,
                                      java.lang.String key,
                                      boolean value)
        Sets the given color to the key using the format #RRGGBB
      • setSettingsDirectory

        public static void setSettingsDirectory​(java.io.File newSettingsDir)
        Sets the directory for configuration configuration is stored.
        Parameters:
        newSettingsDir -
      • getSettingsDirectory

        public static java.io.File getSettingsDirectory()
        Returns the directory where configuration is stored.
        Returns:
        The directory where configuration is stored