View Javadoc
1   package org.opentrafficsim.editor;
2   
3   import java.awt.Color;
4   import java.util.Properties;
5   
6   import org.opentrafficsim.swing.gui.PropertiesStore;
7   
8   /**
9    * Interface that holds the editor properties.
10   * <p>
11   * Copyright (c) 2026-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
12   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
13   * </p>
14   * @author Wouter Schakel
15   */
16  @SuppressWarnings("interfaceIsType")
17  public interface OtsEditorProperties
18  {
19  
20      /** Application store for preferences and recent files. */
21      PropertiesStore PROPERTIES_STORE = new PropertiesStore(new Properties()
22      {
23          /** Serialization version UID. */
24          private static final long serialVersionUID = 20260303L;
25          {
26              setProperty(EXPRESSION_COLOR_KEY, PropertiesStore.valueToString(new Color(252, 250, 239)));
27              setProperty(INVALID_COLOR_KEY, PropertiesStore.valueToString(new Color(255, 240, 240)));
28              setProperty(INACTIVE_COLOR_KEY, PropertiesStore.valueToString(new Color(160, 160, 160)));
29              setProperty(MAX_RECENT_FILES_KEY, PropertiesStore.valueToString(10));
30              setProperty(MAX_TOOLTIP_LENGTH_KEY, PropertiesStore.valueToString(96));
31              setProperty(MAX_DROPDOWN_ITEMS_KEY, PropertiesStore.valueToString(20));
32              setProperty(MAX_NAVIGATE_STEPS_KEY, PropertiesStore.valueToString(50));
33              setProperty(AUTOSAVE_MS_KEY, PropertiesStore.valueToString(60000));
34          }
35      }, "editor", "editor user settings");
36  
37      /** Key to store expression color. */
38      String EXPRESSION_COLOR_KEY = "expressionColor";
39  
40      /** Key to store invalid color. */
41      String INVALID_COLOR_KEY = "invalidColor";
42  
43      /** Key to store inactive color. */
44      String INACTIVE_COLOR_KEY = "inactiveColor";
45  
46      /** Key to store max number of recent files. */
47      String MAX_RECENT_FILES_KEY = "maxRecentFiles";
48  
49      /** Key to store max tooltip length. */
50      String MAX_TOOLTIP_LENGTH_KEY = "maxTooltipLength";
51  
52      /** Key to store max number of drop-down items. */
53      String MAX_DROPDOWN_ITEMS_KEY = "maxDropdownItems";
54  
55      /** Key to store max number of navigation steps. */
56      String MAX_NAVIGATE_STEPS_KEY = "maxNavigateSteps";
57  
58      /** Key to store recent files. */
59      String RECENT_FILES_KEY = "recentFiles";
60  
61      /** Key to store auto-save milliseconds. */
62      String AUTOSAVE_MS_KEY = "autosaveMs";
63  
64  }