From 5b3e07c1c60187656fe67096a74542cc895b3f9e Mon Sep 17 00:00:00 2001 From: Dario Del Piano Date: Thu, 11 Aug 2022 16:37:34 +0100 Subject: [PATCH] #30 enhancing api for meta elements --- src/models/MetaLink.ts | 12 ++++++++++++ src/models/MetaNode.ts | 12 ++++++++++++ src/models/MetaOptions.ts | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/src/models/MetaLink.ts b/src/models/MetaLink.ts index 17248b2..e6c43d3 100644 --- a/src/models/MetaLink.ts +++ b/src/models/MetaLink.ts @@ -44,4 +44,16 @@ export class MetaLink implements ILink { getTargetPortId(): string { return this.targetPortId; } + + getId(): string { + return this.options.getId(); + } + + getName(): string { + return this.options.getName(); + } + + getShape(): string { + return this.options.getShape(); + } } diff --git a/src/models/MetaNode.ts b/src/models/MetaNode.ts index 40cc4c0..48b60e9 100644 --- a/src/models/MetaNode.ts +++ b/src/models/MetaNode.ts @@ -20,4 +20,16 @@ export class MetaNode { options.set('position', position); this.options = new MetaOptions(id, name, shape, variant, options); } + + getId(): string { + return this.options.getId(); + } + + getName(): string { + return this.options.getName(); + } + + getShape(): string { + return this.options.getShape(); + } } diff --git a/src/models/MetaOptions.ts b/src/models/MetaOptions.ts index 4436ec3..40e8b0c 100644 --- a/src/models/MetaOptions.ts +++ b/src/models/MetaOptions.ts @@ -22,6 +22,10 @@ export class MetaOptions implements IShape, IId { return this.options.get('id'); } + getName(): string { + return this.options.get('name'); + } + getShape(): string { return this.options.get('shape'); }