devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
37 lines (36 loc) • 1.42 kB
JavaScript
import { TableBordersBase } from './table-border-base';
import { MathUtils } from '@devexpress/utils/lib/utils/math';
export class TableCellBorders extends TableBordersBase {
equals(obj) {
return super.equals(obj) &&
this.topLeftDiagonal.equals(obj.topLeftDiagonal) &&
this.topRightDiagonal.equals(obj.topRightDiagonal);
}
copyFrom(obj) {
super.copyFrom(obj);
this.topLeftDiagonal = obj.topLeftDiagonal?.clone();
this.topRightDiagonal = obj.topRightDiagonal?.clone();
}
getHashCode() {
return super.getHashCode() ^
MathUtils.somePrimes[16] * this.topLeftDiagonal?.getHashCode() ^
MathUtils.somePrimes[17] * this.topRightDiagonal?.getHashCode();
}
clone() {
var result = new TableCellBorders();
result.copyFrom(this);
return result;
}
static create(top, right, bottom, left, topLeftDiagonal, topRightDiagonal, insideHorizontal, insideVertical) {
let result = new TableCellBorders();
result.top = top;
result.right = right;
result.bottom = bottom;
result.left = left;
result.topLeftDiagonal = topLeftDiagonal;
result.topRightDiagonal = topRightDiagonal;
result.insideHorizontal = insideHorizontal;
result.insideVertical = insideVertical;
return result;
}
}