import { Control } from "bp/design/class" ; import { ViewService } from "bp/env/service" ; import type { Sheet } from "./Sheet" ; import type { TreeEdge } from "bp/content/context" ; /**
 *  River 是摺痕圖中對應於一條河的區域，它可以被選取，
 * 但其配置是間接被  Flap 的位置所決定出來的，不能自由移動。
  @ shrewd export class River extends Control { public get $type ( ) : string { return "River" ; } public get $tag ( ) : string { return "r" + this . edge . $tag ; } exports public readonly edge : TreeEdge ; constructor ( sheet , edge ) { super ( sheet ) ; this . edge = edge ; ViewService . $createView ( this ) ; } protected get $shouldDispose ( ) : boolean { return super . $shouldDispose || this . edge . $disposed || ! this . edge . $isRiver ; } public $delete ( ) { let edge = this . $design . $edges . get ( this . edge ) ; if ( ! edge ) return false ; return edge . deleteAndMerge ( ) ; } exports public get length ( ) : number { return this . edge . length ; } public set length ( v ) { this . edge . length = v ; } }