// Getter methods for various things saved in the spec field. They are Getters() so that consumers of this class will be encouraged to save them using getters/setters
// because we probably need persistBubbleSpec() to be called afterward
//
// Gets the level (z-index) of this object
publicgetSpecLevel(): number|undefined{
returnthis.spec.level;
}
publicgetFullSpec(): BubbleSpec{
constparents=Comical.findAncestors(this);
if(parents.length==0){
returnthis.spec;
}
constparent: Bubble=parents[0];
// We probably don't need to be this careful, since functions that want
// this bubble's tails or order go to its own spec. But these are
// things that should NOT be inherited from parent, so let's get them right.
// ENHANCE: Add more getters and setters, as they are needed
// Returns the spec object. If you modify this object, make sure to use the setter to set the value again or use persistBubbleSpec() in order to get the changes to persist!
publicgetBubbleSpec(){
returnthis.spec;
}
// Setter for the spec field. Also persists the data into the HTML of the content element.
activateLayer(this.lowerLayer);// Sets this bubble's lowerLayer as the active layer, so that the SVG will be imported into the correct layer.
// ImportSVG may return asynchronously if the input string is a URL.
// Even though the string we pass contains the svg contents directly (not a URL), when I ran it in Bloom I still got a null shape out as the return value, so best to treat it as async.