Skip to content

Commit

Permalink
#119 Add SimpleConnectionInstance to model
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed Nov 6, 2019
1 parent f0c16e9 commit 88ebdfd
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions js/geppettoModel/model/SimpleConnectionInstance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import Instance from './Instance';

export default class SimpleConnectionInstance extends Instance{
constructor (node) {
super(node);
this.value = node.value;
this.type = node.type;
this.visualValue = node.visualValue;
this.a = node.a;
this.b = node.b
this.tags = node.tags;
this.wrappedObj = node;
this._metaType = node.eClass;
}

getTypes () {
return [this.getType()];
}

getValues () {
return [this.getValue()];
}

getType () {
return this.type;
}

getValue () {
return this.value;
}

getVisualValue () {
return this.visualValue;
}

hasVisualValue () {
return this.visualValue;
}

getPoint () {
return this.point;
}

hasVisualType () {
throw "Simple connection instances don't support visual type: use hasVisualValue instead";
}

getVisualType () {
throw "Simple connection instances don't support visual type: use getVisualValue instead";
}

getVariable () {
throw "Simple instances don't support variables";
}
}

0 comments on commit 88ebdfd

Please sign in to comment.