visman::components::visman_core::PresetList
Overview
interface PresetList extends Observable
Container managing all Preset objects within a project.
Provides functionality for creation, duplication, renaming,
deletion and JSON import of presets.
Operation Index
- createNew
-
Creates a new preset with the given name.
- createDuplicate
-
Creates a duplicate of an existing preset, including all its
configuration such as viewports, layers and events.
- importFromJSON
-
Imports a preset from a JSON representation.
- changePresetName
-
Changes the name of an existing preset.
- deletePreset
-
Deletes the given preset from the project.
- deletePresetByName
-
Deletes a preset by its name.
- asDictionary
-
Returns all presets as a dictionary.
Operations
Creates a new preset with the given name.
Parameters
- name
-
Name of the new preset.
Return Value
The newly created Preset instance.
Exceptions
- InvalidName
-
If the provided name does not meet naming rules.
- DuplicateEntity
-
If a preset with the same name already exists.
Preset* createDuplicate(Preset* preset)
Creates a duplicate of an existing preset, including all its
configuration such as viewports, layers and events.
Parameters
- preset
-
The preset to duplicate.
Return Value
The newly created duplicate Preset.
Imports a preset from a JSON representation.
Parameters
- json
-
JSON string describing a preset.
Return Value
The imported Preset instance.
Exceptions
- FormatError
-
If the JSON data is malformed or does not match the expected format.
- DuplicateEntity
-
If a preset with the same name already exists.
Changes the name of an existing preset.
Parameters
- preset
-
The preset whose name should be changed.
- newName
-
The new name to assign.
Exceptions
- InvalidName
-
If the new name does not meet naming rules.
- DuplicateEntity
-
If another preset with the same name already exists.
void deletePreset(Preset* preset)
Deletes the given preset from the project.
Parameters
- preset
-
The preset to delete.
void deletePresetByName(string preset) throws InvalidName
Deletes a preset by its name.
Parameters
- preset
-
Name of the preset to delete.
Exceptions
- InvalidName
-
If no preset with the given name exists.
Returns all presets as a dictionary.
Return Value
A dictionary mapping preset names to their corresponding Preset objects.