Record Class ModelEditorSettings

java.lang.Object
java.lang.Record
dk.gtz.graphedit.model.ModelEditorSettings
Record Components:
gridSizeX - Width of snapgrid cells
gridSizeY - Height of snapgrid cells
gridSnap - When true, vertices will snap to the grid
useLightTheme - When true, the editor will use a light color scheme
autoOpenLastProject - When true, the last opened project will be automatically opened next time you start the editor
showInspectorPane - (Deprecated) doesn't do anything anymore
showInfoToasts - When true, will display toasts on logger.info calls
showWarnToasts - When true, will display toasts on logger.warn calls
showErrorToasts - When true, will display toasts on logger.error calls
showTraceToasts - When true, will display toasts on logger.trace calls
lastOpenedProject - Filepath to the last opened graphedit project file
recentProjects - List of filepaths that have been recently opened
disabledPlugins - List of plugin filepaths that are disabled
tipIndex - Index of the current tip being shown
showTips - When true, will show a tip of the day on startup

public record ModelEditorSettings(double gridSizeX, double gridSizeY, boolean gridSnap, boolean useLightTheme, boolean autoOpenLastProject, boolean showInspectorPane, boolean showInfoToasts, boolean showWarnToasts, boolean showErrorToasts, boolean showTraceToasts, String lastOpenedProject, List<String> recentProjects, List<String> disabledPlugins, int tipIndex, boolean showTips) extends Record
General editor settings model object containing a users' prefered theme, recent projects and other edior-wide preferences and settings. This is meant to be serialized and deserialized to/from disk
  • Constructor Details

    • ModelEditorSettings

      public ModelEditorSettings()
      Constructs a ModelEditorSettings instance with default values.
    • ModelEditorSettings

      public ModelEditorSettings(ViewModelEditorSettings viewmodel)
      Constructs a ModelEditorSettings instance based on the associated ViewModel
      Parameters:
      viewmodel - The viewmodel to base the new instance value off of
    • ModelEditorSettings

      public ModelEditorSettings(double gridSizeX, double gridSizeY, boolean gridSnap, boolean useLightTheme, boolean autoOpenLastProject, @Deprecated boolean showInspectorPane, boolean showInfoToasts, boolean showWarnToasts, boolean showErrorToasts, boolean showTraceToasts, String lastOpenedProject, List<String> recentProjects, List<String> disabledPlugins, int tipIndex, boolean showTips)
      Creates an instance of a ModelEditorSettings record class.
      Parameters:
      gridSizeX - the value for the gridSizeX record component
      gridSizeY - the value for the gridSizeY record component
      gridSnap - the value for the gridSnap record component
      useLightTheme - the value for the useLightTheme record component
      autoOpenLastProject - the value for the autoOpenLastProject record component
      showInspectorPane - the value for the showInspectorPane record component
      showInfoToasts - the value for the showInfoToasts record component
      showWarnToasts - the value for the showWarnToasts record component
      showErrorToasts - the value for the showErrorToasts record component
      showTraceToasts - the value for the showTraceToasts record component
      lastOpenedProject - the value for the lastOpenedProject record component
      recentProjects - the value for the recentProjects record component
      disabledPlugins - the value for the disabledPlugins record component
      tipIndex - the value for the tipIndex record component
      showTips - the value for the showTips record component
  • Method Details

    • getEditorSettingsFile

      public static Path getEditorSettingsFile()
      Get the file of the editor settings. Note that the filepath may be different depending on the operating system and $HOME variable
      Returns:
      The OS-specific file path to editor settings
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • gridSizeX

      public double gridSizeX()
      Returns the value of the gridSizeX record component.
      Returns:
      the value of the gridSizeX record component
    • gridSizeY

      public double gridSizeY()
      Returns the value of the gridSizeY record component.
      Returns:
      the value of the gridSizeY record component
    • gridSnap

      public boolean gridSnap()
      Returns the value of the gridSnap record component.
      Returns:
      the value of the gridSnap record component
    • useLightTheme

      public boolean useLightTheme()
      Returns the value of the useLightTheme record component.
      Returns:
      the value of the useLightTheme record component
    • autoOpenLastProject

      public boolean autoOpenLastProject()
      Returns the value of the autoOpenLastProject record component.
      Returns:
      the value of the autoOpenLastProject record component
    • showInspectorPane

      @Deprecated public boolean showInspectorPane()
      Deprecated.
      Returns the value of the showInspectorPane record component.
      Returns:
      the value of the showInspectorPane record component
    • showInfoToasts

      public boolean showInfoToasts()
      Returns the value of the showInfoToasts record component.
      Returns:
      the value of the showInfoToasts record component
    • showWarnToasts

      public boolean showWarnToasts()
      Returns the value of the showWarnToasts record component.
      Returns:
      the value of the showWarnToasts record component
    • showErrorToasts

      public boolean showErrorToasts()
      Returns the value of the showErrorToasts record component.
      Returns:
      the value of the showErrorToasts record component
    • showTraceToasts

      public boolean showTraceToasts()
      Returns the value of the showTraceToasts record component.
      Returns:
      the value of the showTraceToasts record component
    • lastOpenedProject

      public String lastOpenedProject()
      Returns the value of the lastOpenedProject record component.
      Returns:
      the value of the lastOpenedProject record component
    • recentProjects

      public List<String> recentProjects()
      Returns the value of the recentProjects record component.
      Returns:
      the value of the recentProjects record component
    • disabledPlugins

      public List<String> disabledPlugins()
      Returns the value of the disabledPlugins record component.
      Returns:
      the value of the disabledPlugins record component
    • tipIndex

      public int tipIndex()
      Returns the value of the tipIndex record component.
      Returns:
      the value of the tipIndex record component
    • showTips

      public boolean showTips()
      Returns the value of the showTips record component.
      Returns:
      the value of the showTips record component