AbstractImagePrimitive
AbstractImagePrimitive ⇐ AbstractPrimitive
Kind: global abstract class
Extends: AbstractPrimitive
Properties
Name | Type | Description |
---|---|---|
dataEventBus | DataEventBus | A reference on a Data event bus. |
url | String | Array.<String> | null | An image url or a list of image url. If this property is set with a list, the first working one is used. |
$$url | String | null | Private property containing the url of the image rendered by this primitive |
type | String | The type of primitive (text, rectangle, image) |
preload | boolean | Preload the image as soon the image is build, even if it is rendered much later |
position | String | Position of the image (in pixels). Currently supported: see statics |
repeat | String | Repeat flag of the image. Currently supported: repeat, no-repeat (by default = no-repeat) |
isLoaded | boolean | Flag set to false as soon as you change the url of an image, or set to true as soon as the image is loaded |
clearBeforeLoad | boolean | Flag set to false as soon as you change the url of an image, or set to true as soon as the image is loaded |
isInError | boolean | If this flag is set to true, it means that there was an error during the loading of the image |
- AbstractImagePrimitive ⇐
AbstractPrimitive
AbstractImagePrimitive()
An image primitive is an object that can be rendered by all kinds of renderer and it aims at displaying an image.
rendererCreate()
Kind: instance method of AbstractImagePrimitive
loadImage() ⇒ Promise.<Object, Error>
Load the image but do not render it. Useful when you need to preload the image, or when you need to find a valid one.
Kind: instance method of AbstractImagePrimitive
Returns: Promise.<Object, Error>
- Returns a promise resolved with an object (width, height, id) or an error.
_defineSettings(defaultSettings) ⇒ Object
Define settings for the rendering
Kind: instance method of AbstractImagePrimitive
Returns: Object
- An object holding the rendering settings
Access: protected
Param | Type | Description |
---|---|---|
defaultSettings | Object | Empty default settings |
onImageLoaded()
Dispatch image loaded event
Kind: instance method of AbstractImagePrimitive
onImageError()
Dispatch image load error event
Kind: instance method of AbstractImagePrimitive
_updateRenderingContext_url()
Kind: instance method of AbstractImagePrimitive