Constructor
new Selection(presentation)
Create an empty selection for a given presentation.
Parameters:
Name | Type | Description |
---|---|---|
presentation |
module:model/Presentation.Presentation | A Sozi presentation object |
- Source:
Members
currentFrame :module:model/Presentation.Frame
The frame that was selected last, null
if no frame is selected.
Type:
- Source:
presentation :module:model/Presentation.Presentation
The presentation where selections happen.
Type:
- Source:
selectedFrames :Array.<module:model/Presentation.Frame>
The list of selected frames.
Type:
- Array.<module:model/Presentation.Frame>
- Default Value:
[]
- Source:
selectedLayers :Array.<module:model/Presentation.Layer>
The list of selected layers.
Type:
- Array.<module:model/Presentation.Layer>
- Default Value:
[]
- Source:
Methods
addFrame(frame)
Add a frame to this selection.
Parameters:
Name | Type | Description |
---|---|---|
frame |
module:model/Presentation.Frame | The frame to add. |
- Source:
addLayer(layer)
Add a layer to this selection.
Parameters:
Name | Type | Description |
---|---|---|
layer |
module:model/Presentation.Layer | The layer to add. |
- Source:
fromStorable(storable)
Copy the properties of the given object into this instance.
Parameters:
Name | Type | Description |
---|---|---|
storable |
object | A plain object with the properties to copy. |
- Source:
hasFrames(frames) → {boolean}
Check whether this selection contains the given frames.
Parameters:
Name | Type | Description |
---|---|---|
frames |
Array.<module:model/Presentation.Frame> | The frames to check. |
- Source:
Returns:
true
if all the given frames are selected.
- Type
- boolean
hasLayers(layers) → {boolean}
Check whether this selection contains the given layers.
Parameters:
Name | Type | Description |
---|---|---|
layers |
Array.<module:model/Presentation.Layer> | The layers to check. |
- Source:
Returns:
true
if all the given layers are selected.
- Type
- boolean
removeFrame(frame)
Remove a frame from this selection.
Parameters:
Name | Type | Description |
---|---|---|
frame |
module:model/Presentation.Frame | The frame to remove. |
- Source:
removeLayer(layer)
Remove a layer from this selection.
Parameters:
Name | Type | Description |
---|---|---|
layer |
module:model/Presentation.Layer | The layer to remove. |
- Source:
toggleFrameSelection(frame)
Add or remove the given frame to/from this selection.
If the frame is not selected, add it to the selection, otherwise, remove it.
Parameters:
Name | Type | Description |
---|---|---|
frame |
module:model/Presentation.Frame | The frame to add or remove. |
- Source:
toggleLayerSelection(layer)
Add or remove the given layer to/from this selection.
If the layer is not selected, add it to the selection, otherwise, remove it.
Parameters:
Name | Type | Description |
---|---|---|
layer |
module:model/Presentation.Layer | The layer to add or remove. |
- Source:
toStorable() → {object}
Convert this instance to a plain object that can be stored as JSON.
The result contains all the properties needed by the editor to restore the state of this instance.
- Source:
Returns:
- A plain object with the properties needed by the editor.
- Type
- object