import { CanvasElementModel } from "./CanvasElementModel" ; import { CanvasModel } from "./CanvasModel" ; import { DeserializeEvent , Serializable } from "../base-models/BaseModel" ; import { GraphModelOrdered } from "../base-models/GraphModelOrdered" ; export class CanvasLayerModel < T extends CanvasElementModel = CanvasElementModel > extends GraphModelOrdered < T , CanvasModel > { protected name : string ; protected svg : boolean ; protected transform : boolean ; constructor ( name = "Layer" ) { super ( "layer" ) ; this . name = name ; this . svg = false ; this . transform = true ; } deSerialize ( event ) { super . deSerialize ( event ) ; this . name = event . data [ "name" ] ; this . svg = event . data [ "svg" ] ; this . transform = event . data [ "transform" ] ; } serialize ( ) { return { ... super . serialize ( ) , name : this . name , svg : this . svg , transform : this . transform } ; } setTransformable ( transform ) { this . transform = transform ; } setName ( name ) { this . name = name ; } setSVG ( svg ) { this . svg = svg ; } getName ( ) { return this . name ; } isSVG ( ) { return this . svg ; } isTransformable ( ) { return this . transform ; } }