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 aModelEditorSettings
record class.ModelEditorSettings
(ViewModelEditorSettings viewmodel) Constructs a ModelEditorSettings instance based on the associated ViewModel -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the value of theautoOpenLastProject
record component.Returns the value of thedisabledPlugins
record component.final boolean
Indicates whether some other object is "equal to" this one.static Path
Get the file of the editor settings.double
Returns the value of thegridSizeX
record component.double
Returns the value of thegridSizeY
record component.boolean
gridSnap()
Returns the value of thegridSnap
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of thelastOpenedProject
record component.Returns the value of therecentProjects
record component.boolean
Returns the value of theshowErrorToasts
record component.boolean
Returns the value of theshowInfoToasts
record component.boolean
Deprecated.boolean
showTips()
Returns the value of theshowTips
record component.boolean
Returns the value of theshowTraceToasts
record component.boolean
Returns the value of theshowWarnToasts
record component.int
tipIndex()
Returns the value of thetipIndex
record component.final String
toString()
Returns a string representation of this record class.boolean
Returns the value of theuseLightTheme
record 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 aModelEditorSettings
record class.- Parameters:
gridSizeX
- the value for thegridSizeX
record componentgridSizeY
- the value for thegridSizeY
record componentgridSnap
- the value for thegridSnap
record componentuseLightTheme
- the value for theuseLightTheme
record componentautoOpenLastProject
- the value for theautoOpenLastProject
record componentshowInspectorPane
- the value for theshowInspectorPane
record componentshowInfoToasts
- the value for theshowInfoToasts
record componentshowWarnToasts
- the value for theshowWarnToasts
record componentshowErrorToasts
- the value for theshowErrorToasts
record componentshowTraceToasts
- the value for theshowTraceToasts
record componentlastOpenedProject
- the value for thelastOpenedProject
record componentrecentProjects
- the value for therecentProjects
record componentdisabledPlugins
- the value for thedisabledPlugins
record componenttipIndex
- the value for thetipIndex
record componentshowTips
- the value for theshowTips
record 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 thegridSizeX
record component.- Returns:
- the value of the
gridSizeX
record component
-
gridSizeY
public double gridSizeY()Returns the value of thegridSizeY
record component.- Returns:
- the value of the
gridSizeY
record component
-
gridSnap
public boolean gridSnap()Returns the value of thegridSnap
record component.- Returns:
- the value of the
gridSnap
record component
-
useLightTheme
public boolean useLightTheme()Returns the value of theuseLightTheme
record component.- Returns:
- the value of the
useLightTheme
record component
-
autoOpenLastProject
public boolean autoOpenLastProject()Returns the value of theautoOpenLastProject
record component.- Returns:
- the value of the
autoOpenLastProject
record component
-
showInspectorPane
Deprecated.Returns the value of theshowInspectorPane
record component.- Returns:
- the value of the
showInspectorPane
record component
-
showInfoToasts
public boolean showInfoToasts()Returns the value of theshowInfoToasts
record component.- Returns:
- the value of the
showInfoToasts
record component
-
showWarnToasts
public boolean showWarnToasts()Returns the value of theshowWarnToasts
record component.- Returns:
- the value of the
showWarnToasts
record component
-
showErrorToasts
public boolean showErrorToasts()Returns the value of theshowErrorToasts
record component.- Returns:
- the value of the
showErrorToasts
record component
-
showTraceToasts
public boolean showTraceToasts()Returns the value of theshowTraceToasts
record component.- Returns:
- the value of the
showTraceToasts
record component
-
lastOpenedProject
Returns the value of thelastOpenedProject
record component.- Returns:
- the value of the
lastOpenedProject
record component
-
recentProjects
Returns the value of therecentProjects
record component.- Returns:
- the value of the
recentProjects
record component
-
disabledPlugins
Returns the value of thedisabledPlugins
record component.- Returns:
- the value of the
disabledPlugins
record component
-
tipIndex
public int tipIndex()Returns the value of thetipIndex
record component.- Returns:
- the value of the
tipIndex
record component
-
showTips
public boolean showTips()Returns the value of theshowTips
record component.- Returns:
- the value of the
showTips
record component
-