Class: Rectangle

algo.render. Rectangle

algo.render.Rectangle

new Rectangle(_options)

Parameters:
Name Type Description
_options
Source:

Extends

Methods

<static> create(box, stroke, fill, strokeWidth)

create a rectangle with the most basic options. Syntactic sugar
Parameters:
Name Type Description
box
stroke
fill
strokeWidth
Source:

addChild(e)

add a child element
Parameters:
Name Type Description
e
Inherited From:
Source:

addStates(states)

add new states in the given object
Parameters:
Name Type Description
states
Inherited From:
Source:

center(layout)

center on the given x/y location
Parameters:
Name Type Description
layout
Source:

createDOM()

get the DOM element for this rectangle.
Source:

destroy()

destroyy the element, remove from parent. Destroy all children first, then ourselves.
Inherited From:
Source:

fillBox(layout)

position and size to fill the given box
Parameters:
Name Type Description
layout
Inherited From:
Source:

fromShape(shape)

get our geometry from some other rectangle or circle like object.
Parameters:
Name Type Description
shape Object some line like object
Source:

get(properties) → {object}

shallow clone the properties from the object, using inheritance to fill values if not present on the object. Values that are not present will be left untouched and therefore can be pre-filled with defaults.
Parameters:
Name Type Description
properties
Inherited From:
Source:
Returns:
a new properties objects with requested values.
Type
object

getBounds()

a box object representing our bounds
Source:

getCSSColor(obj) → {String}

return a CSS color specification from any object / string that can be used to construct an algo.Color
Parameters:
Name Type Description
obj String | algo.Color
Inherited From:
Source:
Returns:
- for colors with alpha === 1.0 it will be '#xxxxxx', otherwise 'rgba(x,x,x,x)' NOTE: This should have been static but its too late now...just use algo.render.Element.prototype.getCSSColor.call(null, obj)
Type
String

getInheritedValue(key)

get the value for the given property from the object or the nearest parent where it is set. if the property is not found in the chain then return the default value
Parameters:
Name Type Description
key
Inherited From:
Source:

getOwnValue(key)

get the value for the given property from the object if set otherwise return the default value
Parameters:
Name Type Description
key
Inherited From:
Source:

layout(box)

position / size the element within the given algo.render.Box object. The meaning is deferred to inheriting classes
Parameters:
Name Type Description
box algo.layout.Box
Source:

removeChild(e)

remove the child from this elements child collection
Parameters:
Name Type Description
e
Inherited From:
Source:

set(options)

apply all the properties in options. child class should overload by but call the base class to ensure base class properties are set as well.
Parameters:
Name Type Description
options
Inherited From:
Source:

setState(stateName)

apply the properties of the state specified by name e.g. algo.render.kS_BLUE, but could be any name including custom states supplied by user
Parameters:
Name Type Description
stateName string
Inherited From:
Source:

update()

ensure the DOM is created and updated and apply the same procedure to our children
Inherited From:
Source:

updateDOM()

get an object with our CSS properties. These are combined with those of inheriting classes to construct the full set of CSS properties for this element
Inherited From:
Source: