Element class (Swimlane)

Element(oElements, oElementOptsopt)

new Element(oElements, oElementOptsopt)

Defines additional properties and methods of the Element object (holds information(options) about an element within the control).

Every option of the Surface.ElementOptions type has associated a property of the control. For instance, the option:

caption {string}, defines the element's caption
is associated with the property:
Caption {string}, defines the element's caption
which means that the following statements are equivalent:
oElement.Options = {caption: "name"}
oElement.SetOptions({caption: "name"})
oElement.Caption = "name"
oElement.SetCaption("name")
where oElement is an object of Element type
Parameters:
Name Type Attributes Description
oElements Elements Indicates an object of Elements type that's the owner collection of this element
oElementOpts Surface.ElementOptions <optional>
defines the element's caption or options as an object of Surface.ElementOptions type
Element

Methods

Center(pool, lane, phase)

The Center() method centers the element within specified pool, lane or/and phase.
Parameters:
Name Type Description
pool any The pool parameter could be any of the following:
  • pool {(undefined|null)}, specifies that the element's pool is not changed (current pool)
  • pool {number}, indicates a numeric value that defines the index of the newly pool
  • pool {string}, specifies a string expression that defines the identifier/key/plain-caption of the newly pool
  • pool {Pool}, specifies the object reference to the newly pool
lane any The lane parameter could be any of the following:
  • lane {(undefined|null)}, specifies that the element's lane is not changed (current lane)
  • lane {number}, indicates a numeric value that defines the index of the lane
  • lane {string}, specifies the caption of the lane
  • lane {object}, specifies an object of {i(ndex),c(aption)} type as epxlained:
    • i(ndex) {number}, specifies the index of the lane (zero-based)
    • c(caption) {string}, indicates the caption of the lane
phase any The phase parameter could be any of the following:
  • phase {(undefined|null)}, specifies that the element's phase is not changed (current phase)
  • phase {number}, indicates a numeric value that defines the index of the phase
  • phase {string}, specifies the caption of the phase
  • phase {object}, specifies an object of {i(ndex),c(aption)} type as epxlained:
    • i(ndex) {number}, specifies the index of the phase (zero-based)
    • c(caption) {string}, indicates the caption of the phase
Since:
  • 1.7
Example
For instance, the element.Center() method centers the element within its current pool, lane and phase
Center

GetLane() → {object}

The GetLane() method gets the lane of the pool that hosts the element, as an object of {i(ndex),c(aption),s(ize)} type. The center-point of the element determines the lane.
Since:
  • 1.7
Returns:
Returns null (the element is not hosted by any lane) or an object of {i(ndex),c(aption),s(ize)} type as epxlained:
  • i(ndex) {number}, specifies the index of the lane (zero-based)
  • c(caption) {string}, indicates the caption of the lane
  • s(size) {number}, specifies the height of the lane
Type
object
GetLane

GetPhase() → {object}

The GetPhase() method gets the phase of the pool that hosts the element, as an object of {i(ndex),c(aption),s(ize)} type. The center-point of the element determines the phase.
Since:
  • 1.7
Returns:
Returns null (the element is not hosted by any phase) or an object of {i(ndex),c(aption),s(ize)} type as epxlained:
  • i(ndex) {number}, specifies the index of the phase (zero-based)
  • c(caption) {string}, indicates the caption of the phase
  • s(size) {number}, specifies the width of the phase
Type
object
GetPhase

GetPool() → {Pool}

The GetPool() method gets the element's pool.
Since:
  • 1.7
Returns:
Returns null (the element is not hosted by any pool) or an object of {Pool} type that specifies the element's pool
Type
Pool
GetPool

SetLane(id)

The SetLane() method changes the element's lane (moves the element to a different lane)
Parameters:
Name Type Description
id any The id parameter could be any of the following:
  • id {number}, indicates a numeric value that defines the index of the lane
  • id {string}, specifies the caption of the lane
  • id {object}, specifies an object of {i(ndex),c(aption)} type as epxlained:
    • i(ndex) {number}, specifies the index of the lane (zero-based)
    • c(caption) {string}, indicates the caption of the lane
Since:
  • 1.7
SetLane

SetPhase(id)

The SetPhase() method changes the element's phase (moves the element to a different phase)
Parameters:
Name Type Description
id any The id parameter could be any of the following:
  • id {number}, indicates a numeric value that defines the index of the phase
  • id {string}, specifies the caption of the phase
  • id {object}, specifies an object of {i(ndex),c(aption)} type as epxlained:
    • i(ndex) {number}, specifies the index of the phase (zero-based)
    • c(caption) {string}, indicates the caption of the phase
Since:
  • 1.7
SetPhase

SetPool(id)

The SetPool() method changes the element's pool (moves the element to a different pool)
Parameters:
Name Type Description
id any The id parameter could be any of the following:
  • id {number}, indicates a numeric value that defines the index of the newly pool
  • id {string}, specifies a string expression that defines the identifier/key/plain-caption of the newly pool
  • id {Pool}, specifies the object reference to the newly pool
Since:
  • 1.7
SetPool