-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#119 Add SimpleConnectionInstance to model
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} | ||
} |