The JavaScript class providing information about a palette list. Obtain from PaletteObjectManager methods like getPaletteListByElementId
, getScenePaletteList
or getPaletteListById
.
More...
Public Slots | |
String | getPath () |
Returns the folder in which this palette list is located. More... | |
bool | isValid () |
Returns true if the palette list object is valid. More... | |
Palette * | getPaletteByIndex (int index) |
Returns a Palette object for the palette at position 'index'. More... | |
Palette * | getPaletteById (String id) |
Returns a Palette object for the palette with ID 'id'. More... | |
Palette * | getPaletteById (String id, bool lookInLinkedPalettes) |
Returns a Palette object for the palette with ID 'id'. More... | |
bool | getLock () |
Try getting the database lock, returning true on success or false on failure. Without the lock, methods that change the state of the palette list can fail. More... | |
bool | releaseLock () |
Release the lock. More... | |
Palette * | createPalette (String &path) |
Create a new palette from a path String. More... | |
Palette * | createPalette (String &path, int index) |
Create a palette from a path String, inserted at position Index. More... | |
Palette * | createPaletteAtLocation (int location, int elementId, String diskName) |
Create a Palette at a physical location relative to the project. More... | |
Palette * | createPaletteAtLocation (int location, int elementId, String diskName, int index) |
Create a Palette at a physical location relative to the project, inserted at index in the paletteList. More... | |
Palette * | addPalette (String &path) |
Adds a palette to the end of this palette list, returning a Palette object. More... | |
Palette * | insertPalette (String &path, int index) |
Adds a palette to this palette list at the position specified by 'index', returning a Palette object. More... | |
Palette * | addPaletteAtLocation (int location, int elementId, String &name) |
Adds a palette to the end of this palette list, returning a Palette object. More... | |
Palette * | insertPaletteAtLocation (int location, int elementId, String &name, int index) |
Adds a palette to this palette list at the position specified by 'index', returning a Palette object. More... | |
bool | removePaletteByIndex (int index) |
Remove the palette at the position specified by 'index'. More... | |
bool | removePaletteById (String id) |
Remove the palette with the specified palette ID. More... | |
bool | removePalette (String &path) |
Remove the palette by path. More... | |
Palette * | findPaletteOfColor (String &colorId) |
Search the given color ID and return the first match, also looking in the scene palette list if applicable. More... | |
bool | movePaletteUp (String &id) |
Move the specified palette up one place in this palette list. More... | |
bool | movePaletteDown (String &id) |
Move the specified palette down one place in this palette list. More... | |
bool | isLoaded () |
Returns true if the palette was successfully loaded from the disk. More... | |
Properties | |
int | numPalettes |
Number of palettes in this palette list. More... | |
String | id |
The palette list ID of this palette list. More... | |
int | type |
The type of palette list. One of the PaletteListType constants. More... | |
int | elementId |
Will return the elementId of this palette list if the type is PaletteListType.Element. Will return -1 if the type is PaletteListType.Scene. More... | |
The JavaScript class providing information about a palette list. Obtain from PaletteObjectManager methods like getPaletteListByElementId
, getScenePaletteList
or getPaletteListById
.
Defines a collection of palettes.
Provides access to some of the standard functionality of palette lists. Some methods change the state of the palette list. If the database access lock cannot be obtained, they will throw a javascript exception.
|
slot |
Adds a palette to the end of this palette list, returning a Palette object.
path | : Path to existing palette file. |
|
slot |
Adds a palette to the end of this palette list, returning a Palette object.
location | : One of the valid PaletteLocation constants in that context. Any value except PaletteLocation.EXTERNAL. |
elementId | : The element ID if location is PaletteLocation.ELEMENT. Ignored in other cases. |
name | : The disk name of the palette. |
|
slot |
Create a new palette from a path String.
If the file indicated by path already exists, it will append a number to the path to create a unique name.
path | : The path to create the palette from. |
|
slot |
Create a palette from a path String, inserted at position Index.
If the file indicated by path already exists, it will append a number to the path to create a unique name.
path | : The path to create the palette from. |
index | : The index for the created palette to be inserted at. |
|
slot |
Create a Palette at a physical location relative to the project.
If the location is not in an element, the parameter element ID is ignored.
location | : The location for the palette to be created at. |
elementId | : The Id of the element found at the location. |
diskName | : The name of the disk. |
|
slot |
Create a Palette at a physical location relative to the project, inserted at index in the paletteList.
If the location is not in an element, the parameter element ID is ignored.
location | : The location for the palette to be created at. |
elementId | : The Id of the element found at the location. |
diskName | : The name of the disk. |
index | : The index that the new plaette will be inserted at. |
|
slot |
Search the given color ID and return the first match, also looking in the scene palette list if applicable.
colorId | : The color ID to search. |
|
slot |
Try getting the database lock, returning true on success or false on failure. Without the lock, methods that change the state of the palette list can fail.
|
slot |
|
slot |
Returns a Palette object for the palette with ID 'id'.
id | : Palette ID of palette in this palette list. |
lookInLinkedPalettes | : whether to look in other accessible palettes, typically the scene palette List when searching from an element palette list. |
|
slot |
|
slot |
Returns the folder in which this palette list is located.
|
slot |
Adds a palette to this palette list at the position specified by 'index', returning a Palette object.
path | : Path to existing palette file. |
index | : The index of the position where the palette is inserted. |
|
slot |
Adds a palette to this palette list at the position specified by 'index', returning a Palette object.
location | : One of the valid PaletteLocation constants in that context. Any value except PaletteLocation.EXTERNAL. |
elementId | : The element ID if location is PaletteLocation.ELEMENT. Ignored in other cases. |
name | : Path to existing palette file. |
index | : The index of the position where the palette is inserted. |
|
slot |
Returns true if the palette was successfully loaded from the disk.
|
slot |
Returns true if the palette list object is valid.
|
slot |
Move the specified palette down one place in this palette list.
id | : ID of the palette to move. |
|
slot |
Move the specified palette up one place in this palette list.
id | : ID of the palette to move. |
|
slot |
Release the lock.
|
slot |
Remove the palette by path.
path | : The path of the palette to remove. |
|
slot |
Remove the palette with the specified palette ID.
id | : ID of the palette to remove. |
|
slot |
Remove the palette at the position specified by 'index'.
index | : Index of palette to remove. |
|
read |
Will return the elementId of this palette list if the type is PaletteListType.Element. Will return -1 if the type is PaletteListType.Scene.
|
read |
The palette list ID of this palette list.
|
read |
Number of palettes in this palette list.
|
read |
The type of palette list. One of the PaletteListType constants.