new BoxElement(options)
constructs a BoxElement instance
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Object | the options object to be merged with defaults |
Extends
Methods
-
align(parentElement, mode)
-
Aligns the Element instance, based on it's parent bounds or specified parentElement bounds and mode parameter
Parameters:
Name Type Description parentElementObject | null if null, it considers the actual Element instance parent, otherwise it aligns in base of the specified parentElement modeString can be a set of one or two strings (blank separated) in any order, for horizontalModes (left, center, right), for verticalModes (top, middle, bottom) - Inherited From:
Returns:
to make chainable the method- Type
- Element
-
bindEvents()
-
binds all events specified in the settings object for the Element instance, it supports all DrawJS classes events (eg. click, mouseover, etc...)
- Inherited From:
-
draw()
-
draws all graphic elements of the Element instance
- Inherited From:
-
drawElements()
-
drawElements method implementation
-
getComputedBounds()
-
returns the actual computed bounds of the Element instance, including scale factor and top, right, bottom, left coordinates
- Inherited From:
Returns:
the actual Element instance computed bounds object
{ { top: number, right: number, bottom: number, left: number, x: number, y: number, width: number, height: number } }- Type
- Object
-
getContentElement()
-
gets the content Element instance
Returns:
the instance used to draw the content element- Type
- Element
-
getTitleElement()
-
gets the title LabelElement instance
Returns:
the instance used to draw the title- Type
- LabelElement
-
init()
-
empty init method, to be overriden in classes that extends Element, to use for all those initializations you might need after having rendered the Element
- Inherited From:
-
initData()
-
initializes data object for the Element instance
- Inherited From:
-
initDefaults()
-
Initialize default settings for Box Element
- Overrides:
-
initSettings(options)
-
initializes settings object for the Element instance
Parameters:
Name Type Description optionsObject the options object to be merged with defaults - Inherited From:
-
setCache(cacheOptions, force)
-
sets or updates the Cache of the Element instance
Parameters:
Name Type Description cacheOptionsObject | Shadow .. forceBoolean .... - Inherited From:
Returns:
to make chainable the method- Type
- Element
-
setComputedBounds(boundsOptions)
-
sets or updates the bounds of the Element instance
Parameters:
Name Type Description boundsOptionsObject | Number ... - Inherited From:
Returns:
to make chainable the method- Type
- Element
-
setMask(maskOptions, force)
-
sets or updates the Mask of the Element instance
Parameters:
Name Type Description maskOptionsObject | Shadow can be an object with {color, x, y, blur}
or directly an instance of Shadow (DrawJS)forceBoolean .... - Inherited From:
Returns:
to make chainable the method- Type
- Element
-
setPosition( [positionOptions] [, override] [, force])
-
sets or updates the position of the Element instance
Parameters:
Name Type Argument Default Description positionOptionsObject <optional>
null can contain x and y or only one or them Properties
Name Type Argument Default Description xNumber <optional>
0 the x position yNumber <optional>
0 the y position overrideBoolean <optional>
false specify to override actual Element position forceBoolean <optional>
true ... - Inherited From:
Returns:
to make chainable the method- Type
- Element
-
setReg()
-
sets to center/middle the regPoint of the Element instance
- Inherited From:
-
setScale(scaleOptions)
-
sets or updates the scaling of the Element instance
Parameters:
Name Type Description scaleOptionsObject | Number can be an object with x and y couple or only a number to be used for both - Inherited From:
- Overrides:
Returns:
to make chainable the method- Type
- Element
-
setShadow(shadowOptions, force)
-
sets or updates the Shadow of the Element instance
Parameters:
Name Type Description shadowOptionsObject | Shadow can be an object with {color, x, y, blur}
or directly an instance of Shadow (DrawJS)forceBoolean .... - Inherited From:
Returns:
to make chainable the method- Type
- Element