Package dk.gtz.graphedit.model
Record Class ModelEditorSettings
java.lang.Object
java.lang.Record
dk.gtz.graphedit.model.ModelEditorSettings
- Record Components:
gridSizeX- Width of snapgrid cellsgridSizeY- Height of snapgrid cellsgridSnap- When true, vertices will snap to the griduseLightTheme- When true, the editor will use a light color schemeautoOpenLastProject- When true, the last opened project will be automatically opened next time you start the editorshowInspectorPane- (Deprecated) doesn't do anything anymoreshowInfoToasts- When true, will display toasts on logger.info callsshowWarnToasts- When true, will display toasts on logger.warn callsshowErrorToasts- When true, will display toasts on logger.error callsshowTraceToasts- When true, will display toasts on logger.trace callslastOpenedProject- Filepath to the last opened graphedit project filerecentProjects- List of filepaths that have been recently openeddisabledPlugins- List of plugin filepaths that are disabledtipIndex- Index of the current tip being shownshowTips- 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 Summary
ConstructorsConstructorDescriptionConstructs a ModelEditorSettings instance with default values.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) Creates an instance of aModelEditorSettingsrecord class.ModelEditorSettings(ViewModelEditorSettings viewmodel) Constructs a ModelEditorSettings instance based on the associated ViewModel -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theautoOpenLastProjectrecord component.Returns the value of thedisabledPluginsrecord component.final booleanIndicates whether some other object is "equal to" this one.static PathGet the file of the editor settings.doubleReturns the value of thegridSizeXrecord component.doubleReturns the value of thegridSizeYrecord component.booleangridSnap()Returns the value of thegridSnaprecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thelastOpenedProjectrecord component.Returns the value of therecentProjectsrecord component.booleanReturns the value of theshowErrorToastsrecord component.booleanReturns the value of theshowInfoToastsrecord component.booleanDeprecated.booleanshowTips()Returns the value of theshowTipsrecord component.booleanReturns the value of theshowTraceToastsrecord component.booleanReturns the value of theshowWarnToastsrecord component.inttipIndex()Returns the value of thetipIndexrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of theuseLightThemerecord component.
-
Constructor Details
-
ModelEditorSettings
public ModelEditorSettings()Constructs a ModelEditorSettings instance with default values. -
ModelEditorSettings
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 aModelEditorSettingsrecord class.- Parameters:
gridSizeX- the value for thegridSizeXrecord componentgridSizeY- the value for thegridSizeYrecord componentgridSnap- the value for thegridSnaprecord componentuseLightTheme- the value for theuseLightThemerecord componentautoOpenLastProject- the value for theautoOpenLastProjectrecord componentshowInspectorPane- the value for theshowInspectorPanerecord componentshowInfoToasts- the value for theshowInfoToastsrecord componentshowWarnToasts- the value for theshowWarnToastsrecord componentshowErrorToasts- the value for theshowErrorToastsrecord componentshowTraceToasts- the value for theshowTraceToastsrecord componentlastOpenedProject- the value for thelastOpenedProjectrecord componentrecentProjects- the value for therecentProjectsrecord componentdisabledPlugins- the value for thedisabledPluginsrecord componenttipIndex- the value for thetipIndexrecord componentshowTips- the value for theshowTipsrecord component
-
-
Method Details
-
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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
gridSizeX
public double gridSizeX()Returns the value of thegridSizeXrecord component.- Returns:
- the value of the
gridSizeXrecord component
-
gridSizeY
public double gridSizeY()Returns the value of thegridSizeYrecord component.- Returns:
- the value of the
gridSizeYrecord component
-
gridSnap
public boolean gridSnap()Returns the value of thegridSnaprecord component.- Returns:
- the value of the
gridSnaprecord component
-
useLightTheme
public boolean useLightTheme()Returns the value of theuseLightThemerecord component.- Returns:
- the value of the
useLightThemerecord component
-
autoOpenLastProject
public boolean autoOpenLastProject()Returns the value of theautoOpenLastProjectrecord component.- Returns:
- the value of the
autoOpenLastProjectrecord component
-
showInspectorPane
Deprecated.Returns the value of theshowInspectorPanerecord component.- Returns:
- the value of the
showInspectorPanerecord component
-
showInfoToasts
public boolean showInfoToasts()Returns the value of theshowInfoToastsrecord component.- Returns:
- the value of the
showInfoToastsrecord component
-
showWarnToasts
public boolean showWarnToasts()Returns the value of theshowWarnToastsrecord component.- Returns:
- the value of the
showWarnToastsrecord component
-
showErrorToasts
public boolean showErrorToasts()Returns the value of theshowErrorToastsrecord component.- Returns:
- the value of the
showErrorToastsrecord component
-
showTraceToasts
public boolean showTraceToasts()Returns the value of theshowTraceToastsrecord component.- Returns:
- the value of the
showTraceToastsrecord component
-
lastOpenedProject
Returns the value of thelastOpenedProjectrecord component.- Returns:
- the value of the
lastOpenedProjectrecord component
-
recentProjects
Returns the value of therecentProjectsrecord component.- Returns:
- the value of the
recentProjectsrecord component
-
disabledPlugins
Returns the value of thedisabledPluginsrecord component.- Returns:
- the value of the
disabledPluginsrecord component
-
tipIndex
public int tipIndex()Returns the value of thetipIndexrecord component.- Returns:
- the value of the
tipIndexrecord component
-
showTips
public boolean showTips()Returns the value of theshowTipsrecord component.- Returns:
- the value of the
showTipsrecord component
-