From 19d7706c1bcc5b972252c02161c7ec44870a9f48 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 2 Jan 2022 21:04:37 -0800 Subject: [PATCH] Change class visibility --- .../src/components/model/FeatureModel.ts | 6 ++--- .../src/components/model/INodeModel.ts | 2 +- .../src/components/model/LinkModel.ts | 2 +- .../mindplot/src/components/model/Mindmap.ts | 10 ++++---- .../src/components/model/NodeModel.ts | 8 +++--- .../src/components/model/RelationshipModel.ts | 25 ++++++++++--------- 6 files changed, 27 insertions(+), 26 deletions(-) diff --git a/packages/mindplot/src/components/model/FeatureModel.ts b/packages/mindplot/src/components/model/FeatureModel.ts index 8e296a0a..0e229076 100644 --- a/packages/mindplot/src/components/model/FeatureModel.ts +++ b/packages/mindplot/src/components/model/FeatureModel.ts @@ -21,9 +21,9 @@ export type FeatureType = 'note' | 'link' | 'icon'; class FeatureModel { static _next_id = 0; - _id: number; - _type: FeatureType; - _attributes: {}; + private _id: number; + private _type: FeatureType; + private _attributes: {}; /** * @constructs diff --git a/packages/mindplot/src/components/model/INodeModel.ts b/packages/mindplot/src/components/model/INodeModel.ts index a086ce2e..57b76838 100644 --- a/packages/mindplot/src/components/model/INodeModel.ts +++ b/packages/mindplot/src/components/model/INodeModel.ts @@ -27,7 +27,7 @@ abstract class INodeModel { static MAIN_TOPIC_TO_MAIN_TOPIC_DISTANCE: number = 220; static _next_uuid: number = 0; - _mindmap: Mindmap; + protected _mindmap: Mindmap; constructor(mindmap: Mindmap) { $assert(mindmap && mindmap.getBranches, 'mindmap can not be null'); diff --git a/packages/mindplot/src/components/model/LinkModel.ts b/packages/mindplot/src/components/model/LinkModel.ts index 7cb9fad0..346f871f 100644 --- a/packages/mindplot/src/components/model/LinkModel.ts +++ b/packages/mindplot/src/components/model/LinkModel.ts @@ -25,7 +25,7 @@ class LinkModel extends FeatureModel { } /** @return {String} the url attribute value */ - getUrl() { + getUrl():string { return this.getAttribute('url'); } diff --git a/packages/mindplot/src/components/model/Mindmap.ts b/packages/mindplot/src/components/model/Mindmap.ts index b8e58336..a17dc0ca 100644 --- a/packages/mindplot/src/components/model/Mindmap.ts +++ b/packages/mindplot/src/components/model/Mindmap.ts @@ -23,11 +23,11 @@ import RelationshipModel from './RelationshipModel'; import ModelCodeName from '../persistence/ModelCodeName'; class Mindmap extends IMindmap { - _description: string; - _version: string; - _id: string; - _branches: Array; - _relationships: Array; + private _description: string; + private _version: string; + private _id: string; + private _branches: Array; + private _relationships: Array; constructor(id: string, version: string = ModelCodeName.TANGO) { super(); diff --git a/packages/mindplot/src/components/model/NodeModel.ts b/packages/mindplot/src/components/model/NodeModel.ts index 39c9c177..b4f9473b 100644 --- a/packages/mindplot/src/components/model/NodeModel.ts +++ b/packages/mindplot/src/components/model/NodeModel.ts @@ -23,10 +23,10 @@ import FeatureModel from './FeatureModel'; import Mindmap from './Mindmap'; class NodeModel extends INodeModel { - _properties: {}; - _children: INodeModel[]; - _features: FeatureModel[]; - _parent: INodeModel; + private _properties: {}; + private _children: INodeModel[]; + private _features: FeatureModel[]; + private _parent: INodeModel; constructor(type: NodeModelType, mindmap: Mindmap, id: number) { $assert(type, 'Node type can not be null'); diff --git a/packages/mindplot/src/components/model/RelationshipModel.ts b/packages/mindplot/src/components/model/RelationshipModel.ts index cea0f996..f8301af6 100644 --- a/packages/mindplot/src/components/model/RelationshipModel.ts +++ b/packages/mindplot/src/components/model/RelationshipModel.ts @@ -16,18 +16,19 @@ * limitations under the License. */ import { $assert, $defined } from '@wisemapping/core-js'; +import Point from '@wisemapping/web2d'; import ConnectionLine from '../ConnectionLine'; class RelationshipModel { static _next_uuid: number = 0; - _id: number; - _sourceTargetId: number; - _targetTopicId: number; - _lineType: number; - _srcCtrlPoint: any; - _destCtrlPoint: any; - _endArrow: boolean; - _startArrow: boolean; + private _id: number; + private _sourceTargetId: number; + private _targetTopicId: number; + private _lineType: number; + private _srcCtrlPoint: Point; + private _destCtrlPoint: Point; + private _endArrow: boolean; + private _startArrow: boolean; constructor(sourceTopicId: number, targetTopicId: number) { $assert($defined(sourceTopicId), 'from node type can not be null'); @@ -72,22 +73,22 @@ class RelationshipModel { } /** */ - getSrcCtrlPoint() { + getSrcCtrlPoint(): Point { return this._srcCtrlPoint; } /** */ - setSrcCtrlPoint(srcCtrlPoint) { + setSrcCtrlPoint(srcCtrlPoint: Point) { this._srcCtrlPoint = srcCtrlPoint; } /** */ - getDestCtrlPoint() { + getDestCtrlPoint(): Point { return this._destCtrlPoint; } /** */ - setDestCtrlPoint(destCtrlPoint) { + setDestCtrlPoint(destCtrlPoint: Point) { this._destCtrlPoint = destCtrlPoint; }