/*
Set align data for the current column
766580
function setColumnAlign(change: Change, align: string): Change {
    const pos = tablePlugin.utils.getPosition(change.value);
    const columnCells = tablePlugin.utils.getCellsAtColumn(
        pos.table,
        pos.getColumnIndex()
    );
    columnCells.forEach(cell => {
        change.setNodeByKey(cell.key, { data: { align } });
    });
    return change;
}
3754
void align_static(Bindings bindings1) {
        bindings1.addAttribute(VAR_CONSUMED_NAME, prim(ROLE_IMG));
        bindings1.addAttribute(VAR_CONSUMED_NAME, prim(ROLE_HDR));
        bindings1.addAttribute(VAR_CONSUMED_NAME, prim(ROLE_IMG_REF));
        bindings1.addAttribute(VAR_CONSUMED_NAME, prim(ROLE_HDR_REF));     
        bindings1.addAttribute(VAR_CONSUMED_TYPE, prim(FILE));
        bindings1.addAttribute(VAR_CONSUMED_TYPE, prim(FILE));
        bindings1.addAttribute(VAR_CONSUMED_TYPE, prim(FILE));
        bindings1.addAttribute(VAR_CONSUMED_TYPE, prim(FILE));
        
        bindings1.addAttribute(VAR_BLOCK_TYPE,    prim(ALIGN_WARP));
        bindings1.addAttribute(VAR_PRODUCED_TYPE, prim(FILE));
        bindings1.addAttribute(VAR_PRODUCED_NAME, prim(ROLE_OUT));


        
    }
268513
public void setSimpleColumn(float llx, float lly, float urx, float ury, float leading, int alignment) {
        setLeading(leading);
        this.alignment = alignment;
        setSimpleColumn(llx, lly, urx, ury);
    }
1134021
private void align() {
        mainForm.setLayoutMargin(5);
        mainForm.setWidth100();
        mainForm.setHeight100();
        mainForm.setBackgroundColor("#FFFFFF");
        mainForm.setAlign(Alignment.CENTER);
        mainForm.setLayoutAlign(Alignment.CENTER);
        mainForm.setDefaultLayoutAlign(Alignment.CENTER);
        
        viewPort.setWidth(LAYOUT_WIDTH);
        viewPort.setLayoutAlign(Alignment.CENTER);
        viewPort.setAlign(Alignment.CENTER);
        viewPort.setDefaultLayoutAlign(Alignment.CENTER);
    }
115717
function () {
		// aligning non added elements is expensive
		if (!this.added) {
			this.alignOnAdd = true;
			return;
		}

		var wrapper = this,
			renderer = wrapper.renderer,
			elem = wrapper.element,
			translateX = wrapper.translateX || 0,
			translateY = wrapper.translateY || 0,
			x = wrapper.x || 0,
			y = wrapper.y || 0,
			align = wrapper.textAlign || 'left',
			alignCorrection = { left: 0, center: 0.5, right: 1 }[align],
			nonLeft = align && align !== 'left',
			shadows = wrapper.shadows;

		// apply translate
		css(elem, {
			marginLeft: translateX,
			marginTop: translateY
		});
		if (shadows) { // used in labels/tooltip
			each(shadows, function (shadow) {
				css(shadow, {
					marginLeft: translateX + 1,
					marginTop: translateY + 1
				});
			});
		}

		// apply inversion
		if (wrapper.inverted) { // wrapper is a group
			each(elem.childNodes, function (child) {
				renderer.invertChild(child, elem);
			});
		}

		if (elem.tagName === 'SPAN') {

			var width, height,
				rotation = wrapper.rotation,
				baseline,
				radians = 0,
				costheta = 1,
				sintheta = 0,
				quad,
				textWidth = pInt(wrapper.textWidth),
				xCorr = wrapper.xCorr || 0,
				yCorr = wrapper.yCorr || 0,
				currentTextTransform = [rotation, align, elem.innerHTML, wrapper.textWidth].join(',');

			if (currentTextTransform !== wrapper.cTT) { // do the calculations and DOM access only if properties changed

				if (defined(rotation)) {

					radians = rotation * deg2rad; // deg to rad
					costheta = mathCos(radians);
					sintheta = mathSin(radians);

					wrapper.setSpanRotation(rotation, sintheta, costheta);

				}

				width = pick(wrapper.elemWidth, elem.offsetWidth);
				height = pick(wrapper.elemHeight, elem.offsetHeight);

				// update textWidth
				if (width > textWidth && /[ \-]/.test(elem.textContent || elem.innerText)) { // #983, #1254
					css(elem, {
						width: textWidth + PX,
						display: 'block',
						whiteSpace: 'normal'
					});
					width = textWidth;
				}

				// correct x and y
				baseline = renderer.fontMetrics(elem.style.fontSize).b;
				xCorr = costheta < 0 && -width;
				yCorr = sintheta < 0 && -height;

				// correct for baseline and corners spilling out after rotation
				quad = costheta * sintheta < 0;
				xCorr += sintheta * baseline * (quad ? 1 - alignCorrection : alignCorrection);
				yCorr -= costheta * baseline * (rotation ? (quad ? alignCorrection : 1 - alignCorrection) : 1);

				// correct for the length/height of the text
				if (nonLeft) {
					xCorr -= width * alignCorrection * (costheta < 0 ? -1 : 1);
					if (rotation) {
						yCorr -= height * alignCorrection * (sintheta < 0 ? -1 : 1);
					}
					css(elem, {
						textAlign: align
					});
				}

				// record correction
				wrapper.xCorr = xCorr;
				wrapper.yCorr = yCorr;
			}

			// apply position with correction
			css(elem, {
				left: (x + xCorr) + PX,
				top: (y + yCorr) + PX
			});

			// force reflow in webkit to apply the left and top on useHTML element (#1249)
			if (isWebKit) {
				height = elem.offsetHeight; // assigned to height for JSLint purpose
			}

			// record current text transform
			wrapper.cTT = currentTextTransform;
		}
	}
36342
function () {
            // aligning non added elements is expensive
            if (!this.added) {
                this.alignOnAdd = true;
                return;
            }

            var wrapper = this,
              renderer = wrapper.renderer,
              elem = wrapper.element,
              translateX = wrapper.translateX || 0,
              translateY = wrapper.translateY || 0,
              x = wrapper.x || 0,
              y = wrapper.y || 0,
              align = wrapper.textAlign || 'left',
              alignCorrection = { left: 0, center: 0.5, right: 1 }[align],
              shadows = wrapper.shadows;

            // apply translate
            css(elem, {
                marginLeft: translateX,
                marginTop: translateY
            });
            if (shadows) { // used in labels/tooltip
                each(shadows, function (shadow) {
                    css(shadow, {
                        marginLeft: translateX + 1,
                        marginTop: translateY + 1
                    });
                });
            }

            // apply inversion
            if (wrapper.inverted) { // wrapper is a group
                each(elem.childNodes, function (child) {
                    renderer.invertChild(child, elem);
                });
            }

            if (elem.tagName === 'SPAN') {

                var width,
                  rotation = wrapper.rotation,
                  baseline,
                  textWidth = pInt(wrapper.textWidth),
                  currentTextTransform = [rotation, align, elem.innerHTML, wrapper.textWidth].join(',');

                if (currentTextTransform !== wrapper.cTT) { // do the calculations and DOM access only if properties changed


                    baseline = renderer.fontMetrics(elem.style.fontSize).b;

                    // Renderer specific handling of span rotation
                    if (defined(rotation)) {
                        wrapper.setSpanRotation(rotation, alignCorrection, baseline);
                    }

                    width = pick(wrapper.elemWidth, elem.offsetWidth);

                    // Update textWidth
                    if (width > textWidth && /[ \-]/.test(elem.textContent || elem.innerText)) { // #983, #1254
                        css(elem, {
                            width: textWidth + PX,
                            display: 'block',
                            whiteSpace: 'normal'
                        });
                        width = textWidth;
                    }

                    wrapper.getSpanCorrection(width, baseline, alignCorrection, rotation, align);
                }

                // apply position with correction
                css(elem, {
                    left: (x + (wrapper.xCorr || 0)) + PX,
                    top: (y + (wrapper.yCorr || 0)) + PX
                });

                // force reflow in webkit to apply the left and top on useHTML element (#1249)
                if (isWebKit) {
                    baseline = elem.offsetHeight; // assigned to baseline for JSLint purpose
                }

                // record current text transform
                wrapper.cTT = currentTextTransform;
            }
        }
5355
public void setVerticalAlignment(int verticalAlignment) {
        if (table != null)
            table.setExtendLastRow(verticalAlignment == Element.ALIGN_TOP);
        this.verticalAlignment = verticalAlignment;
    }
548946
def set_col_width(self, col, width):
        """"""

        # Mark content as changed
        post_command_event(self.main_window, self.ContentChangedMsg)

        tab = self.grid.current_table

        self.code_array.set_col_width(col, tab, width)
        self.grid.SetColSize(col, width)
276272
def set_column_gap(self, value):
        
        value = str(value) + 'px'
        value = value.replace('pxpx', 'px')
        self.style['grid-column-gap'] = value
736136
function updatePosition(subvalue) {
      var lastIndex = -1
      var index = subvalue.indexOf('\n')

      while (index !== -1) {
        line++
        lastIndex = index
        index = subvalue.indexOf('\n', index + 1)
      }

      if (lastIndex === -1) {
        column += subvalue.length
      } else {
        column = subvalue.length - lastIndex
      }

      if (line in offset) {
        if (lastIndex !== -1) {
          column += offset[line]
        } else if (column <= offset[line]) {
          column = offset[line] + 1
        }
      }
    }
581647
def setAlignment(self, align):
        
        self.blockSignals(True)
        self.editor().setAlignment(align)
        self.blockSignals(False)
        self.refreshAlignmentUi()
279983
protected function setAlignment( $value ) {
		if ( $value !== $this->align ) {
			// Default to 'left'
			if ( !in_array( $value, [ 'left', 'right', 'top', 'inline' ] ) ) {
				$value = 'left';
			}
			// Validate
			if ( $value === 'inline' && !$this->isFieldInline() ) {
				$value = 'top';
			}
			// Reorder elements
			$this->body->clearContent();

			if ( $this->helpInline ) {
				if ( $value === 'top' ) {
					$this->header->appendContent( $this->label );
					$this->body->appendContent( $this->header, $this->field, $this->help );
				} elseif ( $value === 'inline' ) {
					$this->header->appendContent( $this->label, $this->help );
					$this->body->appendContent( $this->field, $this->header );
				} else {
					$this->header->appendContent( $this->label, $this->help );
					$this->body->appendContent( $this->header, $this->field );
				}
			} else {
				if ( $value === 'top' ) {
					$this->header->appendContent( $this->help, $this->label );
					$this->body->appendContent( $this->header, $this->field );
				} elseif ( $value === 'inline' ) {
					$this->header->appendContent( $this->help, $this->label );
					$this->body->appendContent( $this->field, $this->header );
				} else {
					$this->header->appendContent( $this->label );
					$this->body->appendContent( $this->header, $this->help, $this->field );
				}
			}
			// Set classes. The following classes can be used here:
			// * oo-ui-fieldLayout-align-left
			// * oo-ui-fieldLayout-align-right
			// * oo-ui-fieldLayout-align-top
			// * oo-ui-fieldLayout-align-inline
			if ( $this->align ) {
				$this->removeClasses( [ 'oo-ui-fieldLayout-align-' . $this->align ] );
			}
			$this->addClasses( [ 'oo-ui-fieldLayout-align-' . $value ] );
			$this->align = $value;
		}

		return $this;
	}
915817
def align(value):
        
        if value.value:
            _assert_is_type('shape.value', value.value, str_types)
            if value.value not in PropertySet._valid_align:
                raise ValueError(value.value + ' is not a valid alignment')
808095
def set_column_stretch(self, column=0, stretch=10):
        
        self._layout.setColumnStretch(column, stretch)
        return self
787063
def align(self, arr):
        
        if arr is None:
            return arr

        c_hdrs = self._get_col_hdrs()

        if self.show_col_hdr_in_cell:
            for hdr in c_hdrs:
                arr[hdr] = map(lambda col: ":".join([hdr, str(col)]), arr[hdr])

        if self.show_col_hdrs:
            widths = [max(len(str(col))
                      for col in arr[hdr].tolist() + [hdr]) for hdr in c_hdrs]
        else:
            widths = [max(len(str(col))
                      for col in arr[hdr].tolist()) for hdr in c_hdrs]

        # align column headers
        c_hdrs = map(lambda (c_hdr, width): c_hdr.ljust(width),
                     zip(c_hdrs, widths))

        # align data
        for n_row in range(len(arr)):
            arr[n_row] = tuple(map(lambda (col, width): col.ljust(width),
                                   zip(arr[n_row], widths)))

        return arr, c_hdrs, widths
120171
public void setCellFormatAttributes(WritableCellFormat cellFormat, FileColumn column)
    {
        try
        {
            if(cellFormat != null && column != null)
            {
                Alignment a = Alignment.GENERAL;
                short align = column.getAlign();
                if(align == FileColumn.ALIGN_CENTRE)
                    a = Alignment.CENTRE;
                else if(align == FileColumn.ALIGN_LEFT)
                    a = Alignment.LEFT;
                else if(align == FileColumn.ALIGN_RIGHT)
                    a = Alignment.RIGHT;
                else if(align == FileColumn.ALIGN_JUSTIFY)
                    a = Alignment.JUSTIFY;
                else if(align == FileColumn.ALIGN_FILL)
                    a = Alignment.FILL;
                cellFormat.setAlignment(a);
                cellFormat.setWrap(column.getWrap());
            }
        }
        catch(WriteException e)
        {
            logger.severe(StringUtilities.serialize(e));
        }
    }
879921
function setLayoutScheme(rows, columns) {
        if ((rows < 1) || (rows > 2) || (columns < 1) || (columns > 2) || (columns === 2 && rows === 2)) {
            console.error("setLayoutScheme unsupported layout " + rows + ", " + columns);
            return false;
        }

        if (rows === columns) {
            _mergePanes();
        } else if (rows > columns) {
            _doSplit(HORIZONTAL);
        } else {
            _doSplit(VERTICAL);
        }
        return true;
    }