Software documentation

Development tools

Code Structure

Techniques and Standards

How To

Functional Info

Background Info

JMRI: Application Preferences

This page discusses the how the main JMRI applications store and retrieve their preferences.

For the structure of the JMRI library itself, see the Introduction to JMRI Library Structure page. For information the structure of the main JMRI applications, see the JMRI Application Structure page. For information on how JMRI initializes its connections to the layout, see the JMRI External System Connection Structure page.

This is just a stub of a page, which we'll slowly be building out.

Concepts

Individual preferences, such as how a table column is sorted or the state of a check box, can be stored using the jmri.UserPreferencesManager.

How Preferences Are Stored

A newly-created profile directory looks like this:
% ls -lt $JMRIPREFS/NewEmptyProfile/
total 0
drwxr-xr-x  2 jake  staff   68 Jul 17 11:54 programmers
drwxr-xr-x  2 jake  staff   68 Jul 17 11:54 throttle
drwxr-xr-x  5 jake  staff  170 Jul 17 11:54 profile

% ls -lt $JMRIPREFS/NewEmptyProfile/*
/Users/jake/Library/Preferences/JMRI/NewEmptyProfile/programmers:

/Users/jake/Library/Preferences/JMRI/NewEmptyProfile/throttle:

/Users/jake/Library/Preferences/JMRI/NewEmptyProfile/profile:
total 16
drwxr-xr-x  4 jake  staff  136 Jul 17 11:54 jmri-784F4398C983-3d854083
-rw-r--r--  1 jake  staff  162 Jul 17 11:54 profile.properties
-rw-r--r--  1 jake  staff  126 Jul 17 11:54 profile.properties.1.bak

% ls -lt $JMRIPREFS/NewEmptyProfile/profile/*
-rw-r--r--  1 jake  staff  162 Jul 17 11:54 /Users/jake/Library/Preferences/JMRI/NewEmptyProfile/profile/profile.properties
-rw-r--r--  1 jake  staff  126 Jul 17 11:54 /Users/jake/Library/Preferences/JMRI/NewEmptyProfile/profile/profile.properties.1.bak

/Users/jake/Library/Preferences/JMRI/NewEmptyProfile/profile/jmri-784F4398C983-3d854083:
total 16
-rw-r--r--  1 jake  staff  1863 Jul 17 11:54 user-interface.xml
-rw-r--r--  1 jake  staff   511 Jul 17 11:54 user-interface.xml.1.bak
In addition to creating the directory structure, there are two files with content:
% cat /Users/jake/Library/Preferences/JMRI/NewEmptyProfile/profile/profile.properties
#JMRI Preferences version 4.9.1ish+jake+20170717T1854Z+R262cbf5596
#Mon Jul 17 11:54:51 PDT 2017
profile.id=NewEmptyProfile.3d854083
profile.name=NewEmptyProfile
and
% cat /Users/jake/Library/Preferences/JMRI/NewEmptyProfile/profile/jmri-784F4398C983-3d854083/user-interface.xml
<?xml version="1.0" encoding="UTF-8"?>
<auxiliary-configuration xmlns="http://www.netbeans.org/ns/auxiliary-configuration/1">
    <classPreferences xmlns="http://jmri.org/xml/schema/auxiliary-configuration/class-preferences-4-3-5.xsd">
        <preferences xmlns="" class="jmri.jmrit.beantable.SignalMastTableAction"/>
        <preferences xmlns="" class="jmri.jmrit.beantable.LogixTableAction"/>
        <preferences xmlns="" class="jmri.jmrit.beantable.LRouteTableAction"/>
        <preferences xmlns="" class="jmri.managers.JmriUserPreferencesManager"/>
        <preferences xmlns="" class="jmri.jmrit.beantable.SensorTableAction"/>
        <preferences xmlns="" class="jmri.jmrit.beantable.SignalHeadTableAction"/>
        <preferences xmlns="" class="jmri.jmrit.beantable.BlockTableAction"/>
        <preferences xmlns="" class="jmri.jmrit.beantable.AudioTableAction"/>
        <preferences xmlns="" class="jmri.jmrit.beantable.SignalGroupTableAction"/>
        <preferences xmlns="" class="jmri.jmrit.beantable.LightTableAction"/>
        <preferences xmlns="" class="jmri.jmrit.beantable.TransitTableAction"/>
        <preferences xmlns="" class="jmri.jmrit.beantable.ReporterTableAction"/>
        <preferences xmlns="" class="jmri.jmrit.beantable.RouteTableAction"/>
        <preferences xmlns="" class="jmri.jmrit.beantable.MemoryTableAction"/>
    </classPreferences>
    <windowDetails xmlns="http://jmri.org/xml/schema/auxiliary-configuration/window-details-4-3-5.xsd">
        <window xmlns="" class="jmri.jmrit.roster.Roster">
            <properties>
                <property>
                    <key>defaultRosterGroup</key>
                </property>
            </properties>
        </window>
        <window xmlns="" class="PanelPro" height="231.0" locX="375.0" locY="334.0" width="689.0"/>
    </windowDetails>
</auxiliary-configuration>
In that example, the ProfileID was created as NewEmptyProfile.3d854083.

Specifics