AbstractImagePrimitive

AbstractImagePrimitive ⇐ AbstractPrimitive

Kind: global abstract class
Extends: AbstractPrimitive
Properties

NameTypeDescription
dataEventBusDataEventBus

A reference on a Data event bus.

urlString | 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.

$$urlString | null

Private property containing the url of the image rendered by this primitive

typeString

The type of primitive (text, rectangle, image)

preloadboolean

Preload the image as soon the image is build, even if it is rendered much later

positionString

Position of the image (in pixels). Currently supported: see statics

repeatString

Repeat flag of the image. Currently supported: repeat, no-repeat (by default = no-repeat)

isLoadedboolean

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

clearBeforeLoadboolean

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

isInErrorboolean

If this flag is set to true, it means that there was an error during the loading of the image

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

ParamTypeDescription
defaultSettingsObject

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