The tree view rendering performance is optimized by improving the node render queue ordering. The node rendering order is modified based on the expansion state and the depth in the hierarchy, leading to faster rendering of visible nodes. This optimization is applied when the tree nodes are not expanded to improve the rendering speed. This new ordering ensures that nodes are rendered more efficiently, prioritizing nodes that are collapsed and are at a higher level in the hierarchy.
35 lines
939 B
TypeScript
35 lines
939 B
TypeScript
import { TreeNodeCheckState } from '@/presentation/components/Scripts/View/Tree/TreeView/Node/State/CheckState';
|
|
import { TreeNodeStateDescriptor } from '@/presentation/components/Scripts/View/Tree/TreeView/Node/State/StateDescriptor';
|
|
|
|
export class TreeNodeStateDescriptorStub implements TreeNodeStateDescriptor {
|
|
public checkState: TreeNodeCheckState = TreeNodeCheckState.Checked;
|
|
|
|
public isExpanded = false;
|
|
|
|
public isVisible = false;
|
|
|
|
public isMatched = false;
|
|
|
|
public isFocused = false;
|
|
|
|
public withFocus(isFocused: boolean): this {
|
|
this.isFocused = isFocused;
|
|
return this;
|
|
}
|
|
|
|
public withCheckState(checkState: TreeNodeCheckState): this {
|
|
this.checkState = checkState;
|
|
return this;
|
|
}
|
|
|
|
public withVisibility(isVisible: boolean): this {
|
|
this.isVisible = isVisible;
|
|
return this;
|
|
}
|
|
|
|
public withExpansion(isExpanded: boolean): this {
|
|
this.isExpanded = isExpanded;
|
|
return this;
|
|
}
|
|
}
|