diff --git a/.gitignore b/.gitignore index 65e900b..e8fbfe5 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ server/.idea .idea test.js *.code-workspace +similitudeClient.js diff --git a/client/bin/example.js b/client/bin/example.js deleted file mode 100644 index 3317522..0000000 --- a/client/bin/example.js +++ /dev/null @@ -1,9593 +0,0 @@ -// Generated by Haxe 4.0.5 -(function ($global) { "use strict"; -var $hxClasses = {},$estr = function() { return js_Boot.__string_rec(this,''); },$hxEnums = $hxEnums || {},$_; -function $extend(from, fields) { - var proto = Object.create(from); - for (var name in fields) proto[name] = fields[name]; - if( fields.toString !== Object.prototype.toString ) proto.toString = fields.toString; - return proto; -} -var EReg = function(r,opt) { - this.r = new RegExp(r,opt.split("u").join("")); -}; -$hxClasses["EReg"] = EReg; -EReg.__name__ = "EReg"; -EReg.escape = function(s) { - return s.replace(EReg.escapeRe,"\\$&"); -}; -EReg.prototype = { - r: null - ,match: function(s) { - if(this.r.global) { - this.r.lastIndex = 0; - } - this.r.m = this.r.exec(s); - this.r.s = s; - return this.r.m != null; - } - ,matched: function(n) { - if(this.r.m != null && n >= 0 && n < this.r.m.length) { - return this.r.m[n]; - } else { - throw new js__$Boot_HaxeError("EReg::matched"); - } - } - ,matchedLeft: function() { - if(this.r.m == null) { - throw new js__$Boot_HaxeError("No string matched"); - } - return HxOverrides.substr(this.r.s,0,this.r.m.index); - } - ,matchedRight: function() { - if(this.r.m == null) { - throw new js__$Boot_HaxeError("No string matched"); - } - var sz = this.r.m.index + this.r.m[0].length; - return HxOverrides.substr(this.r.s,sz,this.r.s.length - sz); - } - ,matchedPos: function() { - if(this.r.m == null) { - throw new js__$Boot_HaxeError("No string matched"); - } - return { pos : this.r.m.index, len : this.r.m[0].length}; - } - ,matchSub: function(s,pos,len) { - if(len == null) { - len = -1; - } - if(this.r.global) { - this.r.lastIndex = pos; - this.r.m = this.r.exec(len < 0 ? s : HxOverrides.substr(s,0,pos + len)); - var b = this.r.m != null; - if(b) { - this.r.s = s; - } - return b; - } else { - var b1 = this.match(len < 0 ? HxOverrides.substr(s,pos,null) : HxOverrides.substr(s,pos,len)); - if(b1) { - this.r.s = s; - this.r.m.index += pos; - } - return b1; - } - } - ,split: function(s) { - var d = "#__delim__#"; - return s.replace(this.r,d).split(d); - } - ,replace: function(s,by) { - return s.replace(this.r,by); - } - ,map: function(s,f) { - var offset = 0; - var buf_b = ""; - while(true) { - if(offset >= s.length) { - break; - } else if(!this.matchSub(s,offset)) { - buf_b += Std.string(HxOverrides.substr(s,offset,null)); - break; - } - var p = this.matchedPos(); - buf_b += Std.string(HxOverrides.substr(s,offset,p.pos - offset)); - buf_b += Std.string(f(this)); - if(p.len == 0) { - buf_b += Std.string(HxOverrides.substr(s,p.pos,1)); - offset = p.pos + 1; - } else { - offset = p.pos + p.len; - } - if(!this.r.global) { - break; - } - } - if(!this.r.global && offset > 0 && offset < s.length) { - buf_b += Std.string(HxOverrides.substr(s,offset,null)); - } - return buf_b; - } - ,__class__: EReg -}; -var _$EnumValue_EnumValue_$Impl_$ = {}; -$hxClasses["_EnumValue.EnumValue_Impl_"] = _$EnumValue_EnumValue_$Impl_$; -_$EnumValue_EnumValue_$Impl_$.__name__ = "_EnumValue.EnumValue_Impl_"; -_$EnumValue_EnumValue_$Impl_$.match = function(this1,pattern) { - return false; -}; -var HxOverrides = function() { }; -$hxClasses["HxOverrides"] = HxOverrides; -HxOverrides.__name__ = "HxOverrides"; -HxOverrides.dateStr = function(date) { - var m = date.getMonth() + 1; - var d = date.getDate(); - var h = date.getHours(); - var mi = date.getMinutes(); - var s = date.getSeconds(); - return date.getFullYear() + "-" + (m < 10 ? "0" + m : "" + m) + "-" + (d < 10 ? "0" + d : "" + d) + " " + (h < 10 ? "0" + h : "" + h) + ":" + (mi < 10 ? "0" + mi : "" + mi) + ":" + (s < 10 ? "0" + s : "" + s); -}; -HxOverrides.strDate = function(s) { - switch(s.length) { - case 8: - var k = s.split(":"); - var d = new Date(); - d["setTime"](0); - d["setUTCHours"](k[0]); - d["setUTCMinutes"](k[1]); - d["setUTCSeconds"](k[2]); - return d; - case 10: - var k1 = s.split("-"); - return new Date(k1[0],k1[1] - 1,k1[2],0,0,0); - case 19: - var k2 = s.split(" "); - var y = k2[0].split("-"); - var t = k2[1].split(":"); - return new Date(y[0],y[1] - 1,y[2],t[0],t[1],t[2]); - default: - throw new js__$Boot_HaxeError("Invalid date format : " + s); - } -}; -HxOverrides.cca = function(s,index) { - var x = s.charCodeAt(index); - if(x != x) { - return undefined; - } - return x; -}; -HxOverrides.substr = function(s,pos,len) { - if(len == null) { - len = s.length; - } else if(len < 0) { - if(pos == 0) { - len = s.length + len; - } else { - return ""; - } - } - return s.substr(pos,len); -}; -HxOverrides.indexOf = function(a,obj,i) { - var len = a.length; - if(i < 0) { - i += len; - if(i < 0) { - i = 0; - } - } - while(i < len) { - if(((a[i]) === obj)) { - return i; - } - ++i; - } - return -1; -}; -HxOverrides.lastIndexOf = function(a,obj,i) { - var len = a.length; - if(i >= len) { - i = len - 1; - } else if(i < 0) { - i += len; - } - while(i >= 0) { - if(((a[i]) === obj)) { - return i; - } - --i; - } - return -1; -}; -HxOverrides.remove = function(a,obj) { - var i = a.indexOf(obj); - if(i == -1) { - return false; - } - a.splice(i,1); - return true; -}; -HxOverrides.iter = function(a) { - return { cur : 0, arr : a, hasNext : function() { - return this.cur < this.arr.length; - }, next : function() { - return this.arr[this.cur++]; - }}; -}; -var IntIterator = function(min,max) { - this.min = min; - this.max = max; -}; -$hxClasses["IntIterator"] = IntIterator; -IntIterator.__name__ = "IntIterator"; -IntIterator.prototype = { - min: null - ,max: null - ,hasNext: function() { - return this.min < this.max; - } - ,next: function() { - return this.min++; - } - ,__class__: IntIterator -}; -var Lambda = function() { }; -$hxClasses["Lambda"] = Lambda; -Lambda.__name__ = "Lambda"; -Lambda.array = function(it) { - var a = []; - var i = $getIterator(it); - while(i.hasNext()) { - var i1 = i.next(); - a.push(i1); - } - return a; -}; -Lambda.list = function(it) { - var l = new haxe_ds_List(); - var i = $getIterator(it); - while(i.hasNext()) { - var i1 = i.next(); - l.add(i1); - } - return l; -}; -Lambda.map = function(it,f) { - var _g = []; - var x = $getIterator(it); - while(x.hasNext()) { - var x1 = x.next(); - _g.push(f(x1)); - } - return _g; -}; -Lambda.mapi = function(it,f) { - var i = 0; - var _g = []; - var x = $getIterator(it); - while(x.hasNext()) { - var x1 = x.next(); - _g.push(f(i++,x1)); - } - return _g; -}; -Lambda.flatten = function(it) { - var _g = []; - var e = $getIterator(it); - while(e.hasNext()) { - var e1 = e.next(); - var x = $getIterator(e1); - while(x.hasNext()) { - var x1 = x.next(); - _g.push(x1); - } - } - return _g; -}; -Lambda.flatMap = function(it,f) { - var _g = []; - var x = $getIterator(it); - while(x.hasNext()) { - var x1 = x.next(); - _g.push(f(x1)); - } - var _g1 = []; - var e = $getIterator(_g); - while(e.hasNext()) { - var e1 = e.next(); - var x2 = $getIterator(e1); - while(x2.hasNext()) { - var x3 = x2.next(); - _g1.push(x3); - } - } - return _g1; -}; -Lambda.has = function(it,elt) { - var x = $getIterator(it); - while(x.hasNext()) { - var x1 = x.next(); - if(x1 == elt) { - return true; - } - } - return false; -}; -Lambda.exists = function(it,f) { - var x = $getIterator(it); - while(x.hasNext()) { - var x1 = x.next(); - if(f(x1)) { - return true; - } - } - return false; -}; -Lambda.foreach = function(it,f) { - var x = $getIterator(it); - while(x.hasNext()) { - var x1 = x.next(); - if(!f(x1)) { - return false; - } - } - return true; -}; -Lambda.iter = function(it,f) { - var x = $getIterator(it); - while(x.hasNext()) { - var x1 = x.next(); - f(x1); - } -}; -Lambda.filter = function(it,f) { - var _g = []; - var x = $getIterator(it); - while(x.hasNext()) { - var x1 = x.next(); - if(f(x1)) { - _g.push(x1); - } - } - return _g; -}; -Lambda.fold = function(it,f,first) { - var x = $getIterator(it); - while(x.hasNext()) { - var x1 = x.next(); - first = f(x1,first); - } - return first; -}; -Lambda.count = function(it,pred) { - var n = 0; - if(pred == null) { - var _ = $getIterator(it); - while(_.hasNext()) { - var _1 = _.next(); - ++n; - } - } else { - var x = $getIterator(it); - while(x.hasNext()) { - var x1 = x.next(); - if(pred(x1)) { - ++n; - } - } - } - return n; -}; -Lambda.empty = function(it) { - return !$getIterator(it).hasNext(); -}; -Lambda.indexOf = function(it,v) { - var i = 0; - var v2 = $getIterator(it); - while(v2.hasNext()) { - var v21 = v2.next(); - if(v == v21) { - return i; - } - ++i; - } - return -1; -}; -Lambda.find = function(it,f) { - var v = $getIterator(it); - while(v.hasNext()) { - var v1 = v.next(); - if(f(v1)) { - return v1; - } - } - return null; -}; -Lambda.concat = function(a,b) { - var l = []; - var x = $getIterator(a); - while(x.hasNext()) { - var x1 = x.next(); - l.push(x1); - } - var x2 = $getIterator(b); - while(x2.hasNext()) { - var x3 = x2.next(); - l.push(x3); - } - return l; -}; -var Main = function() { }; -$hxClasses["Main"] = Main; -Main.__name__ = "Main"; -Main.main = function() { - var viewHandler = new view_View(); - var sidebarController = new controller_controllers_SidebarController(); - var canvasController = new controller_controllers_CanvasController(); - viewHandler.setSidebarListener(sidebarController); - viewHandler.setCanvasListener(canvasController); - var sidebarUpdater = new view_viewUpdaters_SidebarUpdate(viewHandler); - var canvasUpdater = new view_viewUpdaters_CanvasUpdate(viewHandler); - sidebarController.setViewUpdater(sidebarUpdater); - canvasController.setViewUpdater(canvasUpdater); - viewHandler.setActiveTab(); -}; -Math.__name__ = "Math"; -var Reflect = function() { }; -$hxClasses["Reflect"] = Reflect; -Reflect.__name__ = "Reflect"; -Reflect.hasField = function(o,field) { - return Object.prototype.hasOwnProperty.call(o,field); -}; -Reflect.field = function(o,field) { - try { - return o[field]; - } catch( e ) { - var e1 = ((e) instanceof js__$Boot_HaxeError) ? e.val : e; - return null; - } -}; -Reflect.setField = function(o,field,value) { - o[field] = value; -}; -Reflect.getProperty = function(o,field) { - var tmp; - if(o == null) { - return null; - } else { - var tmp1; - if(o.__properties__) { - tmp = o.__properties__["get_" + field]; - tmp1 = tmp; - } else { - tmp1 = false; - } - if(tmp1) { - return o[tmp](); - } else { - return o[field]; - } - } -}; -Reflect.setProperty = function(o,field,value) { - var tmp; - var tmp1; - if(o.__properties__) { - tmp = o.__properties__["set_" + field]; - tmp1 = tmp; - } else { - tmp1 = false; - } - if(tmp1) { - o[tmp](value); - } else { - o[field] = value; - } -}; -Reflect.callMethod = function(o,func,args) { - return func.apply(o,args); -}; -Reflect.fields = function(o) { - var a = []; - if(o != null) { - var hasOwnProperty = Object.prototype.hasOwnProperty; - for( var f in o ) { - if(f != "__id__" && f != "hx__closures__" && hasOwnProperty.call(o,f)) { - a.push(f); - } - } - } - return a; -}; -Reflect.isFunction = function(f) { - if(typeof(f) == "function") { - return !(f.__name__ || f.__ename__); - } else { - return false; - } -}; -Reflect.compare = function(a,b) { - if(a == b) { - return 0; - } else if(a > b) { - return 1; - } else { - return -1; - } -}; -Reflect.compareMethods = function(f1,f2) { - if(f1 == f2) { - return true; - } - if(!Reflect.isFunction(f1) || !Reflect.isFunction(f2)) { - return false; - } - if(f1.scope == f2.scope && f1.method == f2.method) { - return f1.method != null; - } else { - return false; - } -}; -Reflect.isObject = function(v) { - if(v == null) { - return false; - } - var t = typeof(v); - if(!(t == "string" || t == "object" && v.__enum__ == null)) { - if(t == "function") { - return (v.__name__ || v.__ename__) != null; - } else { - return false; - } - } else { - return true; - } -}; -Reflect.isEnumValue = function(v) { - if(v != null) { - return v.__enum__ != null; - } else { - return false; - } -}; -Reflect.deleteField = function(o,field) { - if(!Object.prototype.hasOwnProperty.call(o,field)) { - return false; - } - delete(o[field]); - return true; -}; -Reflect.copy = function(o) { - if(o == null) { - return null; - } - var o2 = { }; - var _g = 0; - var _g1 = Reflect.fields(o); - while(_g < _g1.length) { - var f = _g1[_g]; - ++_g; - o2[f] = Reflect.field(o,f); - } - return o2; -}; -Reflect.makeVarArgs = function(f) { - return function() { - var a = Array.prototype.slice.call(arguments); - return f(a); - }; -}; -var Std = function() { }; -$hxClasses["Std"] = Std; -Std.__name__ = "Std"; -Std.is = function(v,t) { - return js_Boot.__instanceof(v,t); -}; -Std.downcast = function(value,c) { - if(js_Boot.__downcastCheck(value,c)) { - return value; - } else { - return null; - } -}; -Std.instance = function(value,c) { - return js_Boot.__downcastCheck(value,c) ? value : null; -}; -Std.string = function(s) { - return js_Boot.__string_rec(s,""); -}; -Std.int = function(x) { - return x | 0; -}; -Std.parseInt = function(x) { - if(x != null) { - var _g = 0; - var _g1 = x.length; - while(_g < _g1) { - var i = _g++; - var c = x.charCodeAt(i); - if(c <= 8 || c >= 14 && c != 32 && c != 45) { - var v = parseInt(x, (x[(i + 1)]=="x" || x[(i + 1)]=="X") ? 16 : 10); - if(isNaN(v)) { - return null; - } else { - return v; - } - } - } - } - return null; -}; -Std.parseFloat = function(x) { - return parseFloat(x); -}; -Std.random = function(x) { - if(x <= 0) { - return 0; - } else { - return Math.floor(Math.random() * x); - } -}; -var StringBuf = function() { - this.b = ""; -}; -$hxClasses["StringBuf"] = StringBuf; -StringBuf.__name__ = "StringBuf"; -StringBuf.prototype = { - b: null - ,get_length: function() { - return this.b.length; - } - ,add: function(x) { - this.b += Std.string(x); - } - ,addChar: function(c) { - this.b += String.fromCodePoint(c); - } - ,addSub: function(s,pos,len) { - this.b += len == null ? HxOverrides.substr(s,pos,null) : HxOverrides.substr(s,pos,len); - } - ,toString: function() { - return this.b; - } - ,__class__: StringBuf - ,__properties__: {get_length:"get_length"} -}; -var haxe_SysTools = function() { }; -$hxClasses["haxe.SysTools"] = haxe_SysTools; -haxe_SysTools.__name__ = "haxe.SysTools"; -haxe_SysTools.quoteUnixArg = function(argument) { - if(argument == "") { - return "''"; - } - if(!new EReg("[^a-zA-Z0-9_@%+=:,./-]","").match(argument)) { - return argument; - } - return "'" + StringTools.replace(argument,"'","'\"'\"'") + "'"; -}; -haxe_SysTools.quoteWinArg = function(argument,escapeMetaCharacters) { - if(!new EReg("^[^ \t\\\\\"]+$","").match(argument)) { - var result_b = ""; - var needquote = argument.indexOf(" ") != -1 || argument.indexOf("\t") != -1 || argument == ""; - if(needquote) { - result_b += "\""; - } - var bs_buf = new StringBuf(); - var _g = 0; - var _g1 = argument.length; - while(_g < _g1) { - var i = _g++; - var _g2 = HxOverrides.cca(argument,i); - if(_g2 == null) { - var c = _g2; - if(bs_buf.b.length > 0) { - result_b += Std.string(bs_buf.b); - bs_buf = new StringBuf(); - } - result_b += String.fromCodePoint(c); - } else { - switch(_g2) { - case 34: - var bs = bs_buf.b; - result_b += bs == null ? "null" : "" + bs; - result_b += bs == null ? "null" : "" + bs; - bs_buf = new StringBuf(); - result_b += "\\\""; - break; - case 92: - bs_buf.b += "\\"; - break; - default: - var c1 = _g2; - if(bs_buf.b.length > 0) { - result_b += Std.string(bs_buf.b); - bs_buf = new StringBuf(); - } - result_b += String.fromCodePoint(c1); - } - } - } - result_b += Std.string(bs_buf.b); - if(needquote) { - result_b += Std.string(bs_buf.b); - result_b += "\""; - } - argument = result_b; - } - if(escapeMetaCharacters) { - var result_b1 = ""; - var _g3 = 0; - var _g11 = argument.length; - while(_g3 < _g11) { - var i1 = _g3++; - var c2 = HxOverrides.cca(argument,i1); - if(haxe_SysTools.winMetaCharacters.indexOf(c2) >= 0) { - result_b1 += String.fromCodePoint(94); - } - result_b1 += String.fromCodePoint(c2); - } - return result_b1; - } else { - return argument; - } -}; -var StringTools = function() { }; -$hxClasses["StringTools"] = StringTools; -StringTools.__name__ = "StringTools"; -StringTools.urlEncode = function(s) { - return encodeURIComponent(s); -}; -StringTools.urlDecode = function(s) { - return decodeURIComponent(s.split("+").join(" ")); -}; -StringTools.htmlEscape = function(s,quotes) { - var buf_b = ""; - var _g_offset = 0; - var _g_s = s; - while(_g_offset < _g_s.length) { - var s1 = _g_s; - var index = _g_offset++; - var c = s1.charCodeAt(index); - if(c >= 55296 && c <= 56319) { - c = c - 55232 << 10 | s1.charCodeAt(index + 1) & 1023; - } - var c1 = c; - if(c1 >= 65536) { - ++_g_offset; - } - var code = c1; - switch(code) { - case 34: - if(quotes) { - buf_b += """; - } else { - buf_b += String.fromCodePoint(code); - } - break; - case 38: - buf_b += "&"; - break; - case 39: - if(quotes) { - buf_b += "'"; - } else { - buf_b += String.fromCodePoint(code); - } - break; - case 60: - buf_b += "<"; - break; - case 62: - buf_b += ">"; - break; - default: - buf_b += String.fromCodePoint(code); - } - } - return buf_b; -}; -StringTools.htmlUnescape = function(s) { - return s.split(">").join(">").split("<").join("<").split(""").join("\"").split("'").join("'").split("&").join("&"); -}; -StringTools.contains = function(s,value) { - return s.indexOf(value) != -1; -}; -StringTools.startsWith = function(s,start) { - if(s.length >= start.length) { - return s.lastIndexOf(start,0) == 0; - } else { - return false; - } -}; -StringTools.endsWith = function(s,end) { - var elen = end.length; - var slen = s.length; - if(slen >= elen) { - return s.indexOf(end,slen - elen) == slen - elen; - } else { - return false; - } -}; -StringTools.isSpace = function(s,pos) { - var c = HxOverrides.cca(s,pos); - if(!(c > 8 && c < 14)) { - return c == 32; - } else { - return true; - } -}; -StringTools.ltrim = function(s) { - var l = s.length; - var r = 0; - while(r < l && StringTools.isSpace(s,r)) ++r; - if(r > 0) { - return HxOverrides.substr(s,r,l - r); - } else { - return s; - } -}; -StringTools.rtrim = function(s) { - var l = s.length; - var r = 0; - while(r < l && StringTools.isSpace(s,l - r - 1)) ++r; - if(r > 0) { - return HxOverrides.substr(s,0,l - r); - } else { - return s; - } -}; -StringTools.trim = function(s) { - return StringTools.ltrim(StringTools.rtrim(s)); -}; -StringTools.lpad = function(s,c,l) { - if(c.length <= 0) { - return s; - } - var buf_b = ""; - l -= s.length; - while(buf_b.length < l) buf_b += c == null ? "null" : "" + c; - buf_b += s == null ? "null" : "" + s; - return buf_b; -}; -StringTools.rpad = function(s,c,l) { - if(c.length <= 0) { - return s; - } - var buf_b = ""; - buf_b += s == null ? "null" : "" + s; - while(buf_b.length < l) buf_b += c == null ? "null" : "" + c; - return buf_b; -}; -StringTools.replace = function(s,sub,by) { - return s.split(sub).join(by); -}; -StringTools.hex = function(n,digits) { - var s = ""; - var hexChars = "0123456789ABCDEF"; - while(true) { - s = hexChars.charAt(n & 15) + s; - n >>>= 4; - if(!(n > 0)) { - break; - } - } - if(digits != null) { - while(s.length < digits) s = "0" + s; - } - return s; -}; -StringTools.fastCodeAt = function(s,index) { - return s.charCodeAt(index); -}; -StringTools.iterator = function(s) { - return new haxe_iterators_StringIterator(s); -}; -StringTools.keyValueIterator = function(s) { - return new haxe_iterators_StringKeyValueIterator(s); -}; -StringTools.isEof = function(c) { - return c != c; -}; -StringTools.quoteUnixArg = function(argument) { - if(argument == "") { - return "''"; - } else if(!new EReg("[^a-zA-Z0-9_@%+=:,./-]","").match(argument)) { - return argument; - } else { - return "'" + StringTools.replace(argument,"'","'\"'\"'") + "'"; - } -}; -StringTools.quoteWinArg = function(argument,escapeMetaCharacters) { - var argument1 = argument; - if(!new EReg("^[^ \t\\\\\"]+$","").match(argument1)) { - var result_b = ""; - var needquote = argument1.indexOf(" ") != -1 || argument1.indexOf("\t") != -1 || argument1 == ""; - if(needquote) { - result_b += "\""; - } - var bs_buf = new StringBuf(); - var _g = 0; - var _g1 = argument1.length; - while(_g < _g1) { - var i = _g++; - var _g2 = HxOverrides.cca(argument1,i); - if(_g2 == null) { - var c = _g2; - if(bs_buf.b.length > 0) { - result_b += Std.string(bs_buf.b); - bs_buf = new StringBuf(); - } - result_b += String.fromCodePoint(c); - } else { - switch(_g2) { - case 34: - var bs = bs_buf.b; - result_b += Std.string(bs); - result_b += Std.string(bs); - bs_buf = new StringBuf(); - result_b += "\\\""; - break; - case 92: - bs_buf.b += "\\"; - break; - default: - var c1 = _g2; - if(bs_buf.b.length > 0) { - result_b += Std.string(bs_buf.b); - bs_buf = new StringBuf(); - } - result_b += String.fromCodePoint(c1); - } - } - } - result_b += Std.string(bs_buf.b); - if(needquote) { - result_b += Std.string(bs_buf.b); - result_b += "\""; - } - argument1 = result_b; - } - if(escapeMetaCharacters) { - var result_b1 = ""; - var _g3 = 0; - var _g11 = argument1.length; - while(_g3 < _g11) { - var i1 = _g3++; - var c2 = HxOverrides.cca(argument1,i1); - if(haxe_SysTools.winMetaCharacters.indexOf(c2) >= 0) { - result_b1 += String.fromCodePoint(94); - } - result_b1 += String.fromCodePoint(c2); - } - return result_b1; - } else { - return argument1; - } -}; -StringTools.utf16CodePointAt = function(s,index) { - var c = s.charCodeAt(index); - if(c >= 55296 && c <= 56319) { - c = c - 55232 << 10 | s.charCodeAt(index + 1) & 1023; - } - return c; -}; -var ValueType = $hxEnums["ValueType"] = { __ename__ : "ValueType", __constructs__ : ["TNull","TInt","TFloat","TBool","TObject","TFunction","TClass","TEnum","TUnknown"] - ,TNull: {_hx_index:0,__enum__:"ValueType",toString:$estr} - ,TInt: {_hx_index:1,__enum__:"ValueType",toString:$estr} - ,TFloat: {_hx_index:2,__enum__:"ValueType",toString:$estr} - ,TBool: {_hx_index:3,__enum__:"ValueType",toString:$estr} - ,TObject: {_hx_index:4,__enum__:"ValueType",toString:$estr} - ,TFunction: {_hx_index:5,__enum__:"ValueType",toString:$estr} - ,TClass: ($_=function(c) { return {_hx_index:6,c:c,__enum__:"ValueType",toString:$estr}; },$_.__params__ = ["c"],$_) - ,TEnum: ($_=function(e) { return {_hx_index:7,e:e,__enum__:"ValueType",toString:$estr}; },$_.__params__ = ["e"],$_) - ,TUnknown: {_hx_index:8,__enum__:"ValueType",toString:$estr} -}; -ValueType.__empty_constructs__ = [ValueType.TNull,ValueType.TInt,ValueType.TFloat,ValueType.TBool,ValueType.TObject,ValueType.TFunction,ValueType.TUnknown]; -var Type = function() { }; -$hxClasses["Type"] = Type; -Type.__name__ = "Type"; -Type.getClass = function(o) { - return js_Boot.getClass(o); -}; -Type.getEnum = function(o) { - if(o == null) { - return null; - } - return $hxEnums[o.__enum__]; -}; -Type.getSuperClass = function(c) { - return c.__super__; -}; -Type.getClassName = function(c) { - return c.__name__; -}; -Type.getEnumName = function(e) { - return e.__ename__; -}; -Type.resolveClass = function(name) { - return $hxClasses[name]; -}; -Type.resolveEnum = function(name) { - return $hxEnums[name]; -}; -Type.createInstance = function(cl,args) { - return new (Function.prototype.bind.apply(cl,[null].concat(args))); -}; -Type.createEmptyInstance = function(cl) { - return Object.create(cl.prototype); -}; -Type.createEnum = function(e,constr,params) { - var f = Reflect.field(e,constr); - if(f == null) { - throw new js__$Boot_HaxeError("No such constructor " + constr); - } - if(Reflect.isFunction(f)) { - if(params == null) { - throw new js__$Boot_HaxeError("Constructor " + constr + " need parameters"); - } - return f.apply(e,params); - } - if(params != null && params.length != 0) { - throw new js__$Boot_HaxeError("Constructor " + constr + " does not need parameters"); - } - return f; -}; -Type.createEnumIndex = function(e,index,params) { - var c = e.__constructs__[index]; - if(c == null) { - throw new js__$Boot_HaxeError(index + " is not a valid enum constructor index"); - } - return Type.createEnum(e,c,params); -}; -Type.getInstanceFields = function(c) { - var a = []; - for(var i in c.prototype) a.push(i); - HxOverrides.remove(a,"__class__"); - HxOverrides.remove(a,"__properties__"); - return a; -}; -Type.getClassFields = function(c) { - var a = Reflect.fields(c); - HxOverrides.remove(a,"__name__"); - HxOverrides.remove(a,"__interfaces__"); - HxOverrides.remove(a,"__properties__"); - HxOverrides.remove(a,"__super__"); - HxOverrides.remove(a,"__meta__"); - HxOverrides.remove(a,"prototype"); - return a; -}; -Type.getEnumConstructs = function(e) { - return e.__constructs__.slice(); -}; -Type.typeof = function(v) { - switch(typeof(v)) { - case "boolean": - return ValueType.TBool; - case "function": - if(v.__name__ || v.__ename__) { - return ValueType.TObject; - } - return ValueType.TFunction; - case "number": - if(Math.ceil(v) == v % 2147483648.0) { - return ValueType.TInt; - } - return ValueType.TFloat; - case "object": - if(v == null) { - return ValueType.TNull; - } - var e = v.__enum__; - if(e != null) { - return ValueType.TEnum($hxEnums[e]); - } - var c = js_Boot.getClass(v); - if(c != null) { - return ValueType.TClass(c); - } - return ValueType.TObject; - case "string": - return ValueType.TClass(String); - case "undefined": - return ValueType.TNull; - default: - return ValueType.TUnknown; - } -}; -Type.enumEq = function(a,b) { - if(a == b) { - return true; - } - try { - var e = a.__enum__; - if(e == null || e != b.__enum__) { - return false; - } - if(a._hx_index != b._hx_index) { - return false; - } - var enm = $hxEnums[e]; - var ctorName = enm.__constructs__[a._hx_index]; - var params = enm[ctorName].__params__; - var _g = 0; - while(_g < params.length) { - var f = params[_g]; - ++_g; - if(!Type.enumEq(a[f],b[f])) { - return false; - } - } - } catch( e1 ) { - var e2 = ((e1) instanceof js__$Boot_HaxeError) ? e1.val : e1; - return false; - } - return true; -}; -Type.enumConstructor = function(e) { - return $hxEnums[e.__enum__].__constructs__[e._hx_index]; -}; -Type.enumParameters = function(e) { - var enm = $hxEnums[e.__enum__]; - var ctorName = enm.__constructs__[e._hx_index]; - var params = enm[ctorName].__params__; - if(params != null) { - var _g = []; - var _g1 = 0; - while(_g1 < params.length) { - var p = params[_g1]; - ++_g1; - _g.push(e[p]); - } - return _g; - } else { - return []; - } -}; -Type.enumIndex = function(e) { - return e._hx_index; -}; -Type.allEnums = function(e) { - return e.__empty_constructs__.slice(); -}; -var assertions_Assert = function() { }; -$hxClasses["assertions.Assert"] = assertions_Assert; -assertions_Assert.__name__ = "assertions.Assert"; -var assertions_AssertionFailure = function(message,parts) { - this.message = message; - this.parts = parts; -}; -$hxClasses["assertions.AssertionFailure"] = assertions_AssertionFailure; -assertions_AssertionFailure.__name__ = "assertions.AssertionFailure"; -assertions_AssertionFailure.prototype = { - message: null - ,parts: null - ,toString: function() { - var buf_b = ""; - buf_b += Std.string("Assertion failure: " + this.message + ", where"); - var _g = 0; - var _g1 = this.parts; - while(_g < _g1.length) { - var part = _g1[_g]; - ++_g; - buf_b += Std.string("\n\t" + part.expr + ": " + Std.string(part.value)); - } - return buf_b; - } - ,__class__: assertions_AssertionFailure -}; -var controller_commandManager_CommandI = function() { }; -$hxClasses["controller.commandManager.CommandI"] = controller_commandManager_CommandI; -controller_commandManager_CommandI.__name__ = "controller.commandManager.CommandI"; -controller_commandManager_CommandI.__isInterface__ = true; -controller_commandManager_CommandI.prototype = { - execute: null - ,undo: null - ,redo: null - ,__class__: controller_commandManager_CommandI -}; -var controller_commandManager_AbstractCommand = function() { }; -$hxClasses["controller.commandManager.AbstractCommand"] = controller_commandManager_AbstractCommand; -controller_commandManager_AbstractCommand.__name__ = "controller.commandManager.AbstractCommand"; -controller_commandManager_AbstractCommand.__interfaces__ = [controller_commandManager_CommandI]; -controller_commandManager_AbstractCommand.prototype = { - circuitDiagram: null - ,setCircuitDiagram: function(circuitDiagram) { - this.circuitDiagram = circuitDiagram; - } - ,getCircuitDiagram: function() { - return this.circuitDiagram; - } - ,execute: function() { - } - ,redo: function() { - } - ,undo: function() { - } - ,__class__: controller_commandManager_AbstractCommand -}; -var controller_commandManager_AddComponentCommand = function(circuitDiagram,component) { - this.setCircuitDiagram(circuitDiagram); - this.component = component; -}; -$hxClasses["controller.commandManager.AddComponentCommand"] = controller_commandManager_AddComponentCommand; -controller_commandManager_AddComponentCommand.__name__ = "controller.commandManager.AddComponentCommand"; -controller_commandManager_AddComponentCommand.__super__ = controller_commandManager_AbstractCommand; -controller_commandManager_AddComponentCommand.prototype = $extend(controller_commandManager_AbstractCommand.prototype,{ - component: null - ,execute: function() { - this.circuitDiagram.addComponent(this.component); - } - ,redo: function() { - this.execute(); - } - ,undo: function() { - this.circuitDiagram.removeComponent(this.component); - } - ,__class__: controller_commandManager_AddComponentCommand -}); -var controller_commandManager_CommandManager = function() { - this.redoStack = new haxe_ds_GenericStack(); - this.undoStack = new haxe_ds_GenericStack(); -}; -$hxClasses["controller.commandManager.CommandManager"] = controller_commandManager_CommandManager; -controller_commandManager_CommandManager.__name__ = "controller.commandManager.CommandManager"; -controller_commandManager_CommandManager.prototype = { - undoStack: null - ,redoStack: null - ,executeCommand: function(command) { - command.execute(); - var _this = this.undoStack; - _this.head = new haxe_ds_GenericCell(command,_this.head); - } - ,undoCommand: function() { - var _this = this.undoStack; - var k = _this.head; - var undoCommand; - if(k == null) { - undoCommand = null; - } else { - _this.head = k.next; - undoCommand = k.elt; - } - undoCommand.undo(); - var _this1 = this.redoStack; - _this1.head = new haxe_ds_GenericCell(undoCommand,_this1.head); - } - ,redoCommand: function() { - var _this = this.redoStack; - var k = _this.head; - var redoCommand; - if(k == null) { - redoCommand = null; - } else { - _this.head = k.next; - redoCommand = k.elt; - } - redoCommand.redo(); - var _this1 = this.undoStack; - _this1.head = new haxe_ds_GenericCell(redoCommand,_this1.head); - } - ,__class__: controller_commandManager_CommandManager -}; -var controller_listenerInterfaces_ViewListener = function() { }; -$hxClasses["controller.listenerInterfaces.ViewListener"] = controller_listenerInterfaces_ViewListener; -controller_listenerInterfaces_ViewListener.__name__ = "controller.listenerInterfaces.ViewListener"; -controller_listenerInterfaces_ViewListener.__isInterface__ = true; -controller_listenerInterfaces_ViewListener.prototype = { - update: null - ,setViewUpdater: null - ,setActiveTab: null - ,getActiveTab: null - ,__class__: controller_listenerInterfaces_ViewListener -}; -var controller_controllers_AbstractController = function() { }; -$hxClasses["controller.controllers.AbstractController"] = controller_controllers_AbstractController; -controller_controllers_AbstractController.__name__ = "controller.controllers.AbstractController"; -controller_controllers_AbstractController.__interfaces__ = [controller_listenerInterfaces_ViewListener]; -controller_controllers_AbstractController.prototype = { - viewUpdater: null - ,activeTab: null - ,setViewUpdater: function(viewUpdater) { - this.viewUpdater = viewUpdater; - } - ,setActiveTab: function(activeTabModel) { - this.activeTab = activeTabModel; - } - ,getActiveTab: function() { - return this.activeTab; - } - ,update: function(a) { - } - ,__class__: controller_controllers_AbstractController -}; -var controller_listenerInterfaces_CanvasListener = function() { }; -$hxClasses["controller.listenerInterfaces.CanvasListener"] = controller_listenerInterfaces_CanvasListener; -controller_listenerInterfaces_CanvasListener.__name__ = "controller.listenerInterfaces.CanvasListener"; -controller_listenerInterfaces_CanvasListener.__isInterface__ = true; -controller_listenerInterfaces_CanvasListener.__interfaces__ = [controller_listenerInterfaces_ViewListener]; -controller_listenerInterfaces_CanvasListener.prototype = { - addComponentToCanvas: null - ,undoLastCanvasChange: null - ,__class__: controller_listenerInterfaces_CanvasListener -}; -var controller_controllers_CanvasController = function() { - this.componentTypesSingleton = new model_enumeration_ComponentTypes(new model_component_CircuitDiagram()); - this.commandManager = new controller_commandManager_CommandManager(); -}; -$hxClasses["controller.controllers.CanvasController"] = controller_controllers_CanvasController; -controller_controllers_CanvasController.__name__ = "controller.controllers.CanvasController"; -controller_controllers_CanvasController.__interfaces__ = [controller_listenerInterfaces_CanvasListener]; -controller_controllers_CanvasController.__super__ = controller_controllers_AbstractController; -controller_controllers_CanvasController.prototype = $extend(controller_controllers_AbstractController.prototype,{ - commandManager: null - ,componentTypesSingleton: null - ,update: function(a) { - this.viewUpdater.updateView("The element that was added to the canvas div is :: " + a); - } - ,addComponentToCanvas: function(eventObject) { - console.log("AAAA",eventObject.component); - var component = new model_component_Component(eventObject.posX,eventObject.posY,70,70,model_enumeration_ORIENTATION.EAST,this.componentTypesSingleton.toComponentKind(Type.createEnum(model_enumeration_ComponentType,eventObject.component)),0); - var addComponentCommand = new controller_commandManager_AddComponentCommand(this.activeTab.getCircuitDiagram(),component); - this.commandManager.executeCommand(addComponentCommand); - this.viewUpdater.updateCanvas(); - } - ,undoLastCanvasChange: function() { - } - ,__class__: controller_controllers_CanvasController -}); -var controller_listenerInterfaces_SidebarListener = function() { }; -$hxClasses["controller.listenerInterfaces.SidebarListener"] = controller_listenerInterfaces_SidebarListener; -controller_listenerInterfaces_SidebarListener.__name__ = "controller.listenerInterfaces.SidebarListener"; -controller_listenerInterfaces_SidebarListener.__isInterface__ = true; -controller_listenerInterfaces_SidebarListener.__interfaces__ = [controller_listenerInterfaces_ViewListener]; -var controller_controllers_SidebarController = function() { -}; -$hxClasses["controller.controllers.SidebarController"] = controller_controllers_SidebarController; -controller_controllers_SidebarController.__name__ = "controller.controllers.SidebarController"; -controller_controllers_SidebarController.__interfaces__ = [controller_listenerInterfaces_SidebarListener]; -controller_controllers_SidebarController.__super__ = controller_controllers_AbstractController; -controller_controllers_SidebarController.prototype = $extend(controller_controllers_AbstractController.prototype,{ - update: function(a) { - this.viewUpdater.updateView("Event occurred on : " + a); - } - ,__class__: controller_controllers_SidebarController -}); -var controller_viewUpdateInterfaces_CanvasUpdate = function() { }; -$hxClasses["controller.viewUpdateInterfaces.CanvasUpdate"] = controller_viewUpdateInterfaces_CanvasUpdate; -controller_viewUpdateInterfaces_CanvasUpdate.__name__ = "controller.viewUpdateInterfaces.CanvasUpdate"; -controller_viewUpdateInterfaces_CanvasUpdate.__isInterface__ = true; -controller_viewUpdateInterfaces_CanvasUpdate.prototype = { - updateCanvas: null - ,__class__: controller_viewUpdateInterfaces_CanvasUpdate -}; -var controller_viewUpdateInterfaces_SidebarUpdate = function() { }; -$hxClasses["controller.viewUpdateInterfaces.SidebarUpdate"] = controller_viewUpdateInterfaces_SidebarUpdate; -controller_viewUpdateInterfaces_SidebarUpdate.__name__ = "controller.viewUpdateInterfaces.SidebarUpdate"; -controller_viewUpdateInterfaces_SidebarUpdate.__isInterface__ = true; -var controller_viewUpdateInterfaces_ViewUpdate = function() { }; -$hxClasses["controller.viewUpdateInterfaces.ViewUpdate"] = controller_viewUpdateInterfaces_ViewUpdate; -controller_viewUpdateInterfaces_ViewUpdate.__name__ = "controller.viewUpdateInterfaces.ViewUpdate"; -controller_viewUpdateInterfaces_ViewUpdate.__isInterface__ = true; -controller_viewUpdateInterfaces_ViewUpdate.__interfaces__ = [controller_viewUpdateInterfaces_SidebarUpdate,controller_viewUpdateInterfaces_CanvasUpdate]; -controller_viewUpdateInterfaces_ViewUpdate.prototype = { - updateView: null - ,__class__: controller_viewUpdateInterfaces_ViewUpdate -}; -var global_Constant = function() { -}; -$hxClasses["global.Constant"] = global_Constant; -global_Constant.__name__ = "global.Constant"; -global_Constant.prototype = { - __class__: global_Constant -}; -var haxe_IMap = function() { }; -$hxClasses["haxe.IMap"] = haxe_IMap; -haxe_IMap.__name__ = "haxe.IMap"; -haxe_IMap.__isInterface__ = true; -haxe_IMap.prototype = { - get: null - ,set: null - ,exists: null - ,remove: null - ,keys: null - ,iterator: null - ,keyValueIterator: null - ,copy: null - ,toString: null - ,clear: null - ,__class__: haxe_IMap -}; -var haxe__$DynamicAccess_DynamicAccess_$Impl_$ = {}; -$hxClasses["haxe._DynamicAccess.DynamicAccess_Impl_"] = haxe__$DynamicAccess_DynamicAccess_$Impl_$; -haxe__$DynamicAccess_DynamicAccess_$Impl_$.__name__ = "haxe._DynamicAccess.DynamicAccess_Impl_"; -haxe__$DynamicAccess_DynamicAccess_$Impl_$._new = function() { - var this1 = { }; - return this1; -}; -haxe__$DynamicAccess_DynamicAccess_$Impl_$.get = function(this1,key) { - return this1[key]; -}; -haxe__$DynamicAccess_DynamicAccess_$Impl_$.set = function(this1,key,value) { - return this1[key] = value; -}; -haxe__$DynamicAccess_DynamicAccess_$Impl_$.exists = function(this1,key) { - return Object.prototype.hasOwnProperty.call(this1,key); -}; -haxe__$DynamicAccess_DynamicAccess_$Impl_$.remove = function(this1,key) { - return Reflect.deleteField(this1,key); -}; -haxe__$DynamicAccess_DynamicAccess_$Impl_$.keys = function(this1) { - return Reflect.fields(this1); -}; -haxe__$DynamicAccess_DynamicAccess_$Impl_$.copy = function(this1) { - return Reflect.copy(this1); -}; -haxe__$DynamicAccess_DynamicAccess_$Impl_$.iterator = function(this1) { - return new haxe_iterators_DynamicAccessIterator(this1); -}; -haxe__$DynamicAccess_DynamicAccess_$Impl_$.keyValueIterator = function(this1) { - return new haxe_iterators_DynamicAccessKeyValueIterator(this1); -}; -var haxe_Log = function() { }; -$hxClasses["haxe.Log"] = haxe_Log; -haxe_Log.__name__ = "haxe.Log"; -haxe_Log.formatOutput = function(v,infos) { - var str = Std.string(v); - if(infos == null) { - return str; - } - var pstr = infos.fileName + ":" + infos.lineNumber; - if(infos.customParams != null) { - var _g = 0; - var _g1 = infos.customParams; - while(_g < _g1.length) { - var v1 = _g1[_g]; - ++_g; - str += ", " + Std.string(v1); - } - } - return pstr + ": " + str; -}; -haxe_Log.trace = function(v,infos) { - var str = haxe_Log.formatOutput(v,infos); - if(typeof(console) != "undefined" && console.log != null) { - console.log(str); - } -}; -var haxe_display__$FsPath_FsPath_$Impl_$ = {}; -$hxClasses["haxe.display._FsPath.FsPath_Impl_"] = haxe_display__$FsPath_FsPath_$Impl_$; -haxe_display__$FsPath_FsPath_$Impl_$.__name__ = "haxe.display._FsPath.FsPath_Impl_"; -haxe_display__$FsPath_FsPath_$Impl_$._new = function(path) { - var this1 = path; - return this1; -}; -haxe_display__$FsPath_FsPath_$Impl_$.toString = function(this1) { - return this1; -}; -var haxe_ds_BalancedTree = function() { -}; -$hxClasses["haxe.ds.BalancedTree"] = haxe_ds_BalancedTree; -haxe_ds_BalancedTree.__name__ = "haxe.ds.BalancedTree"; -haxe_ds_BalancedTree.__interfaces__ = [haxe_IMap]; -haxe_ds_BalancedTree.prototype = { - root: null - ,set: function(key,value) { - this.root = this.setLoop(key,value,this.root); - } - ,get: function(key) { - var node = this.root; - while(node != null) { - var c = this.compare(key,node.key); - if(c == 0) { - return node.value; - } - if(c < 0) { - node = node.left; - } else { - node = node.right; - } - } - return null; - } - ,remove: function(key) { - try { - this.root = this.removeLoop(key,this.root); - return true; - } catch( e ) { - var e1 = ((e) instanceof js__$Boot_HaxeError) ? e.val : e; - if(typeof(e1) == "string") { - var e2 = e1; - return false; - } else { - throw e; - } - } - } - ,exists: function(key) { - var node = this.root; - while(node != null) { - var c = this.compare(key,node.key); - if(c == 0) { - return true; - } else if(c < 0) { - node = node.left; - } else { - node = node.right; - } - } - return false; - } - ,iterator: function() { - var ret = []; - this.iteratorLoop(this.root,ret); - return HxOverrides.iter(ret); - } - ,keyValueIterator: function() { - return new haxe_iterators_MapKeyValueIterator(this); - } - ,keys: function() { - var ret = []; - this.keysLoop(this.root,ret); - return HxOverrides.iter(ret); - } - ,copy: function() { - var copied = new haxe_ds_BalancedTree(); - copied.root = this.root; - return copied; - } - ,setLoop: function(k,v,node) { - if(node == null) { - return new haxe_ds_TreeNode(null,k,v,null); - } - var c = this.compare(k,node.key); - if(c == 0) { - return new haxe_ds_TreeNode(node.left,k,v,node.right,node == null ? 0 : node._height); - } else if(c < 0) { - var nl = this.setLoop(k,v,node.left); - return this.balance(nl,node.key,node.value,node.right); - } else { - var nr = this.setLoop(k,v,node.right); - return this.balance(node.left,node.key,node.value,nr); - } - } - ,removeLoop: function(k,node) { - if(node == null) { - throw new js__$Boot_HaxeError("Not_found"); - } - var c = this.compare(k,node.key); - if(c == 0) { - return this.merge(node.left,node.right); - } else if(c < 0) { - return this.balance(this.removeLoop(k,node.left),node.key,node.value,node.right); - } else { - return this.balance(node.left,node.key,node.value,this.removeLoop(k,node.right)); - } - } - ,iteratorLoop: function(node,acc) { - if(node != null) { - this.iteratorLoop(node.left,acc); - acc.push(node.value); - this.iteratorLoop(node.right,acc); - } - } - ,keysLoop: function(node,acc) { - if(node != null) { - this.keysLoop(node.left,acc); - acc.push(node.key); - this.keysLoop(node.right,acc); - } - } - ,merge: function(t1,t2) { - if(t1 == null) { - return t2; - } - if(t2 == null) { - return t1; - } - var t = this.minBinding(t2); - return this.balance(t1,t.key,t.value,this.removeMinBinding(t2)); - } - ,minBinding: function(t) { - if(t == null) { - throw new js__$Boot_HaxeError("Not_found"); - } else if(t.left == null) { - return t; - } else { - return this.minBinding(t.left); - } - } - ,removeMinBinding: function(t) { - if(t.left == null) { - return t.right; - } else { - return this.balance(this.removeMinBinding(t.left),t.key,t.value,t.right); - } - } - ,balance: function(l,k,v,r) { - var hl = l == null ? 0 : l._height; - var hr = r == null ? 0 : r._height; - if(hl > hr + 2) { - var _this = l.left; - var _this1 = l.right; - if((_this == null ? 0 : _this._height) >= (_this1 == null ? 0 : _this1._height)) { - return new haxe_ds_TreeNode(l.left,l.key,l.value,new haxe_ds_TreeNode(l.right,k,v,r)); - } else { - return new haxe_ds_TreeNode(new haxe_ds_TreeNode(l.left,l.key,l.value,l.right.left),l.right.key,l.right.value,new haxe_ds_TreeNode(l.right.right,k,v,r)); - } - } else if(hr > hl + 2) { - var _this2 = r.right; - var _this3 = r.left; - if((_this2 == null ? 0 : _this2._height) > (_this3 == null ? 0 : _this3._height)) { - return new haxe_ds_TreeNode(new haxe_ds_TreeNode(l,k,v,r.left),r.key,r.value,r.right); - } else { - return new haxe_ds_TreeNode(new haxe_ds_TreeNode(l,k,v,r.left.left),r.left.key,r.left.value,new haxe_ds_TreeNode(r.left.right,r.key,r.value,r.right)); - } - } else { - return new haxe_ds_TreeNode(l,k,v,r,(hl > hr ? hl : hr) + 1); - } - } - ,compare: function(k1,k2) { - return Reflect.compare(k1,k2); - } - ,toString: function() { - if(this.root == null) { - return "{}"; - } else { - return "{" + this.root.toString() + "}"; - } - } - ,clear: function() { - this.root = null; - } - ,__class__: haxe_ds_BalancedTree -}; -var haxe_ds_TreeNode = function(l,k,v,r,h) { - if(h == null) { - h = -1; - } - this.left = l; - this.key = k; - this.value = v; - this.right = r; - if(h == -1) { - var tmp; - var _this = this.left; - var _this1 = this.right; - if((_this == null ? 0 : _this._height) > (_this1 == null ? 0 : _this1._height)) { - var _this2 = this.left; - tmp = _this2 == null ? 0 : _this2._height; - } else { - var _this3 = this.right; - tmp = _this3 == null ? 0 : _this3._height; - } - this._height = tmp + 1; - } else { - this._height = h; - } -}; -$hxClasses["haxe.ds.TreeNode"] = haxe_ds_TreeNode; -haxe_ds_TreeNode.__name__ = "haxe.ds.TreeNode"; -haxe_ds_TreeNode.prototype = { - left: null - ,right: null - ,key: null - ,value: null - ,_height: null - ,toString: function() { - return (this.left == null ? "" : this.left.toString() + ", ") + ("" + Std.string(this.key) + "=" + Std.string(this.value)) + (this.right == null ? "" : ", " + this.right.toString()); - } - ,__class__: haxe_ds_TreeNode -}; -var haxe_ds_EnumValueMap = function() { - haxe_ds_BalancedTree.call(this); -}; -$hxClasses["haxe.ds.EnumValueMap"] = haxe_ds_EnumValueMap; -haxe_ds_EnumValueMap.__name__ = "haxe.ds.EnumValueMap"; -haxe_ds_EnumValueMap.__interfaces__ = [haxe_IMap]; -haxe_ds_EnumValueMap.__super__ = haxe_ds_BalancedTree; -haxe_ds_EnumValueMap.prototype = $extend(haxe_ds_BalancedTree.prototype,{ - compare: function(k1,k2) { - var d = k1._hx_index - k2._hx_index; - if(d != 0) { - return d; - } - var p1 = Type.enumParameters(k1); - var p2 = Type.enumParameters(k2); - if(p1.length == 0 && p2.length == 0) { - return 0; - } - return this.compareArgs(p1,p2); - } - ,compareArgs: function(a1,a2) { - var ld = a1.length - a2.length; - if(ld != 0) { - return ld; - } - var _g = 0; - var _g1 = a1.length; - while(_g < _g1) { - var i = _g++; - var d = this.compareArg(a1[i],a2[i]); - if(d != 0) { - return d; - } - } - return 0; - } - ,compareArg: function(v1,v2) { - if(Reflect.isEnumValue(v1) && Reflect.isEnumValue(v2)) { - return this.compare(v1,v2); - } else if(((v1) instanceof Array) && ((v2) instanceof Array)) { - return this.compareArgs(v1,v2); - } else { - return Reflect.compare(v1,v2); - } - } - ,copy: function() { - var copied = new haxe_ds_EnumValueMap(); - copied.root = this.root; - return copied; - } - ,__class__: haxe_ds_EnumValueMap -}); -var haxe_ds_GenericCell = function(elt,next) { - this.elt = elt; - this.next = next; -}; -$hxClasses["haxe.ds.GenericCell"] = haxe_ds_GenericCell; -haxe_ds_GenericCell.__name__ = "haxe.ds.GenericCell"; -haxe_ds_GenericCell.prototype = { - elt: null - ,next: null - ,__class__: haxe_ds_GenericCell -}; -var haxe_ds_GenericStack = function() { -}; -$hxClasses["haxe.ds.GenericStack"] = haxe_ds_GenericStack; -haxe_ds_GenericStack.__name__ = "haxe.ds.GenericStack"; -haxe_ds_GenericStack.prototype = { - head: null - ,add: function(item) { - this.head = new haxe_ds_GenericCell(item,this.head); - } - ,first: function() { - if(this.head == null) { - return null; - } else { - return this.head.elt; - } - } - ,pop: function() { - var k = this.head; - if(k == null) { - return null; - } else { - this.head = k.next; - return k.elt; - } - } - ,isEmpty: function() { - return this.head == null; - } - ,remove: function(v) { - var prev = null; - var l = this.head; - while(l != null) { - if(l.elt == v) { - if(prev == null) { - this.head = l.next; - } else { - prev.next = l.next; - } - break; - } - prev = l; - l = l.next; - } - return l != null; - } - ,iterator: function() { - var l = this.head; - return { hasNext : function() { - return l != null; - }, next : function() { - var k = l; - l = k.next; - return k.elt; - }}; - } - ,toString: function() { - var a = []; - var l = this.head; - while(l != null) { - a.push(l.elt); - l = l.next; - } - return "{" + a.join(",") + "}"; - } - ,__class__: haxe_ds_GenericStack -}; -var haxe_ds__$HashMap_HashMap_$Impl_$ = {}; -$hxClasses["haxe.ds._HashMap.HashMap_Impl_"] = haxe_ds__$HashMap_HashMap_$Impl_$; -haxe_ds__$HashMap_HashMap_$Impl_$.__name__ = "haxe.ds._HashMap.HashMap_Impl_"; -haxe_ds__$HashMap_HashMap_$Impl_$._new = function() { - var this1 = new haxe_ds__$HashMap_HashMapData(); - return this1; -}; -haxe_ds__$HashMap_HashMap_$Impl_$.set = function(this1,k,v) { - var _this = this1.keys; - var key = k.hashCode(); - _this.h[key] = k; - var _this1 = this1.values; - var key1 = k.hashCode(); - _this1.h[key1] = v; -}; -haxe_ds__$HashMap_HashMap_$Impl_$.get = function(this1,k) { - var _this = this1.values; - var key = k.hashCode(); - return _this.h[key]; -}; -haxe_ds__$HashMap_HashMap_$Impl_$.exists = function(this1,k) { - var _this = this1.values; - var key = k.hashCode(); - return _this.h.hasOwnProperty(key); -}; -haxe_ds__$HashMap_HashMap_$Impl_$.remove = function(this1,k) { - this1.values.remove(k.hashCode()); - return this1.keys.remove(k.hashCode()); -}; -haxe_ds__$HashMap_HashMap_$Impl_$.keys = function(this1) { - return this1.keys.iterator(); -}; -haxe_ds__$HashMap_HashMap_$Impl_$.copy = function(this1) { - var copied = new haxe_ds__$HashMap_HashMapData(); - copied.keys = this1.keys.copy(); - copied.values = this1.values.copy(); - return copied; -}; -haxe_ds__$HashMap_HashMap_$Impl_$.iterator = function(this1) { - return this1.values.iterator(); -}; -haxe_ds__$HashMap_HashMap_$Impl_$.clear = function(this1) { - this1.keys.h = { }; - this1.values.h = { }; -}; -var haxe_ds__$HashMap_HashMapData = function() { - this.keys = new haxe_ds_IntMap(); - this.values = new haxe_ds_IntMap(); -}; -$hxClasses["haxe.ds._HashMap.HashMapData"] = haxe_ds__$HashMap_HashMapData; -haxe_ds__$HashMap_HashMapData.__name__ = "haxe.ds._HashMap.HashMapData"; -haxe_ds__$HashMap_HashMapData.prototype = { - keys: null - ,values: null - ,__class__: haxe_ds__$HashMap_HashMapData -}; -var haxe_ds_IntMap = function() { - this.h = { }; -}; -$hxClasses["haxe.ds.IntMap"] = haxe_ds_IntMap; -haxe_ds_IntMap.__name__ = "haxe.ds.IntMap"; -haxe_ds_IntMap.__interfaces__ = [haxe_IMap]; -haxe_ds_IntMap.prototype = { - h: null - ,set: function(key,value) { - this.h[key] = value; - } - ,get: function(key) { - return this.h[key]; - } - ,exists: function(key) { - return this.h.hasOwnProperty(key); - } - ,remove: function(key) { - if(!this.h.hasOwnProperty(key)) { - return false; - } - delete(this.h[key]); - return true; - } - ,keys: function() { - var a = []; - for( var key in this.h ) (this.h.hasOwnProperty(key) ? a.push(key | 0) : null); - return HxOverrides.iter(a); - } - ,iterator: function() { - return { ref : this.h, it : this.keys(), hasNext : function() { - return this.it.hasNext(); - }, next : function() { - var i = this.it.next(); - return this.ref[i]; - }}; - } - ,keyValueIterator: function() { - return new haxe_iterators_MapKeyValueIterator(this); - } - ,copy: function() { - var copied = new haxe_ds_IntMap(); - var key = this.keys(); - while(key.hasNext()) { - var key1 = key.next(); - copied.h[key1] = this.h[key1]; - } - return copied; - } - ,toString: function() { - var s_b = ""; - s_b += "{"; - var it = this.keys(); - var i = it; - while(i.hasNext()) { - var i1 = i.next(); - s_b += i1 == null ? "null" : "" + i1; - s_b += " => "; - s_b += Std.string(Std.string(this.h[i1])); - if(it.hasNext()) { - s_b += ", "; - } - } - s_b += "}"; - return s_b; - } - ,clear: function() { - this.h = { }; - } - ,__class__: haxe_ds_IntMap -}; -var haxe_ds_List = function() { - this.length = 0; -}; -$hxClasses["haxe.ds.List"] = haxe_ds_List; -haxe_ds_List.__name__ = "haxe.ds.List"; -haxe_ds_List.prototype = { - h: null - ,q: null - ,length: null - ,add: function(item) { - var x = new haxe_ds__$List_ListNode(item,null); - if(this.h == null) { - this.h = x; - } else { - this.q.next = x; - } - this.q = x; - this.length++; - } - ,push: function(item) { - var x = new haxe_ds__$List_ListNode(item,this.h); - this.h = x; - if(this.q == null) { - this.q = x; - } - this.length++; - } - ,first: function() { - if(this.h == null) { - return null; - } else { - return this.h.item; - } - } - ,last: function() { - if(this.q == null) { - return null; - } else { - return this.q.item; - } - } - ,pop: function() { - if(this.h == null) { - return null; - } - var x = this.h.item; - this.h = this.h.next; - if(this.h == null) { - this.q = null; - } - this.length--; - return x; - } - ,isEmpty: function() { - return this.h == null; - } - ,clear: function() { - this.h = null; - this.q = null; - this.length = 0; - } - ,remove: function(v) { - var prev = null; - var l = this.h; - while(l != null) { - if(l.item == v) { - if(prev == null) { - this.h = l.next; - } else { - prev.next = l.next; - } - if(this.q == l) { - this.q = prev; - } - this.length--; - return true; - } - prev = l; - l = l.next; - } - return false; - } - ,iterator: function() { - return new haxe_ds__$List_ListIterator(this.h); - } - ,keyValueIterator: function() { - return new haxe_ds__$List_ListKeyValueIterator(this.h); - } - ,toString: function() { - var s_b = ""; - var first = true; - var l = this.h; - s_b += "{"; - while(l != null) { - if(first) { - first = false; - } else { - s_b += ", "; - } - s_b += Std.string(Std.string(l.item)); - l = l.next; - } - s_b += "}"; - return s_b; - } - ,join: function(sep) { - var s_b = ""; - var first = true; - var l = this.h; - while(l != null) { - if(first) { - first = false; - } else { - s_b += sep == null ? "null" : "" + sep; - } - s_b += Std.string(l.item); - l = l.next; - } - return s_b; - } - ,filter: function(f) { - var l2 = new haxe_ds_List(); - var l = this.h; - while(l != null) { - var v = l.item; - l = l.next; - if(f(v)) { - l2.add(v); - } - } - return l2; - } - ,map: function(f) { - var b = new haxe_ds_List(); - var l = this.h; - while(l != null) { - var v = l.item; - l = l.next; - b.add(f(v)); - } - return b; - } - ,__class__: haxe_ds_List -}; -var haxe_ds__$List_ListNode = function(item,next) { - this.item = item; - this.next = next; -}; -$hxClasses["haxe.ds._List.ListNode"] = haxe_ds__$List_ListNode; -haxe_ds__$List_ListNode.__name__ = "haxe.ds._List.ListNode"; -haxe_ds__$List_ListNode.prototype = { - item: null - ,next: null - ,__class__: haxe_ds__$List_ListNode -}; -var haxe_ds__$List_ListIterator = function(head) { - this.head = head; -}; -$hxClasses["haxe.ds._List.ListIterator"] = haxe_ds__$List_ListIterator; -haxe_ds__$List_ListIterator.__name__ = "haxe.ds._List.ListIterator"; -haxe_ds__$List_ListIterator.prototype = { - head: null - ,hasNext: function() { - return this.head != null; - } - ,next: function() { - var val = this.head.item; - this.head = this.head.next; - return val; - } - ,__class__: haxe_ds__$List_ListIterator -}; -var haxe_ds__$List_ListKeyValueIterator = function(head) { - this.head = head; - this.idx = 0; -}; -$hxClasses["haxe.ds._List.ListKeyValueIterator"] = haxe_ds__$List_ListKeyValueIterator; -haxe_ds__$List_ListKeyValueIterator.__name__ = "haxe.ds._List.ListKeyValueIterator"; -haxe_ds__$List_ListKeyValueIterator.prototype = { - idx: null - ,head: null - ,hasNext: function() { - return this.head != null; - } - ,next: function() { - var val = this.head.item; - this.head = this.head.next; - return { value : val, key : this.idx++}; - } - ,__class__: haxe_ds__$List_ListKeyValueIterator -}; -var haxe_ds__$Map_Map_$Impl_$ = {}; -$hxClasses["haxe.ds._Map.Map_Impl_"] = haxe_ds__$Map_Map_$Impl_$; -haxe_ds__$Map_Map_$Impl_$.__name__ = "haxe.ds._Map.Map_Impl_"; -haxe_ds__$Map_Map_$Impl_$.set = function(this1,key,value) { - this1.set(key,value); -}; -haxe_ds__$Map_Map_$Impl_$.get = function(this1,key) { - return this1.get(key); -}; -haxe_ds__$Map_Map_$Impl_$.exists = function(this1,key) { - return this1.exists(key); -}; -haxe_ds__$Map_Map_$Impl_$.remove = function(this1,key) { - return this1.remove(key); -}; -haxe_ds__$Map_Map_$Impl_$.keys = function(this1) { - return this1.keys(); -}; -haxe_ds__$Map_Map_$Impl_$.iterator = function(this1) { - return this1.iterator(); -}; -haxe_ds__$Map_Map_$Impl_$.keyValueIterator = function(this1) { - return this1.keyValueIterator(); -}; -haxe_ds__$Map_Map_$Impl_$.copy = function(this1) { - return this1.copy(); -}; -haxe_ds__$Map_Map_$Impl_$.toString = function(this1) { - return this1.toString(); -}; -haxe_ds__$Map_Map_$Impl_$.clear = function(this1) { - this1.clear(); -}; -haxe_ds__$Map_Map_$Impl_$.arrayWrite = function(this1,k,v) { - this1.set(k,v); - return v; -}; -haxe_ds__$Map_Map_$Impl_$.toStringMap = function(t) { - return new haxe_ds_StringMap(); -}; -haxe_ds__$Map_Map_$Impl_$.toIntMap = function(t) { - return new haxe_ds_IntMap(); -}; -haxe_ds__$Map_Map_$Impl_$.toEnumValueMapMap = function(t) { - return new haxe_ds_EnumValueMap(); -}; -haxe_ds__$Map_Map_$Impl_$.toObjectMap = function(t) { - return new haxe_ds_ObjectMap(); -}; -haxe_ds__$Map_Map_$Impl_$.fromStringMap = function(map) { - return map; -}; -haxe_ds__$Map_Map_$Impl_$.fromIntMap = function(map) { - return map; -}; -haxe_ds__$Map_Map_$Impl_$.fromObjectMap = function(map) { - return map; -}; -var haxe_ds_ObjectMap = function() { - this.h = { __keys__ : { }}; -}; -$hxClasses["haxe.ds.ObjectMap"] = haxe_ds_ObjectMap; -haxe_ds_ObjectMap.__name__ = "haxe.ds.ObjectMap"; -haxe_ds_ObjectMap.__interfaces__ = [haxe_IMap]; -haxe_ds_ObjectMap.count = null; -haxe_ds_ObjectMap.assignId = function(obj) { - return (obj.__id__ = $global.$haxeUID++); -}; -haxe_ds_ObjectMap.getId = function(obj) { - return obj.__id__; -}; -haxe_ds_ObjectMap.prototype = { - h: null - ,set: function(key,value) { - var id = key.__id__; - if(id == null) { - id = (key.__id__ = $global.$haxeUID++); - } - this.h[id] = value; - this.h.__keys__[id] = key; - } - ,get: function(key) { - return this.h[key.__id__]; - } - ,exists: function(key) { - return this.h.__keys__[key.__id__] != null; - } - ,remove: function(key) { - var id = key.__id__; - if(this.h.__keys__[id] == null) { - return false; - } - delete(this.h[id]); - delete(this.h.__keys__[id]); - return true; - } - ,keys: function() { - var a = []; - for( var key in this.h.__keys__ ) { - if(this.h.hasOwnProperty(key)) { - a.push(this.h.__keys__[key]); - } - } - return HxOverrides.iter(a); - } - ,iterator: function() { - return { ref : this.h, it : this.keys(), hasNext : function() { - return this.it.hasNext(); - }, next : function() { - var i = this.it.next(); - return this.ref[i.__id__]; - }}; - } - ,keyValueIterator: function() { - return new haxe_iterators_MapKeyValueIterator(this); - } - ,copy: function() { - var copied = new haxe_ds_ObjectMap(); - var key = this.keys(); - while(key.hasNext()) { - var key1 = key.next(); - copied.set(key1,this.h[key1.__id__]); - } - return copied; - } - ,toString: function() { - var s_b = ""; - s_b += "{"; - var it = this.keys(); - var i = it; - while(i.hasNext()) { - var i1 = i.next(); - s_b += Std.string(Std.string(i1)); - s_b += " => "; - s_b += Std.string(Std.string(this.h[i1.__id__])); - if(it.hasNext()) { - s_b += ", "; - } - } - s_b += "}"; - return s_b; - } - ,clear: function() { - this.h = { __keys__ : { }}; - } - ,__class__: haxe_ds_ObjectMap -}; -var haxe_ds__$ReadOnlyArray_ReadOnlyArray_$Impl_$ = {}; -$hxClasses["haxe.ds._ReadOnlyArray.ReadOnlyArray_Impl_"] = haxe_ds__$ReadOnlyArray_ReadOnlyArray_$Impl_$; -haxe_ds__$ReadOnlyArray_ReadOnlyArray_$Impl_$.__name__ = "haxe.ds._ReadOnlyArray.ReadOnlyArray_Impl_"; -haxe_ds__$ReadOnlyArray_ReadOnlyArray_$Impl_$.__properties__ = {get_length:"get_length"}; -haxe_ds__$ReadOnlyArray_ReadOnlyArray_$Impl_$.get_length = function(this1) { - return this1.length; -}; -haxe_ds__$ReadOnlyArray_ReadOnlyArray_$Impl_$.get = function(this1,i) { - return this1[i]; -}; -var haxe_ds__$StringMap_StringMapIterator = function(map,keys) { - this.map = map; - this.keys = keys; - this.index = 0; - this.count = keys.length; -}; -$hxClasses["haxe.ds._StringMap.StringMapIterator"] = haxe_ds__$StringMap_StringMapIterator; -haxe_ds__$StringMap_StringMapIterator.__name__ = "haxe.ds._StringMap.StringMapIterator"; -haxe_ds__$StringMap_StringMapIterator.prototype = { - map: null - ,keys: null - ,index: null - ,count: null - ,hasNext: function() { - return this.index < this.count; - } - ,next: function() { - var _this = this.map; - var key = this.keys[this.index++]; - if(__map_reserved[key] != null) { - return _this.getReserved(key); - } else { - return _this.h[key]; - } - } - ,__class__: haxe_ds__$StringMap_StringMapIterator -}; -var haxe_ds_StringMap = function() { - this.h = { }; -}; -$hxClasses["haxe.ds.StringMap"] = haxe_ds_StringMap; -haxe_ds_StringMap.__name__ = "haxe.ds.StringMap"; -haxe_ds_StringMap.__interfaces__ = [haxe_IMap]; -haxe_ds_StringMap.prototype = { - h: null - ,rh: null - ,isReserved: function(key) { - return __map_reserved[key] != null; - } - ,set: function(key,value) { - if(__map_reserved[key] != null) { - this.setReserved(key,value); - } else { - this.h[key] = value; - } - } - ,get: function(key) { - if(__map_reserved[key] != null) { - return this.getReserved(key); - } - return this.h[key]; - } - ,exists: function(key) { - if(__map_reserved[key] != null) { - return this.existsReserved(key); - } - return this.h.hasOwnProperty(key); - } - ,setReserved: function(key,value) { - if(this.rh == null) { - this.rh = { }; - } - this.rh["$" + key] = value; - } - ,getReserved: function(key) { - if(this.rh == null) { - return null; - } else { - return this.rh["$" + key]; - } - } - ,existsReserved: function(key) { - if(this.rh == null) { - return false; - } - return this.rh.hasOwnProperty("$" + key); - } - ,remove: function(key) { - if(__map_reserved[key] != null) { - key = "$" + key; - if(this.rh == null || !this.rh.hasOwnProperty(key)) { - return false; - } - delete(this.rh[key]); - return true; - } else { - if(!this.h.hasOwnProperty(key)) { - return false; - } - delete(this.h[key]); - return true; - } - } - ,keys: function() { - return HxOverrides.iter(this.arrayKeys()); - } - ,arrayKeys: function() { - var out = []; - for( var key in this.h ) { - if(this.h.hasOwnProperty(key)) { - out.push(key); - } - } - if(this.rh != null) { - for( var key in this.rh ) { - if(key.charCodeAt(0) == 36) { - out.push(key.substr(1)); - } - } - } - return out; - } - ,iterator: function() { - return new haxe_ds__$StringMap_StringMapIterator(this,this.arrayKeys()); - } - ,keyValueIterator: function() { - return new haxe_iterators_MapKeyValueIterator(this); - } - ,copy: function() { - var copied = new haxe_ds_StringMap(); - var key = this.keys(); - while(key.hasNext()) { - var key1 = key.next(); - var value = __map_reserved[key1] != null ? this.getReserved(key1) : this.h[key1]; - if(__map_reserved[key1] != null) { - copied.setReserved(key1,value); - } else { - copied.h[key1] = value; - } - } - return copied; - } - ,toString: function() { - var s_b = ""; - s_b += "{"; - var keys = this.arrayKeys(); - var _g = 0; - var _g1 = keys.length; - while(_g < _g1) { - var i = _g++; - var k = keys[i]; - s_b += k == null ? "null" : "" + k; - s_b += " => "; - s_b += Std.string(Std.string(__map_reserved[k] != null ? this.getReserved(k) : this.h[k])); - if(i < keys.length - 1) { - s_b += ", "; - } - } - s_b += "}"; - return s_b; - } - ,clear: function() { - this.h = { }; - this.rh = null; - } - ,__class__: haxe_ds_StringMap -}; -var haxe_ds_WeakMap = function() { - throw new js__$Boot_HaxeError("Not implemented for this platform"); -}; -$hxClasses["haxe.ds.WeakMap"] = haxe_ds_WeakMap; -haxe_ds_WeakMap.__name__ = "haxe.ds.WeakMap"; -haxe_ds_WeakMap.__interfaces__ = [haxe_IMap]; -haxe_ds_WeakMap.prototype = { - set: function(key,value) { - } - ,get: function(key) { - return null; - } - ,exists: function(key) { - return false; - } - ,remove: function(key) { - return false; - } - ,keys: function() { - return null; - } - ,iterator: function() { - return null; - } - ,keyValueIterator: function() { - return null; - } - ,copy: function() { - return null; - } - ,toString: function() { - return null; - } - ,clear: function() { - } - ,__class__: haxe_ds_WeakMap -}; -var haxe_iterators_DynamicAccessIterator = function(access) { - this.access = access; - this.keys = Reflect.fields(access); - this.index = 0; -}; -$hxClasses["haxe.iterators.DynamicAccessIterator"] = haxe_iterators_DynamicAccessIterator; -haxe_iterators_DynamicAccessIterator.__name__ = "haxe.iterators.DynamicAccessIterator"; -haxe_iterators_DynamicAccessIterator.prototype = { - access: null - ,keys: null - ,index: null - ,hasNext: function() { - return this.index < this.keys.length; - } - ,next: function() { - return this.access[this.keys[this.index++]]; - } - ,__class__: haxe_iterators_DynamicAccessIterator -}; -var haxe_iterators_DynamicAccessKeyValueIterator = function(access) { - this.access = access; - this.keys = Reflect.fields(access); - this.index = 0; -}; -$hxClasses["haxe.iterators.DynamicAccessKeyValueIterator"] = haxe_iterators_DynamicAccessKeyValueIterator; -haxe_iterators_DynamicAccessKeyValueIterator.__name__ = "haxe.iterators.DynamicAccessKeyValueIterator"; -haxe_iterators_DynamicAccessKeyValueIterator.prototype = { - access: null - ,keys: null - ,index: null - ,hasNext: function() { - return this.index < this.keys.length; - } - ,next: function() { - var key = this.keys[this.index++]; - return { value : this.access[key], key : key}; - } - ,__class__: haxe_iterators_DynamicAccessKeyValueIterator -}; -var haxe_iterators_MapKeyValueIterator = function(map) { - this.map = map; - this.keys = map.keys(); -}; -$hxClasses["haxe.iterators.MapKeyValueIterator"] = haxe_iterators_MapKeyValueIterator; -haxe_iterators_MapKeyValueIterator.__name__ = "haxe.iterators.MapKeyValueIterator"; -haxe_iterators_MapKeyValueIterator.prototype = { - map: null - ,keys: null - ,hasNext: function() { - return this.keys.hasNext(); - } - ,next: function() { - var key = this.keys.next(); - return { value : this.map.get(key), key : key}; - } - ,__class__: haxe_iterators_MapKeyValueIterator -}; -var haxe_iterators_StringIterator = function(s) { - this.offset = 0; - this.s = s; -}; -$hxClasses["haxe.iterators.StringIterator"] = haxe_iterators_StringIterator; -haxe_iterators_StringIterator.__name__ = "haxe.iterators.StringIterator"; -haxe_iterators_StringIterator.prototype = { - offset: null - ,s: null - ,hasNext: function() { - return this.offset < this.s.length; - } - ,next: function() { - return this.s.charCodeAt(this.offset++); - } - ,__class__: haxe_iterators_StringIterator -}; -var haxe_iterators_StringIteratorUnicode = function(s) { - this.offset = 0; - this.s = s; -}; -$hxClasses["haxe.iterators.StringIteratorUnicode"] = haxe_iterators_StringIteratorUnicode; -haxe_iterators_StringIteratorUnicode.__name__ = "haxe.iterators.StringIteratorUnicode"; -haxe_iterators_StringIteratorUnicode.unicodeIterator = function(s) { - return new haxe_iterators_StringIteratorUnicode(s); -}; -haxe_iterators_StringIteratorUnicode.prototype = { - offset: null - ,s: null - ,hasNext: function() { - return this.offset < this.s.length; - } - ,next: function() { - var s = this.s; - var index = this.offset++; - var c = s.charCodeAt(index); - if(c >= 55296 && c <= 56319) { - c = c - 55232 << 10 | s.charCodeAt(index + 1) & 1023; - } - var c1 = c; - if(c1 >= 65536) { - this.offset++; - } - return c1; - } - ,__class__: haxe_iterators_StringIteratorUnicode -}; -var haxe_iterators_StringKeyValueIterator = function(s) { - this.offset = 0; - this.s = s; -}; -$hxClasses["haxe.iterators.StringKeyValueIterator"] = haxe_iterators_StringKeyValueIterator; -haxe_iterators_StringKeyValueIterator.__name__ = "haxe.iterators.StringKeyValueIterator"; -haxe_iterators_StringKeyValueIterator.prototype = { - offset: null - ,s: null - ,hasNext: function() { - return this.offset < this.s.length; - } - ,next: function() { - return { key : this.offset, value : this.s.charCodeAt(this.offset++)}; - } - ,__class__: haxe_iterators_StringKeyValueIterator -}; -var haxe_macro_ComplexTypeTools = function() { }; -$hxClasses["haxe.macro.ComplexTypeTools"] = haxe_macro_ComplexTypeTools; -haxe_macro_ComplexTypeTools.__name__ = "haxe.macro.ComplexTypeTools"; -haxe_macro_ComplexTypeTools.toString = function(c) { - return new haxe_macro_Printer().printComplexType(c); -}; -var haxe_macro_Message = $hxEnums["haxe.macro.Message"] = { __ename__ : "haxe.macro.Message", __constructs__ : ["Info","Warning"] - ,Info: ($_=function(msg,pos) { return {_hx_index:0,msg:msg,pos:pos,__enum__:"haxe.macro.Message",toString:$estr}; },$_.__params__ = ["msg","pos"],$_) - ,Warning: ($_=function(msg,pos) { return {_hx_index:1,msg:msg,pos:pos,__enum__:"haxe.macro.Message",toString:$estr}; },$_.__params__ = ["msg","pos"],$_) -}; -haxe_macro_Message.__empty_constructs__ = []; -var haxe_macro_Context = function() { }; -$hxClasses["haxe.macro.Context"] = haxe_macro_Context; -haxe_macro_Context.__name__ = "haxe.macro.Context"; -var haxe_macro_StringLiteralKind = $hxEnums["haxe.macro.StringLiteralKind"] = { __ename__ : "haxe.macro.StringLiteralKind", __constructs__ : ["DoubleQuotes","SingleQuotes"] - ,DoubleQuotes: {_hx_index:0,__enum__:"haxe.macro.StringLiteralKind",toString:$estr} - ,SingleQuotes: {_hx_index:1,__enum__:"haxe.macro.StringLiteralKind",toString:$estr} -}; -haxe_macro_StringLiteralKind.__empty_constructs__ = [haxe_macro_StringLiteralKind.DoubleQuotes,haxe_macro_StringLiteralKind.SingleQuotes]; -var haxe_macro_Constant = $hxEnums["haxe.macro.Constant"] = { __ename__ : "haxe.macro.Constant", __constructs__ : ["CInt","CFloat","CString","CIdent","CRegexp"] - ,CInt: ($_=function(v) { return {_hx_index:0,v:v,__enum__:"haxe.macro.Constant",toString:$estr}; },$_.__params__ = ["v"],$_) - ,CFloat: ($_=function(f) { return {_hx_index:1,f:f,__enum__:"haxe.macro.Constant",toString:$estr}; },$_.__params__ = ["f"],$_) - ,CString: ($_=function(s,kind) { return {_hx_index:2,s:s,kind:kind,__enum__:"haxe.macro.Constant",toString:$estr}; },$_.__params__ = ["s","kind"],$_) - ,CIdent: ($_=function(s) { return {_hx_index:3,s:s,__enum__:"haxe.macro.Constant",toString:$estr}; },$_.__params__ = ["s"],$_) - ,CRegexp: ($_=function(r,opt) { return {_hx_index:4,r:r,opt:opt,__enum__:"haxe.macro.Constant",toString:$estr}; },$_.__params__ = ["r","opt"],$_) -}; -haxe_macro_Constant.__empty_constructs__ = []; -var haxe_macro_Binop = $hxEnums["haxe.macro.Binop"] = { __ename__ : "haxe.macro.Binop", __constructs__ : ["OpAdd","OpMult","OpDiv","OpSub","OpAssign","OpEq","OpNotEq","OpGt","OpGte","OpLt","OpLte","OpAnd","OpOr","OpXor","OpBoolAnd","OpBoolOr","OpShl","OpShr","OpUShr","OpMod","OpAssignOp","OpInterval","OpArrow","OpIn"] - ,OpAdd: {_hx_index:0,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpMult: {_hx_index:1,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpDiv: {_hx_index:2,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpSub: {_hx_index:3,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpAssign: {_hx_index:4,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpEq: {_hx_index:5,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpNotEq: {_hx_index:6,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpGt: {_hx_index:7,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpGte: {_hx_index:8,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpLt: {_hx_index:9,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpLte: {_hx_index:10,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpAnd: {_hx_index:11,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpOr: {_hx_index:12,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpXor: {_hx_index:13,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpBoolAnd: {_hx_index:14,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpBoolOr: {_hx_index:15,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpShl: {_hx_index:16,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpShr: {_hx_index:17,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpUShr: {_hx_index:18,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpMod: {_hx_index:19,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpAssignOp: ($_=function(op) { return {_hx_index:20,op:op,__enum__:"haxe.macro.Binop",toString:$estr}; },$_.__params__ = ["op"],$_) - ,OpInterval: {_hx_index:21,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpArrow: {_hx_index:22,__enum__:"haxe.macro.Binop",toString:$estr} - ,OpIn: {_hx_index:23,__enum__:"haxe.macro.Binop",toString:$estr} -}; -haxe_macro_Binop.__empty_constructs__ = [haxe_macro_Binop.OpAdd,haxe_macro_Binop.OpMult,haxe_macro_Binop.OpDiv,haxe_macro_Binop.OpSub,haxe_macro_Binop.OpAssign,haxe_macro_Binop.OpEq,haxe_macro_Binop.OpNotEq,haxe_macro_Binop.OpGt,haxe_macro_Binop.OpGte,haxe_macro_Binop.OpLt,haxe_macro_Binop.OpLte,haxe_macro_Binop.OpAnd,haxe_macro_Binop.OpOr,haxe_macro_Binop.OpXor,haxe_macro_Binop.OpBoolAnd,haxe_macro_Binop.OpBoolOr,haxe_macro_Binop.OpShl,haxe_macro_Binop.OpShr,haxe_macro_Binop.OpUShr,haxe_macro_Binop.OpMod,haxe_macro_Binop.OpInterval,haxe_macro_Binop.OpArrow,haxe_macro_Binop.OpIn]; -var haxe_macro_Unop = $hxEnums["haxe.macro.Unop"] = { __ename__ : "haxe.macro.Unop", __constructs__ : ["OpIncrement","OpDecrement","OpNot","OpNeg","OpNegBits"] - ,OpIncrement: {_hx_index:0,__enum__:"haxe.macro.Unop",toString:$estr} - ,OpDecrement: {_hx_index:1,__enum__:"haxe.macro.Unop",toString:$estr} - ,OpNot: {_hx_index:2,__enum__:"haxe.macro.Unop",toString:$estr} - ,OpNeg: {_hx_index:3,__enum__:"haxe.macro.Unop",toString:$estr} - ,OpNegBits: {_hx_index:4,__enum__:"haxe.macro.Unop",toString:$estr} -}; -haxe_macro_Unop.__empty_constructs__ = [haxe_macro_Unop.OpIncrement,haxe_macro_Unop.OpDecrement,haxe_macro_Unop.OpNot,haxe_macro_Unop.OpNeg,haxe_macro_Unop.OpNegBits]; -var haxe_macro_QuoteStatus = $hxEnums["haxe.macro.QuoteStatus"] = { __ename__ : "haxe.macro.QuoteStatus", __constructs__ : ["Unquoted","Quoted"] - ,Unquoted: {_hx_index:0,__enum__:"haxe.macro.QuoteStatus",toString:$estr} - ,Quoted: {_hx_index:1,__enum__:"haxe.macro.QuoteStatus",toString:$estr} -}; -haxe_macro_QuoteStatus.__empty_constructs__ = [haxe_macro_QuoteStatus.Unquoted,haxe_macro_QuoteStatus.Quoted]; -var haxe_macro_FunctionKind = $hxEnums["haxe.macro.FunctionKind"] = { __ename__ : "haxe.macro.FunctionKind", __constructs__ : ["FAnonymous","FNamed","FArrow"] - ,FAnonymous: {_hx_index:0,__enum__:"haxe.macro.FunctionKind",toString:$estr} - ,FNamed: ($_=function(name,inlined) { return {_hx_index:1,name:name,inlined:inlined,__enum__:"haxe.macro.FunctionKind",toString:$estr}; },$_.__params__ = ["name","inlined"],$_) - ,FArrow: {_hx_index:2,__enum__:"haxe.macro.FunctionKind",toString:$estr} -}; -haxe_macro_FunctionKind.__empty_constructs__ = [haxe_macro_FunctionKind.FAnonymous,haxe_macro_FunctionKind.FArrow]; -var haxe_macro_ExprDef = $hxEnums["haxe.macro.ExprDef"] = { __ename__ : "haxe.macro.ExprDef", __constructs__ : ["EConst","EArray","EBinop","EField","EParenthesis","EObjectDecl","EArrayDecl","ECall","ENew","EUnop","EVars","EFunction","EBlock","EFor","EIf","EWhile","ESwitch","ETry","EReturn","EBreak","EContinue","EUntyped","EThrow","ECast","EDisplay","EDisplayNew","ETernary","ECheckType","EMeta"] - ,EConst: ($_=function(c) { return {_hx_index:0,c:c,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["c"],$_) - ,EArray: ($_=function(e1,e2) { return {_hx_index:1,e1:e1,e2:e2,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["e1","e2"],$_) - ,EBinop: ($_=function(op,e1,e2) { return {_hx_index:2,op:op,e1:e1,e2:e2,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["op","e1","e2"],$_) - ,EField: ($_=function(e,field) { return {_hx_index:3,e:e,field:field,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["e","field"],$_) - ,EParenthesis: ($_=function(e) { return {_hx_index:4,e:e,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["e"],$_) - ,EObjectDecl: ($_=function(fields) { return {_hx_index:5,fields:fields,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["fields"],$_) - ,EArrayDecl: ($_=function(values) { return {_hx_index:6,values:values,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["values"],$_) - ,ECall: ($_=function(e,params) { return {_hx_index:7,e:e,params:params,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["e","params"],$_) - ,ENew: ($_=function(t,params) { return {_hx_index:8,t:t,params:params,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["t","params"],$_) - ,EUnop: ($_=function(op,postFix,e) { return {_hx_index:9,op:op,postFix:postFix,e:e,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["op","postFix","e"],$_) - ,EVars: ($_=function(vars) { return {_hx_index:10,vars:vars,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["vars"],$_) - ,EFunction: ($_=function(kind,f) { return {_hx_index:11,kind:kind,f:f,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["kind","f"],$_) - ,EBlock: ($_=function(exprs) { return {_hx_index:12,exprs:exprs,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["exprs"],$_) - ,EFor: ($_=function(it,expr) { return {_hx_index:13,it:it,expr:expr,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["it","expr"],$_) - ,EIf: ($_=function(econd,eif,eelse) { return {_hx_index:14,econd:econd,eif:eif,eelse:eelse,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["econd","eif","eelse"],$_) - ,EWhile: ($_=function(econd,e,normalWhile) { return {_hx_index:15,econd:econd,e:e,normalWhile:normalWhile,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["econd","e","normalWhile"],$_) - ,ESwitch: ($_=function(e,cases,edef) { return {_hx_index:16,e:e,cases:cases,edef:edef,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["e","cases","edef"],$_) - ,ETry: ($_=function(e,catches) { return {_hx_index:17,e:e,catches:catches,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["e","catches"],$_) - ,EReturn: ($_=function(e) { return {_hx_index:18,e:e,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["e"],$_) - ,EBreak: {_hx_index:19,__enum__:"haxe.macro.ExprDef",toString:$estr} - ,EContinue: {_hx_index:20,__enum__:"haxe.macro.ExprDef",toString:$estr} - ,EUntyped: ($_=function(e) { return {_hx_index:21,e:e,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["e"],$_) - ,EThrow: ($_=function(e) { return {_hx_index:22,e:e,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["e"],$_) - ,ECast: ($_=function(e,t) { return {_hx_index:23,e:e,t:t,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["e","t"],$_) - ,EDisplay: ($_=function(e,displayKind) { return {_hx_index:24,e:e,displayKind:displayKind,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["e","displayKind"],$_) - ,EDisplayNew: ($_=function(t) { return {_hx_index:25,t:t,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["t"],$_) - ,ETernary: ($_=function(econd,eif,eelse) { return {_hx_index:26,econd:econd,eif:eif,eelse:eelse,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["econd","eif","eelse"],$_) - ,ECheckType: ($_=function(e,t) { return {_hx_index:27,e:e,t:t,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["e","t"],$_) - ,EMeta: ($_=function(s,e) { return {_hx_index:28,s:s,e:e,__enum__:"haxe.macro.ExprDef",toString:$estr}; },$_.__params__ = ["s","e"],$_) -}; -haxe_macro_ExprDef.__empty_constructs__ = [haxe_macro_ExprDef.EBreak,haxe_macro_ExprDef.EContinue]; -var haxe_macro_DisplayKind = $hxEnums["haxe.macro.DisplayKind"] = { __ename__ : "haxe.macro.DisplayKind", __constructs__ : ["DKCall","DKDot","DKStructure","DKMarked","DKPattern"] - ,DKCall: {_hx_index:0,__enum__:"haxe.macro.DisplayKind",toString:$estr} - ,DKDot: {_hx_index:1,__enum__:"haxe.macro.DisplayKind",toString:$estr} - ,DKStructure: {_hx_index:2,__enum__:"haxe.macro.DisplayKind",toString:$estr} - ,DKMarked: {_hx_index:3,__enum__:"haxe.macro.DisplayKind",toString:$estr} - ,DKPattern: ($_=function(outermost) { return {_hx_index:4,outermost:outermost,__enum__:"haxe.macro.DisplayKind",toString:$estr}; },$_.__params__ = ["outermost"],$_) -}; -haxe_macro_DisplayKind.__empty_constructs__ = [haxe_macro_DisplayKind.DKCall,haxe_macro_DisplayKind.DKDot,haxe_macro_DisplayKind.DKStructure,haxe_macro_DisplayKind.DKMarked]; -var haxe_macro_ComplexType = $hxEnums["haxe.macro.ComplexType"] = { __ename__ : "haxe.macro.ComplexType", __constructs__ : ["TPath","TFunction","TAnonymous","TParent","TExtend","TOptional","TNamed","TIntersection"] - ,TPath: ($_=function(p) { return {_hx_index:0,p:p,__enum__:"haxe.macro.ComplexType",toString:$estr}; },$_.__params__ = ["p"],$_) - ,TFunction: ($_=function(args,ret) { return {_hx_index:1,args:args,ret:ret,__enum__:"haxe.macro.ComplexType",toString:$estr}; },$_.__params__ = ["args","ret"],$_) - ,TAnonymous: ($_=function(fields) { return {_hx_index:2,fields:fields,__enum__:"haxe.macro.ComplexType",toString:$estr}; },$_.__params__ = ["fields"],$_) - ,TParent: ($_=function(t) { return {_hx_index:3,t:t,__enum__:"haxe.macro.ComplexType",toString:$estr}; },$_.__params__ = ["t"],$_) - ,TExtend: ($_=function(p,fields) { return {_hx_index:4,p:p,fields:fields,__enum__:"haxe.macro.ComplexType",toString:$estr}; },$_.__params__ = ["p","fields"],$_) - ,TOptional: ($_=function(t) { return {_hx_index:5,t:t,__enum__:"haxe.macro.ComplexType",toString:$estr}; },$_.__params__ = ["t"],$_) - ,TNamed: ($_=function(n,t) { return {_hx_index:6,n:n,t:t,__enum__:"haxe.macro.ComplexType",toString:$estr}; },$_.__params__ = ["n","t"],$_) - ,TIntersection: ($_=function(tl) { return {_hx_index:7,tl:tl,__enum__:"haxe.macro.ComplexType",toString:$estr}; },$_.__params__ = ["tl"],$_) -}; -haxe_macro_ComplexType.__empty_constructs__ = []; -var haxe_macro_TypeParam = $hxEnums["haxe.macro.TypeParam"] = { __ename__ : "haxe.macro.TypeParam", __constructs__ : ["TPType","TPExpr"] - ,TPType: ($_=function(t) { return {_hx_index:0,t:t,__enum__:"haxe.macro.TypeParam",toString:$estr}; },$_.__params__ = ["t"],$_) - ,TPExpr: ($_=function(e) { return {_hx_index:1,e:e,__enum__:"haxe.macro.TypeParam",toString:$estr}; },$_.__params__ = ["e"],$_) -}; -haxe_macro_TypeParam.__empty_constructs__ = []; -var haxe_macro_Access = $hxEnums["haxe.macro.Access"] = { __ename__ : "haxe.macro.Access", __constructs__ : ["APublic","APrivate","AStatic","AOverride","ADynamic","AInline","AMacro","AFinal","AExtern"] - ,APublic: {_hx_index:0,__enum__:"haxe.macro.Access",toString:$estr} - ,APrivate: {_hx_index:1,__enum__:"haxe.macro.Access",toString:$estr} - ,AStatic: {_hx_index:2,__enum__:"haxe.macro.Access",toString:$estr} - ,AOverride: {_hx_index:3,__enum__:"haxe.macro.Access",toString:$estr} - ,ADynamic: {_hx_index:4,__enum__:"haxe.macro.Access",toString:$estr} - ,AInline: {_hx_index:5,__enum__:"haxe.macro.Access",toString:$estr} - ,AMacro: {_hx_index:6,__enum__:"haxe.macro.Access",toString:$estr} - ,AFinal: {_hx_index:7,__enum__:"haxe.macro.Access",toString:$estr} - ,AExtern: {_hx_index:8,__enum__:"haxe.macro.Access",toString:$estr} -}; -haxe_macro_Access.__empty_constructs__ = [haxe_macro_Access.APublic,haxe_macro_Access.APrivate,haxe_macro_Access.AStatic,haxe_macro_Access.AOverride,haxe_macro_Access.ADynamic,haxe_macro_Access.AInline,haxe_macro_Access.AMacro,haxe_macro_Access.AFinal,haxe_macro_Access.AExtern]; -var haxe_macro_FieldType = $hxEnums["haxe.macro.FieldType"] = { __ename__ : "haxe.macro.FieldType", __constructs__ : ["FVar","FFun","FProp"] - ,FVar: ($_=function(t,e) { return {_hx_index:0,t:t,e:e,__enum__:"haxe.macro.FieldType",toString:$estr}; },$_.__params__ = ["t","e"],$_) - ,FFun: ($_=function(f) { return {_hx_index:1,f:f,__enum__:"haxe.macro.FieldType",toString:$estr}; },$_.__params__ = ["f"],$_) - ,FProp: ($_=function(get,set,t,e) { return {_hx_index:2,get:get,set:set,t:t,e:e,__enum__:"haxe.macro.FieldType",toString:$estr}; },$_.__params__ = ["get","set","t","e"],$_) -}; -haxe_macro_FieldType.__empty_constructs__ = []; -var haxe_macro_TypeDefKind = $hxEnums["haxe.macro.TypeDefKind"] = { __ename__ : "haxe.macro.TypeDefKind", __constructs__ : ["TDEnum","TDStructure","TDClass","TDAlias","TDAbstract"] - ,TDEnum: {_hx_index:0,__enum__:"haxe.macro.TypeDefKind",toString:$estr} - ,TDStructure: {_hx_index:1,__enum__:"haxe.macro.TypeDefKind",toString:$estr} - ,TDClass: ($_=function(superClass,interfaces,isInterface,isFinal) { return {_hx_index:2,superClass:superClass,interfaces:interfaces,isInterface:isInterface,isFinal:isFinal,__enum__:"haxe.macro.TypeDefKind",toString:$estr}; },$_.__params__ = ["superClass","interfaces","isInterface","isFinal"],$_) - ,TDAlias: ($_=function(t) { return {_hx_index:3,t:t,__enum__:"haxe.macro.TypeDefKind",toString:$estr}; },$_.__params__ = ["t"],$_) - ,TDAbstract: ($_=function(tthis,from,to) { return {_hx_index:4,tthis:tthis,from:from,to:to,__enum__:"haxe.macro.TypeDefKind",toString:$estr}; },$_.__params__ = ["tthis","from","to"],$_) -}; -haxe_macro_TypeDefKind.__empty_constructs__ = [haxe_macro_TypeDefKind.TDEnum,haxe_macro_TypeDefKind.TDStructure]; -var haxe_macro_Error = function(m,p) { - this.message = m; - this.pos = p; -}; -$hxClasses["haxe.macro.Error"] = haxe_macro_Error; -haxe_macro_Error.__name__ = "haxe.macro.Error"; -haxe_macro_Error.prototype = { - message: null - ,pos: null - ,toString: function() { - return this.message; - } - ,__class__: haxe_macro_Error -}; -var haxe_macro_ImportMode = $hxEnums["haxe.macro.ImportMode"] = { __ename__ : "haxe.macro.ImportMode", __constructs__ : ["INormal","IAsName","IAll"] - ,INormal: {_hx_index:0,__enum__:"haxe.macro.ImportMode",toString:$estr} - ,IAsName: ($_=function(alias) { return {_hx_index:1,alias:alias,__enum__:"haxe.macro.ImportMode",toString:$estr}; },$_.__params__ = ["alias"],$_) - ,IAll: {_hx_index:2,__enum__:"haxe.macro.ImportMode",toString:$estr} -}; -haxe_macro_ImportMode.__empty_constructs__ = [haxe_macro_ImportMode.INormal,haxe_macro_ImportMode.IAll]; -var haxe_macro_ExprTools = function() { }; -$hxClasses["haxe.macro.ExprTools"] = haxe_macro_ExprTools; -haxe_macro_ExprTools.__name__ = "haxe.macro.ExprTools"; -haxe_macro_ExprTools.toString = function(e) { - return new haxe_macro_Printer().printExpr(e); -}; -haxe_macro_ExprTools.iter = function(e,f) { - var _g = e.expr; - switch(_g._hx_index) { - case 0: - var _g48 = _g.c; - break; - case 1: - var e2 = _g.e2; - var e1 = _g.e1; - f(e1); - f(e2); - break; - case 2: - var _g42 = _g.op; - var e21 = _g.e2; - var e11 = _g.e1; - f(e11); - f(e21); - break; - case 3: - var _g38 = _g.field; - var e3 = _g.e; - f(e3); - break; - case 4: - var e4 = _g.e; - f(e4); - break; - case 5: - var fl = _g.fields; - var _g1 = 0; - while(_g1 < fl.length) { - var fd = fl[_g1]; - ++_g1; - f(fd.expr); - } - break; - case 6: - var el = _g.values; - haxe_macro_ExprArrayTools.iter(el,f); - break; - case 7: - var el1 = _g.params; - var e5 = _g.e; - f(e5); - haxe_macro_ExprArrayTools.iter(el1,f); - break; - case 8: - var _g16 = _g.t; - var el2 = _g.params; - haxe_macro_ExprArrayTools.iter(el2,f); - break; - case 9: - var _g21 = _g.postFix; - var _g20 = _g.op; - var e6 = _g.e; - f(e6); - break; - case 10: - var vl = _g.vars; - var _g2 = 0; - while(_g2 < vl.length) { - var v = vl[_g2]; - ++_g2; - var e7 = v.expr; - if(e7 != null) { - f(e7); - } - } - break; - case 11: - var _g24 = _g.kind; - var func = _g.f; - var _g3 = 0; - var _g11 = func.args; - while(_g3 < _g11.length) { - var arg = _g11[_g3]; - ++_g3; - var e8 = arg.value; - if(e8 != null) { - f(e8); - } - } - var e9 = func.expr; - if(e9 != null) { - f(e9); - } - break; - case 12: - var el3 = _g.exprs; - haxe_macro_ExprArrayTools.iter(el3,f); - break; - case 13: - var e22 = _g.expr; - var e12 = _g.it; - f(e12); - f(e22); - break; - case 14: - var e31 = _g.eelse; - var e23 = _g.eif; - var e13 = _g.econd; - f(e13); - f(e23); - if(e31 != null) { - f(e31); - } - break; - case 15: - var _g34 = _g.normalWhile; - var e24 = _g.e; - var e14 = _g.econd; - f(e14); - f(e24); - break; - case 16: - var edef = _g.edef; - var cl = _g.cases; - var e10 = _g.e; - f(e10); - var _g4 = 0; - while(_g4 < cl.length) { - var c = cl[_g4]; - ++_g4; - haxe_macro_ExprArrayTools.iter(c.values,f); - var e15 = c.guard; - if(e15 != null) { - f(e15); - } - var e16 = c.expr; - if(e16 != null) { - f(e16); - } - } - if(edef != null && edef.expr != null) { - f(edef); - } - break; - case 17: - var cl1 = _g.catches; - var e17 = _g.e; - f(e17); - var _g5 = 0; - while(_g5 < cl1.length) { - var c1 = cl1[_g5]; - ++_g5; - f(c1.expr); - } - break; - case 18: - var e18 = _g.e; - if(e18 != null) { - f(e18); - } - break; - case 19:case 20: - break; - case 21: - var e19 = _g.e; - f(e19); - break; - case 22: - var e20 = _g.e; - f(e20); - break; - case 23: - var _g22 = _g.t; - var e25 = _g.e; - f(e25); - break; - case 24: - var _g41 = _g.displayKind; - var e26 = _g.e; - f(e26); - break; - case 25: - var _g49 = _g.t; - break; - case 26: - var e32 = _g.eelse; - var e27 = _g.eif; - var e110 = _g.econd; - f(e110); - f(e27); - if(e32 != null) { - f(e32); - } - break; - case 27: - var _g19 = _g.t; - var e28 = _g.e; - f(e28); - break; - case 28: - var _g9 = _g.s; - var e29 = _g.e; - f(e29); - break; - } -}; -haxe_macro_ExprTools.map = function(e,f) { - var e1 = e.pos; - var _g = e.expr; - var tmp; - switch(_g._hx_index) { - case 0: - var _g48 = _g.c; - tmp = e.expr; - break; - case 1: - var e2 = _g.e2; - var e11 = _g.e1; - tmp = haxe_macro_ExprDef.EArray(f(e11),f(e2)); - break; - case 2: - var e21 = _g.e2; - var e12 = _g.e1; - var op = _g.op; - tmp = haxe_macro_ExprDef.EBinop(op,f(e12),f(e21)); - break; - case 3: - var field = _g.field; - var e3 = _g.e; - tmp = haxe_macro_ExprDef.EField(f(e3),field); - break; - case 4: - var e4 = _g.e; - tmp = haxe_macro_ExprDef.EParenthesis(f(e4)); - break; - case 5: - var fields = _g.fields; - var ret = []; - var _g1 = 0; - while(_g1 < fields.length) { - var field1 = fields[_g1]; - ++_g1; - ret.push({ field : field1.field, expr : f(field1.expr), quotes : field1.quotes}); - } - tmp = haxe_macro_ExprDef.EObjectDecl(ret); - break; - case 6: - var el = _g.values; - tmp = haxe_macro_ExprDef.EArrayDecl(haxe_macro_ExprArrayTools.map(el,f)); - break; - case 7: - var params = _g.params; - var e5 = _g.e; - tmp = haxe_macro_ExprDef.ECall(f(e5),haxe_macro_ExprArrayTools.map(params,f)); - break; - case 8: - var params1 = _g.params; - var tp = _g.t; - tmp = haxe_macro_ExprDef.ENew(tp,haxe_macro_ExprArrayTools.map(params1,f)); - break; - case 9: - var e6 = _g.e; - var postFix = _g.postFix; - var op1 = _g.op; - tmp = haxe_macro_ExprDef.EUnop(op1,postFix,f(e6)); - break; - case 10: - var vars = _g.vars; - var ret1 = []; - var _g2 = 0; - while(_g2 < vars.length) { - var v = vars[_g2]; - ++_g2; - var e7 = v.expr; - var v2 = { name : v.name, type : v.type, expr : e7 == null ? null : f(e7)}; - if(v.isFinal != null) { - v2.isFinal = v.isFinal; - } - ret1.push(v2); - } - tmp = haxe_macro_ExprDef.EVars(ret1); - break; - case 11: - var func = _g.f; - var kind = _g.kind; - var ret2 = []; - var _g3 = 0; - var _g11 = func.args; - while(_g3 < _g11.length) { - var arg = _g11[_g3]; - ++_g3; - var e8 = arg.value; - ret2.push({ name : arg.name, opt : arg.opt, type : arg.type, value : e8 == null ? null : f(e8)}); - } - tmp = haxe_macro_ExprDef.EFunction(kind,{ args : ret2, ret : func.ret, params : func.params, expr : f(func.expr)}); - break; - case 12: - var el1 = _g.exprs; - tmp = haxe_macro_ExprDef.EBlock(haxe_macro_ExprArrayTools.map(el1,f)); - break; - case 13: - var expr = _g.expr; - var it = _g.it; - tmp = haxe_macro_ExprDef.EFor(f(it),f(expr)); - break; - case 14: - var eelse = _g.eelse; - var eif = _g.eif; - var econd = _g.econd; - tmp = haxe_macro_ExprDef.EIf(f(econd),f(eif),eelse == null ? null : f(eelse)); - break; - case 15: - var normalWhile = _g.normalWhile; - var e9 = _g.e; - var econd1 = _g.econd; - tmp = haxe_macro_ExprDef.EWhile(f(econd1),f(e9),normalWhile); - break; - case 16: - var edef = _g.edef; - var cases = _g.cases; - var e10 = _g.e; - var ret3 = []; - var _g4 = 0; - while(_g4 < cases.length) { - var c = cases[_g4]; - ++_g4; - var e13 = c.expr; - var tmp1 = e13 == null ? null : f(e13); - var e14 = c.guard; - ret3.push({ expr : tmp1, guard : e14 == null ? null : f(e14), values : haxe_macro_ExprArrayTools.map(c.values,f)}); - } - tmp = haxe_macro_ExprDef.ESwitch(f(e10),ret3,edef == null || edef.expr == null ? edef : f(edef)); - break; - case 17: - var catches = _g.catches; - var e15 = _g.e; - var ret4 = []; - var _g5 = 0; - while(_g5 < catches.length) { - var c1 = catches[_g5]; - ++_g5; - ret4.push({ name : c1.name, type : c1.type, expr : f(c1.expr)}); - } - tmp = haxe_macro_ExprDef.ETry(f(e15),ret4); - break; - case 18: - var e16 = _g.e; - tmp = haxe_macro_ExprDef.EReturn(e16 == null ? null : f(e16)); - break; - case 19:case 20: - tmp = e.expr; - break; - case 21: - var e17 = _g.e; - tmp = haxe_macro_ExprDef.EUntyped(f(e17)); - break; - case 22: - var e18 = _g.e; - tmp = haxe_macro_ExprDef.EThrow(f(e18)); - break; - case 23: - var t = _g.t; - var e19 = _g.e; - tmp = haxe_macro_ExprDef.ECast(f(e19),t); - break; - case 24: - var dk = _g.displayKind; - var e20 = _g.e; - tmp = haxe_macro_ExprDef.EDisplay(f(e20),dk); - break; - case 25: - var _g50 = _g.t; - tmp = e.expr; - break; - case 26: - var eelse1 = _g.eelse; - var eif1 = _g.eif; - var econd2 = _g.econd; - tmp = haxe_macro_ExprDef.ETernary(f(econd2),f(eif1),f(eelse1)); - break; - case 27: - var t1 = _g.t; - var e22 = _g.e; - tmp = haxe_macro_ExprDef.ECheckType(f(e22),t1); - break; - case 28: - var e23 = _g.e; - var m = _g.s; - tmp = haxe_macro_ExprDef.EMeta(m,f(e23)); - break; - } - return { pos : e1, expr : tmp}; -}; -haxe_macro_ExprTools.getValue = function(e) { - var _g = e.expr; - switch(_g._hx_index) { - case 0: - var _g19 = _g.c; - switch(_g19._hx_index) { - case 0: - var v = _g19.v; - return Std.parseInt(v); - case 1: - var v1 = _g19.f; - return parseFloat(v1); - case 2: - var _g24 = _g19.kind; - var s = _g19.s; - return s; - case 3: - switch(_g19.s) { - case "false": - return false; - case "null": - return null; - case "true": - return true; - default: - throw new js__$Boot_HaxeError("Unsupported expression: " + Std.string(e)); - } - break; - default: - throw new js__$Boot_HaxeError("Unsupported expression: " + Std.string(e)); - } - break; - case 2: - var e2 = _g.e2; - var e1 = _g.e1; - var op = _g.op; - var e11 = haxe_macro_ExprTools.getValue(e1); - var e21 = haxe_macro_ExprTools.getValue(e2); - switch(op._hx_index) { - case 0: - return e11 + e21; - case 1: - return e11 * e21; - case 2: - return e11 / e21; - case 3: - return e11 - e21; - case 5: - return e11 == e21; - case 6: - return e11 != e21; - case 7: - return e11 > e21; - case 8: - return e11 >= e21; - case 9: - return e11 < e21; - case 10: - return e11 <= e21; - case 11: - return e11 & e21; - case 12: - return e11 | e21; - case 13: - return e11 ^ e21; - case 14: - if(e11) { - return e21; - } else { - return false; - } - break; - case 15: - if(!e11) { - return e21; - } else { - return true; - } - break; - case 16: - return e11 << e21; - case 17: - return e11 >> e21; - case 18: - return e11 >>> e21; - case 19: - return e11 % e21; - default: - throw new js__$Boot_HaxeError("Unsupported expression: " + Std.string(e)); - } - break; - case 4: - var e12 = _g.e; - return haxe_macro_ExprTools.getValue(e12); - case 5: - var fields = _g.fields; - var obj = { }; - var _g1 = 0; - while(_g1 < fields.length) { - var field = fields[_g1]; - ++_g1; - obj[field.field] = haxe_macro_ExprTools.getValue(field.expr); - } - return obj; - case 6: - var el = _g.values; - var f = haxe_macro_ExprTools.getValue; - var result = new Array(el.length); - var _g2 = 0; - var _g11 = el.length; - while(_g2 < _g11) { - var i = _g2++; - result[i] = f(el[i]); - } - return result; - case 9: - if(_g.postFix == false) { - var e13 = _g.e; - var op1 = _g.op; - var e14 = haxe_macro_ExprTools.getValue(e13); - switch(op1._hx_index) { - case 2: - return !e14; - case 3: - return -e14; - case 4: - return ~e14; - default: - throw new js__$Boot_HaxeError("Unsupported expression: " + Std.string(e)); - } - } else { - throw new js__$Boot_HaxeError("Unsupported expression: " + Std.string(e)); - } - break; - case 14: - var eelse = _g.eelse; - var eif = _g.eif; - var econd = _g.econd; - if(eelse == null) { - throw new js__$Boot_HaxeError("If statements only have a value if the else clause is defined"); - } else { - var econd1 = haxe_macro_ExprTools.getValue(econd); - if(econd1) { - return haxe_macro_ExprTools.getValue(eif); - } else { - return haxe_macro_ExprTools.getValue(eelse); - } - } - break; - case 21: - var e15 = _g.e; - return haxe_macro_ExprTools.getValue(e15); - case 26: - var eelse1 = _g.eelse; - var eif1 = _g.eif; - var econd2 = _g.econd; - if(eelse1 == null) { - throw new js__$Boot_HaxeError("If statements only have a value if the else clause is defined"); - } else { - var econd3 = haxe_macro_ExprTools.getValue(econd2); - if(econd3) { - return haxe_macro_ExprTools.getValue(eif1); - } else { - return haxe_macro_ExprTools.getValue(eelse1); - } - } - break; - case 28: - var _g4 = _g.s; - var e16 = _g.e; - return haxe_macro_ExprTools.getValue(e16); - default: - throw new js__$Boot_HaxeError("Unsupported expression: " + Std.string(e)); - } -}; -haxe_macro_ExprTools.opt = function(e,f) { - if(e == null) { - return null; - } else { - return f(e); - } -}; -haxe_macro_ExprTools.opt2 = function(e,f) { - if(e != null) { - f(e); - } -}; -var haxe_macro_ExprArrayTools = function() { }; -$hxClasses["haxe.macro.ExprArrayTools"] = haxe_macro_ExprArrayTools; -haxe_macro_ExprArrayTools.__name__ = "haxe.macro.ExprArrayTools"; -haxe_macro_ExprArrayTools.map = function(el,f) { - var ret = []; - var _g = 0; - while(_g < el.length) { - var e = el[_g]; - ++_g; - ret.push(f(e)); - } - return ret; -}; -haxe_macro_ExprArrayTools.iter = function(el,f) { - var _g = 0; - while(_g < el.length) { - var e = el[_g]; - ++_g; - f(e); - } -}; -var haxe_macro_MacroStringTools = function() { }; -$hxClasses["haxe.macro.MacroStringTools"] = haxe_macro_MacroStringTools; -haxe_macro_MacroStringTools.__name__ = "haxe.macro.MacroStringTools"; -haxe_macro_MacroStringTools.toFieldExpr = function(sl,pos) { - if(pos == null) { - return Lambda.fold(sl,function(s,e) { - if(e == null) { - return { expr : haxe_macro_ExprDef.EConst(haxe_macro_Constant.CIdent(s)), pos : { file : "Z:\\software\\Haxe_toolkit_405\\haxe\\std/haxe/macro/MacroStringTools.hx", min : 2798, max : 2801}}; - } else { - return { expr : haxe_macro_ExprDef.EField(e,s), pos : { file : "Z:\\software\\Haxe_toolkit_405\\haxe\\std/haxe/macro/MacroStringTools.hx", min : 2812, max : 2817}}; - } - },null); - } - var e1 = null; - var _g = 0; - while(_g < sl.length) { - var v = sl[_g]; - ++_g; - if(e1 == null) { - e1 = { expr : haxe_macro_ExprDef.EConst(haxe_macro_Constant.CIdent(v)), pos : pos}; - } else { - e1 = { expr : haxe_macro_ExprDef.EField(e1,v), pos : pos}; - } - } - return e1; -}; -haxe_macro_MacroStringTools.toDotPath = function(pack,name) { - if(pack.length == 0) { - return name; - } else { - return pack.join(".") + "." + name; - } -}; -haxe_macro_MacroStringTools.toComplex = function(path) { - var pack = path.split("."); - return haxe_macro_ComplexType.TPath({ pack : pack, name : pack.pop(), params : []}); -}; -var haxe_macro_PositionTools = function() { }; -$hxClasses["haxe.macro.PositionTools"] = haxe_macro_PositionTools; -haxe_macro_PositionTools.__name__ = "haxe.macro.PositionTools"; -haxe_macro_PositionTools.getInfos = function(p) { - return p; -}; -haxe_macro_PositionTools.make = function(inf) { - return inf; -}; -var haxe_macro_Printer = function(tabString) { - if(tabString == null) { - tabString = "\t"; - } - this.tabs = ""; - this.tabString = tabString; -}; -$hxClasses["haxe.macro.Printer"] = haxe_macro_Printer; -haxe_macro_Printer.__name__ = "haxe.macro.Printer"; -haxe_macro_Printer.prototype = { - tabs: null - ,tabString: null - ,printUnop: function(op) { - switch(op._hx_index) { - case 0: - return "++"; - case 1: - return "--"; - case 2: - return "!"; - case 3: - return "-"; - case 4: - return "~"; - } - } - ,printBinop: function(op) { - switch(op._hx_index) { - case 0: - return "+"; - case 1: - return "*"; - case 2: - return "/"; - case 3: - return "-"; - case 4: - return "="; - case 5: - return "=="; - case 6: - return "!="; - case 7: - return ">"; - case 8: - return ">="; - case 9: - return "<"; - case 10: - return "<="; - case 11: - return "&"; - case 12: - return "|"; - case 13: - return "^"; - case 14: - return "&&"; - case 15: - return "||"; - case 16: - return "<<"; - case 17: - return ">>"; - case 18: - return ">>>"; - case 19: - return "%"; - case 20: - var op1 = op.op; - return this.printBinop(op1) + "="; - case 21: - return "..."; - case 22: - return "=>"; - case 23: - return "in"; - } - } - ,escapeString: function(s,delim) { - return delim + StringTools.replace(StringTools.replace(StringTools.replace(StringTools.replace(StringTools.replace(s,"\n","\\n"),"\t","\\t"),"\r","\\r"),"'","\\'"),"\"","\\\"") + delim; - } - ,printFormatString: function(s) { - return this.escapeString(s,"'"); - } - ,printString: function(s) { - return this.escapeString(s,"\""); - } - ,printConstant: function(c) { - switch(c._hx_index) { - case 0: - var s = c.v; - return s; - case 1: - var s1 = c.f; - return s1; - case 2: - var _g6 = c.kind; - var s2 = c.s; - return this.printString(s2); - case 3: - var s3 = c.s; - return s3; - case 4: - var opt = c.opt; - var s4 = c.r; - return "~/" + s4 + "/" + opt; - } - } - ,printTypeParam: function(param) { - switch(param._hx_index) { - case 0: - var ct = param.t; - return this.printComplexType(ct); - case 1: - var e = param.e; - return this.printExpr(e); - } - } - ,printTypePath: function(tp) { - var tmp = (tp.pack.length > 0 ? tp.pack.join(".") + "." : "") + tp.name + (tp.sub != null ? "." + tp.sub : ""); - var tmp1; - if(tp.params == null) { - tmp1 = ""; - } else if(tp.params.length > 0) { - var _this = tp.params; - var f = $bind(this,this.printTypeParam); - var result = new Array(_this.length); - var _g = 0; - var _g1 = _this.length; - while(_g < _g1) { - var i = _g++; - result[i] = f(_this[i]); - } - tmp1 = "<" + result.join(", ") + ">"; - } else { - tmp1 = ""; - } - return tmp + tmp1; - } - ,printComplexType: function(ct) { - switch(ct._hx_index) { - case 0: - var tp = ct.p; - return this.printTypePath(tp); - case 1: - var ret = ct.ret; - var args = ct.args; - var tmp; - if(args.length == 1) { - var tmp1; - var _g = args[0]; - var tmp2; - if(_g._hx_index == 6) { - var _g2 = _g.t; - var _g1 = _g.n; - tmp2 = true; - } else { - tmp2 = false; - } - if(!tmp2) { - var _g3 = args[0]; - if(_g3._hx_index == 1) { - var _g5 = _g3.ret; - var _g4 = _g3.args; - tmp1 = true; - } else { - tmp1 = false; - } - } else { - tmp1 = true; - } - tmp = !tmp1; - } else { - tmp = false; - } - if(tmp) { - return this.printComplexType(args[0]) + " -> " + this.printComplexType(ret); - } else { - var f = $bind(this,this.printComplexType); - var result = new Array(args.length); - var _g6 = 0; - var _g11 = args.length; - while(_g6 < _g11) { - var i = _g6++; - result[i] = f(args[i]); - } - return "(" + result.join(", ") + ")" + " -> " + this.printComplexType(ret); - } - break; - case 2: - var fields = ct.fields; - var _g7 = []; - var _g12 = 0; - while(_g12 < fields.length) { - var f1 = fields[_g12]; - ++_g12; - _g7.push(this.printField(f1) + "; "); - } - return "{ " + _g7.join("") + "}"; - case 3: - var ct1 = ct.t; - return "(" + this.printComplexType(ct1) + ")"; - case 4: - var fields1 = ct.fields; - var tpl = ct.p; - var f2 = $bind(this,this.printTypePath); - var result1 = new Array(tpl.length); - var _g8 = 0; - var _g13 = tpl.length; - while(_g8 < _g13) { - var i1 = _g8++; - result1[i1] = f2(tpl[i1]); - } - var tmp3 = "{> " + result1.join(" >, ") + ", "; - var f3 = $bind(this,this.printField); - var result2 = new Array(fields1.length); - var _g9 = 0; - var _g14 = fields1.length; - while(_g9 < _g14) { - var i2 = _g9++; - result2[i2] = f3(fields1[i2]); - } - return tmp3 + result2.join(", ") + " }"; - case 5: - var ct2 = ct.t; - return "?" + this.printComplexType(ct2); - case 6: - var ct3 = ct.t; - var n = ct.n; - return n + ":" + this.printComplexType(ct3); - case 7: - var tl = ct.tl; - var f4 = $bind(this,this.printComplexType); - var result3 = new Array(tl.length); - var _g10 = 0; - var _g15 = tl.length; - while(_g10 < _g15) { - var i3 = _g10++; - result3[i3] = f4(tl[i3]); - } - return result3.join(" & "); - } - } - ,printMetadata: function(meta) { - return "@" + meta.name + (meta.params != null && meta.params.length > 0 ? "(" + this.printExprs(meta.params,", ") + ")" : ""); - } - ,printAccess: function(access) { - switch(access._hx_index) { - case 0: - return "public"; - case 1: - return "private"; - case 2: - return "static"; - case 3: - return "override"; - case 4: - return "dynamic"; - case 5: - return "inline"; - case 6: - return "macro"; - case 7: - return "final"; - case 8: - return "extern"; - } - } - ,printField: function(field) { - var tmp = field.doc != null && field.doc != "" ? "/**\n" + this.tabs + this.tabString + StringTools.replace(field.doc,"\n","\n" + this.tabs + this.tabString) + "\n" + this.tabs + "**/\n" + this.tabs : ""; - var tmp1; - if(field.meta != null && field.meta.length > 0) { - var _this = field.meta; - var f = $bind(this,this.printMetadata); - var result = new Array(_this.length); - var _g = 0; - var _g1 = _this.length; - while(_g < _g1) { - var i = _g++; - result[i] = f(_this[i]); - } - tmp1 = result.join("\n" + this.tabs) + ("\n" + this.tabs); - } else { - tmp1 = ""; - } - var tmp2 = tmp + tmp1; - var tmp3; - if(field.access != null && field.access.length > 0) { - var _this1 = field.access; - var f1 = $bind(this,this.printAccess); - var result1 = new Array(_this1.length); - var _g2 = 0; - var _g11 = _this1.length; - while(_g2 < _g11) { - var i1 = _g2++; - result1[i1] = f1(_this1[i1]); - } - tmp3 = result1.join(" ") + " "; - } else { - tmp3 = ""; - } - var tmp4 = tmp2 + tmp3; - var _g3 = field.kind; - var tmp5; - switch(_g3._hx_index) { - case 0: - var eo = _g3.e; - var t = _g3.t; - tmp5 = (field.access != null && Lambda.has(field.access,haxe_macro_Access.AFinal) ? "" : "var ") + ("" + field.name) + this.opt(t,$bind(this,this.printComplexType)," : ") + this.opt(eo,$bind(this,this.printExpr)," = "); - break; - case 1: - var func = _g3.f; - tmp5 = "function " + field.name + this.printFunction(func); - break; - case 2: - var eo1 = _g3.e; - var t1 = _g3.t; - var set = _g3.set; - var get = _g3.get; - tmp5 = "var " + field.name + "(" + get + ", " + set + ")" + this.opt(t1,$bind(this,this.printComplexType)," : ") + this.opt(eo1,$bind(this,this.printExpr)," = "); - break; - } - return tmp4 + tmp5; - } - ,printTypeParamDecl: function(tpd) { - var tpd1 = tpd.name; - var tmp; - if(tpd.params != null && tpd.params.length > 0) { - var _this = tpd.params; - var f = $bind(this,this.printTypeParamDecl); - var result = new Array(_this.length); - var _g = 0; - var _g1 = _this.length; - while(_g < _g1) { - var i = _g++; - result[i] = f(_this[i]); - } - tmp = "<" + result.join(", ") + ">"; - } else { - tmp = ""; - } - var tmp1 = tpd1 + tmp; - var tmp2; - if(tpd.constraints != null && tpd.constraints.length > 0) { - var _this1 = tpd.constraints; - var f1 = $bind(this,this.printComplexType); - var result1 = new Array(_this1.length); - var _g2 = 0; - var _g11 = _this1.length; - while(_g2 < _g11) { - var i1 = _g2++; - result1[i1] = f1(_this1[i1]); - } - tmp2 = ":(" + result1.join(", ") + ")"; - } else { - tmp2 = ""; - } - return tmp1 + tmp2; - } - ,printFunctionArg: function(arg) { - return (arg.opt ? "?" : "") + arg.name + this.opt(arg.type,$bind(this,this.printComplexType),":") + this.opt(arg.value,$bind(this,this.printExpr)," = "); - } - ,printFunction: function(func) { - var tmp; - if(func.params == null) { - tmp = ""; - } else if(func.params.length > 0) { - var _this = func.params; - var f = $bind(this,this.printTypeParamDecl); - var result = new Array(_this.length); - var _g = 0; - var _g1 = _this.length; - while(_g < _g1) { - var i = _g++; - result[i] = f(_this[i]); - } - tmp = "<" + result.join(", ") + ">"; - } else { - tmp = ""; - } - var tmp1 = tmp + "("; - var _this1 = func.args; - var f1 = $bind(this,this.printFunctionArg); - var result1 = new Array(_this1.length); - var _g2 = 0; - var _g11 = _this1.length; - while(_g2 < _g11) { - var i1 = _g2++; - result1[i1] = f1(_this1[i1]); - } - return tmp1 + result1.join(", ") + ")" + this.opt(func.ret,$bind(this,this.printComplexType),":") + this.opt(func.expr,$bind(this,this.printExpr)," "); - } - ,printVar: function(v) { - return v.name + this.opt(v.type,$bind(this,this.printComplexType),":") + this.opt(v.expr,$bind(this,this.printExpr)," = "); - } - ,printObjectFieldKey: function(of) { - var _g = of.quotes; - if(_g == null) { - return of.field; - } else { - switch(_g._hx_index) { - case 0: - return of.field; - case 1: - return "\"" + of.field + "\""; - } - } - } - ,printObjectField: function(of) { - return "" + this.printObjectFieldKey(of) + " : " + this.printExpr(of.expr); - } - ,printExpr: function(e) { - var _gthis = this; - if(e == null) { - return "#NULL"; - } else { - var _g = e.expr; - switch(_g._hx_index) { - case 0: - var c = _g.c; - return this.printConstant(c); - case 1: - var e2 = _g.e2; - var e1 = _g.e1; - return "" + this.printExpr(e1) + "[" + this.printExpr(e2) + "]"; - case 2: - var e21 = _g.e2; - var e11 = _g.e1; - var op = _g.op; - return "" + this.printExpr(e11) + " " + this.printBinop(op) + " " + this.printExpr(e21); - case 3: - var n = _g.field; - var e12 = _g.e; - return "" + this.printExpr(e12) + "." + n; - case 4: - var e13 = _g.e; - return "(" + this.printExpr(e13) + ")"; - case 5: - var fl = _g.fields; - var result = new Array(fl.length); - var _g1 = 0; - var _g11 = fl.length; - while(_g1 < _g11) { - var i = _g1++; - result[i] = _gthis.printObjectField(fl[i]); - } - return "{ " + result.join(", ") + " }"; - case 6: - var el = _g.values; - return "[" + this.printExprs(el,", ") + "]"; - case 7: - var el1 = _g.params; - var e14 = _g.e; - return "" + this.printExpr(e14) + "(" + this.printExprs(el1,", ") + ")"; - case 8: - var el2 = _g.params; - var tp = _g.t; - return "new " + this.printTypePath(tp) + "(" + this.printExprs(el2,", ") + ")"; - case 9: - var _g20 = _g.e; - var _g18 = _g.op; - if(_g.postFix) { - var e15 = _g20; - var op1 = _g18; - return this.printExpr(e15) + this.printUnop(op1); - } else { - var e16 = _g20; - var op2 = _g18; - return this.printUnop(op2) + this.printExpr(e16); - } - break; - case 10: - var vl = _g.vars; - var f = $bind(this,this.printVar); - var result1 = new Array(vl.length); - var _g2 = 0; - var _g12 = vl.length; - while(_g2 < _g12) { - var i1 = _g2++; - result1[i1] = f(vl[i1]); - } - return "var " + result1.join(", "); - case 11: - var _g22 = _g.f; - var _g21 = _g.kind; - if(_g21 == null) { - var func = _g22; - return "function" + this.printFunction(func); - } else if(_g21._hx_index == 1) { - var func1 = _g22; - var inlined = _g21.inlined; - var no = _g21.name; - return (inlined ? "inline " : "") + ("function " + no) + this.printFunction(func1); - } else { - var func2 = _g22; - return "function" + this.printFunction(func2); - } - break; - case 12: - var _g25 = _g.exprs; - if(_g25.length == 0) { - return "{ }"; - } else { - var el3 = _g25; - var old = this.tabs; - this.tabs += this.tabString; - var s = "{\n" + this.tabs + this.printExprs(el3,";\n" + this.tabs); - this.tabs = old; - return s + (";\n" + this.tabs + "}"); - } - break; - case 13: - var e22 = _g.expr; - var e17 = _g.it; - return "for (" + this.printExpr(e17) + ") " + this.printExpr(e22); - case 14: - var _g13 = _g.eelse; - var _g121 = _g.eif; - var _g111 = _g.econd; - if(_g13 == null) { - var econd = _g111; - var eif = _g121; - return "if (" + this.printExpr(econd) + ") " + this.printExpr(eif); - } else { - var econd1 = _g111; - var eif1 = _g121; - var eelse = _g13; - return "if (" + this.printExpr(econd1) + ") " + this.printExpr(eif1) + " else " + this.printExpr(eelse); - } - break; - case 15: - var _g35 = _g.e; - var _g34 = _g.econd; - if(_g.normalWhile) { - var econd2 = _g34; - var e18 = _g35; - return "while (" + this.printExpr(econd2) + ") " + this.printExpr(e18); - } else { - var econd3 = _g34; - var e19 = _g35; - return "do " + this.printExpr(e19) + " while (" + this.printExpr(econd3) + ")"; - } - break; - case 16: - var edef = _g.edef; - var cl = _g.cases; - var e110 = _g.e; - var old1 = this.tabs; - this.tabs += this.tabString; - var s1 = "switch " + this.printExpr(e110) + " {\n" + this.tabs; - var result2 = new Array(cl.length); - var _g3 = 0; - var _g14 = cl.length; - while(_g3 < _g14) { - var i2 = _g3++; - var c1 = cl[i2]; - result2[i2] = "case " + _gthis.printExprs(c1.values,", ") + (c1.guard != null ? " if (" + _gthis.printExpr(c1.guard) + "):" : ":") + (c1.expr != null ? _gthis.opt(c1.expr,$bind(_gthis,_gthis.printExpr)) + ";" : ""); - } - var s2 = s1 + result2.join("\n" + this.tabs); - if(edef != null) { - s2 += "\n" + this.tabs + "default:" + (edef.expr == null ? "" : this.printExpr(edef) + ";"); - } - this.tabs = old1; - return s2 + ("\n" + this.tabs + "}"); - case 17: - var cl1 = _g.catches; - var e111 = _g.e; - var tmp = "try " + this.printExpr(e111); - var result3 = new Array(cl1.length); - var _g4 = 0; - var _g15 = cl1.length; - while(_g4 < _g15) { - var i3 = _g4++; - var c2 = cl1[i3]; - result3[i3] = " catch(" + c2.name + ":" + _gthis.printComplexType(c2.type) + ") " + _gthis.printExpr(c2.expr); - } - return tmp + result3.join(""); - case 18: - var eo = _g.e; - return "return" + this.opt(eo,$bind(this,this.printExpr)," "); - case 19: - return "break"; - case 20: - return "continue"; - case 21: - var e112 = _g.e; - return "untyped " + this.printExpr(e112); - case 22: - var e113 = _g.e; - return "throw " + this.printExpr(e113); - case 23: - var _g41 = _g.e; - var cto = _g.t; - var e114 = _g41; - if(cto != null) { - return "cast(" + this.printExpr(e114) + ", " + this.printComplexType(cto) + ")"; - } else { - var e115 = _g41; - return "cast " + this.printExpr(e115); - } - break; - case 24: - var _g43 = _g.displayKind; - var e116 = _g.e; - return "#DISPLAY(" + this.printExpr(e116) + ")"; - case 25: - var tp1 = _g.t; - return "#DISPLAY(" + this.printTypePath(tp1) + ")"; - case 26: - var eelse1 = _g.eelse; - var eif2 = _g.eif; - var econd4 = _g.econd; - return "" + this.printExpr(econd4) + " ? " + this.printExpr(eif2) + " : " + this.printExpr(eelse1); - case 27: - var ct = _g.t; - var e117 = _g.e; - return "(" + this.printExpr(e117) + " : " + this.printComplexType(ct) + ")"; - case 28: - var e118 = _g.e; - var meta = _g.s; - return this.printMetadata(meta) + " " + this.printExpr(e118); - } - } - } - ,printExprs: function(el,sep) { - var f = $bind(this,this.printExpr); - var result = new Array(el.length); - var _g = 0; - var _g1 = el.length; - while(_g < _g1) { - var i = _g++; - result[i] = f(el[i]); - } - return result.join(sep); - } - ,printExtension: function(tpl,fields) { - var tmp = "{\n" + this.tabs + ">"; - var f = $bind(this,this.printTypePath); - var result = new Array(tpl.length); - var _g = 0; - var _g1 = tpl.length; - while(_g < _g1) { - var i = _g++; - result[i] = f(tpl[i]); - } - var tmp1 = tmp + result.join(",\n" + this.tabs + ">") + ","; - var tmp2; - if(fields.length > 0) { - var tmp3 = "\n" + this.tabs; - var f1 = $bind(this,this.printField); - var result1 = new Array(fields.length); - var _g2 = 0; - var _g11 = fields.length; - while(_g2 < _g11) { - var i1 = _g2++; - result1[i1] = f1(fields[i1]); - } - tmp2 = tmp3 + result1.join(";\n" + this.tabs) + ";\n}"; - } else { - tmp2 = "\n}"; - } - return tmp1 + tmp2; - } - ,printStructure: function(fields) { - if(fields.length == 0) { - return "{ }"; - } else { - var tmp = "{\n" + this.tabs; - var f = $bind(this,this.printField); - var result = new Array(fields.length); - var _g = 0; - var _g1 = fields.length; - while(_g < _g1) { - var i = _g++; - result[i] = f(fields[i]); - } - return tmp + result.join(";\n" + this.tabs) + ";\n}"; - } - } - ,printTypeDefinition: function(t,printPackage) { - if(printPackage == null) { - printPackage = true; - } - var old = this.tabs; - this.tabs = this.tabString; - var str; - if(t == null) { - str = "#NULL"; - } else { - var str1 = (printPackage && t.pack.length > 0 && t.pack[0] != "" ? "package " + t.pack.join(".") + ";\n" : "") + (t.doc != null && t.doc != "" ? "/**\n" + this.tabString + StringTools.replace(t.doc,"\n","\n" + this.tabString) + "\n**/\n" : ""); - var str2; - if(t.meta != null && t.meta.length > 0) { - var _this = t.meta; - var f = $bind(this,this.printMetadata); - var result = new Array(_this.length); - var _g = 0; - var _g1 = _this.length; - while(_g < _g1) { - var i = _g++; - result[i] = f(_this[i]); - } - str2 = result.join(" ") + " "; - } else { - str2 = ""; - } - var str3 = str1 + str2 + (t.isExtern ? "extern " : ""); - var _g2 = t.kind; - var str4; - switch(_g2._hx_index) { - case 0: - var str5 = "enum " + t.name; - var str6; - if(t.params != null && t.params.length > 0) { - var _this1 = t.params; - var f1 = $bind(this,this.printTypeParamDecl); - var result1 = new Array(_this1.length); - var _g3 = 0; - var _g11 = _this1.length; - while(_g3 < _g11) { - var i1 = _g3++; - result1[i1] = f1(_this1[i1]); - } - str6 = "<" + result1.join(", ") + ">"; - } else { - str6 = ""; - } - var str7 = str5 + str6 + " {\n"; - var _g4 = []; - var _g12 = 0; - var _g21 = t.fields; - while(_g12 < _g21.length) { - var field = _g21[_g12]; - ++_g12; - var str8 = this.tabs + (field.doc != null && field.doc != "" ? "/**\n" + this.tabs + this.tabString + StringTools.replace(field.doc,"\n","\n" + this.tabs + this.tabString) + "\n" + this.tabs + "**/\n" + this.tabs : ""); - var str9; - if(field.meta != null && field.meta.length > 0) { - var _this2 = field.meta; - var f2 = $bind(this,this.printMetadata); - var result2 = new Array(_this2.length); - var _g5 = 0; - var _g13 = _this2.length; - while(_g5 < _g13) { - var i2 = _g5++; - result2[i2] = f2(_this2[i2]); - } - str9 = result2.join(" ") + " "; - } else { - str9 = ""; - } - var str10 = str8 + str9; - var _g14 = field.kind; - var str11; - switch(_g14._hx_index) { - case 0: - var _g7 = _g14.e; - var t1 = _g14.t; - str11 = field.name + this.opt(t1,$bind(this,this.printComplexType),":"); - break; - case 1: - var func = _g14.f; - str11 = field.name + this.printFunction(func); - break; - case 2: - var _g51 = _g14.e; - var _g41 = _g14.t; - var _g31 = _g14.set; - var _g22 = _g14.get; - throw new js__$Boot_HaxeError("FProp is invalid for TDEnum."); - } - _g4.push(str10 + str11 + ";"); - } - str4 = str7 + _g4.join("\n") + "\n}"; - break; - case 1: - var str12 = "typedef " + t.name; - var str13; - if(t.params != null && t.params.length > 0) { - var _this3 = t.params; - var f3 = $bind(this,this.printTypeParamDecl); - var result3 = new Array(_this3.length); - var _g6 = 0; - var _g15 = _this3.length; - while(_g6 < _g15) { - var i3 = _g6++; - result3[i3] = f3(_this3[i3]); - } - str13 = "<" + result3.join(", ") + ">"; - } else { - str13 = ""; - } - var str14 = str12 + str13 + " = {\n"; - var _g8 = []; - var _g16 = 0; - var _g23 = t.fields; - while(_g16 < _g23.length) { - var f4 = _g23[_g16]; - ++_g16; - _g8.push(this.tabs + this.printField(f4) + ";"); - } - str4 = str14 + _g8.join("\n") + "\n}"; - break; - case 2: - var isFinal = _g2.isFinal; - var isInterface = _g2.isInterface; - var interfaces = _g2.interfaces; - var superClass = _g2.superClass; - var str15 = (isFinal ? "final " : "") + (isInterface ? "interface " : "class ") + t.name; - var str16; - if(t.params != null && t.params.length > 0) { - var _this4 = t.params; - var f5 = $bind(this,this.printTypeParamDecl); - var result4 = new Array(_this4.length); - var _g9 = 0; - var _g17 = _this4.length; - while(_g9 < _g17) { - var i4 = _g9++; - result4[i4] = f5(_this4[i4]); - } - str16 = "<" + result4.join(", ") + ">"; - } else { - str16 = ""; - } - var str17 = str15 + str16 + (superClass != null ? " extends " + this.printTypePath(superClass) : ""); - var str18; - if(interfaces != null) { - var str19; - if(isInterface) { - var _g10 = []; - var _g18 = 0; - while(_g18 < interfaces.length) { - var tp = interfaces[_g18]; - ++_g18; - _g10.push(" extends " + this.printTypePath(tp)); - } - str19 = _g10; - } else { - var _g19 = []; - var _g110 = 0; - while(_g110 < interfaces.length) { - var tp1 = interfaces[_g110]; - ++_g110; - _g19.push(" implements " + this.printTypePath(tp1)); - } - str19 = _g19; - } - str18 = str19.join(""); - } else { - str18 = ""; - } - var str20 = str17 + str18 + " {\n"; - var _g20 = []; - var _g111 = 0; - var _g24 = t.fields; - while(_g111 < _g24.length) { - var f6 = _g24[_g111]; - ++_g111; - _g20.push(this.tabs + this.printFieldWithDelimiter(f6)); - } - str4 = str20 + _g20.join("\n") + "\n}"; - break; - case 3: - var ct = _g2.t; - var str21 = "typedef " + t.name; - var str22; - if(t.params != null && t.params.length > 0) { - var _this5 = t.params; - var f7 = $bind(this,this.printTypeParamDecl); - var result5 = new Array(_this5.length); - var _g25 = 0; - var _g112 = _this5.length; - while(_g25 < _g112) { - var i5 = _g25++; - result5[i5] = f7(_this5[i5]); - } - str22 = "<" + result5.join(", ") + ">"; - } else { - str22 = ""; - } - var str23 = str21 + str22 + " = "; - var str24; - switch(ct._hx_index) { - case 2: - var fields = ct.fields; - str24 = this.printStructure(fields); - break; - case 4: - var fields1 = ct.fields; - var tpl = ct.p; - str24 = this.printExtension(tpl,fields1); - break; - default: - str24 = this.printComplexType(ct); - } - str4 = str23 + str24 + ";"; - break; - case 4: - var to = _g2.to; - var from = _g2.from; - var tthis = _g2.tthis; - var str25 = "abstract " + t.name; - var str26; - if(t.params != null && t.params.length > 0) { - var _this6 = t.params; - var f8 = $bind(this,this.printTypeParamDecl); - var result6 = new Array(_this6.length); - var _g26 = 0; - var _g113 = _this6.length; - while(_g26 < _g113) { - var i6 = _g26++; - result6[i6] = f8(_this6[i6]); - } - str26 = "<" + result6.join(", ") + ">"; - } else { - str26 = ""; - } - var str27 = str25 + str26 + (tthis == null ? "" : "(" + this.printComplexType(tthis) + ")"); - var str28; - if(from == null) { - str28 = ""; - } else { - var _g27 = []; - var _g114 = 0; - while(_g114 < from.length) { - var f9 = from[_g114]; - ++_g114; - _g27.push(" from " + this.printComplexType(f9)); - } - str28 = _g27.join(""); - } - var str29 = str27 + str28; - var str30; - if(to == null) { - str30 = ""; - } else { - var _g28 = []; - var _g115 = 0; - while(_g115 < to.length) { - var t2 = to[_g115]; - ++_g115; - _g28.push(" to " + this.printComplexType(t2)); - } - str30 = _g28.join(""); - } - var str31 = str29 + str30 + " {\n"; - var _g29 = []; - var _g116 = 0; - var _g210 = t.fields; - while(_g116 < _g210.length) { - var f10 = _g210[_g116]; - ++_g116; - _g29.push(this.tabs + this.printFieldWithDelimiter(f10)); - } - str4 = str31 + _g29.join("\n") + "\n}"; - break; - } - str = str3 + str4; - } - this.tabs = old; - return str; - } - ,printFieldWithDelimiter: function(f) { - var tmp = this.printField(f); - var _g = f.kind; - var tmp1; - switch(_g._hx_index) { - case 0: - var _g6 = _g.e; - var _g5 = _g.t; - tmp1 = ";"; - break; - case 1: - var _g7 = _g.f; - var _g11 = _g7.ret; - var _g10 = _g7.params; - var _g9 = _g7.expr; - var _g8 = _g7.args; - if(_g9 == null) { - tmp1 = ";"; - } else { - var _g13 = _g9.pos; - var _g12 = _g9.expr; - if(_g12._hx_index == 12) { - var _g14 = _g12.exprs; - tmp1 = ""; - } else { - tmp1 = ";"; - } - } - break; - case 2: - var _g4 = _g.e; - var _g3 = _g.t; - var _g2 = _g.set; - var _g1 = _g.get; - tmp1 = ";"; - break; - } - return tmp + tmp1; - } - ,opt: function(v,f,prefix) { - if(prefix == null) { - prefix = ""; - } - if(v == null) { - return ""; - } else { - return prefix + f(v); - } - } - ,printExprWithPositions: function(e) { - var _gthis = this; - var buffer_b = ""; - var format4 = function(i) { - return StringTools.lpad(i == null ? "null" : "" + i," ",4); - }; - var loop = null; - loop = function(tabs,e1) { - var add = function(s,p) { - if(p == null) { - p = e1.pos; - } - var p1 = e1.pos; - buffer_b += Std.string("" + format4(p1.min) + "-" + format4(p1.max) + " " + tabs + s + "\n"); - }; - var loopI = function(e2) { - loop(tabs + _gthis.tabString,e2); - }; - var _g = e1.expr; - switch(_g._hx_index) { - case 0: - var c = _g.c; - add(_gthis.printConstant(c)); - break; - case 1: - var e21 = _g.e2; - var e11 = _g.e1; - add("EArray"); - loopI(e11); - loopI(e21); - break; - case 2: - var e22 = _g.e2; - var e12 = _g.e1; - var op = _g.op; - add("EBinop " + _gthis.printBinop(op)); - loopI(e12); - loopI(e22); - break; - case 3: - var field = _g.field; - var e3 = _g.e; - add("EField " + field); - loopI(e3); - break; - case 4: - var e4 = _g.e; - add("EParenthesis"); - loopI(e4); - break; - case 5: - var fields = _g.fields; - add("EObjectDecl"); - var _g1 = 0; - while(_g1 < fields.length) { - var field1 = fields[_g1]; - ++_g1; - add(field1.field); - loopI(field1.expr); - } - break; - case 6: - var values = _g.values; - add("EArrayDecl"); - Lambda.iter(values,loopI); - break; - case 7: - var params = _g.params; - var e5 = _g.e; - add("ECall"); - loopI(e5); - Lambda.iter(params,loopI); - break; - case 8: - var params1 = _g.params; - var tp = _g.t; - add("ENew " + _gthis.printTypePath(tp)); - Lambda.iter(params1,loopI); - break; - case 9: - var e6 = _g.e; - var postFix = _g.postFix; - var op1 = _g.op; - add("EUnop " + _gthis.printUnop(op1)); - loopI(e6); - break; - case 10: - var vars = _g.vars; - add("EVars"); - var _g2 = 0; - while(_g2 < vars.length) { - var v = vars[_g2]; - ++_g2; - if(v.expr != null) { - add(v.name); - loopI(v.expr); - } - } - break; - case 11: - var _g21 = _g.kind; - var f = _g.f; - add("EFunction"); - if(f.expr != null) { - loopI(f.expr); - } - break; - case 12: - var exprs = _g.exprs; - add("EBlock"); - Lambda.iter(exprs,loopI); - break; - case 13: - var expr = _g.expr; - var it = _g.it; - add("EFor"); - loopI(it); - loopI(expr); - break; - case 14: - var eelse = _g.eelse; - var eif = _g.eif; - var econd = _g.econd; - add("EIf"); - loopI(econd); - loopI(eif); - if(eelse != null) { - loopI(eelse); - } - break; - case 15: - var normalWhile = _g.normalWhile; - var e7 = _g.e; - var econd1 = _g.econd; - add("EWhile"); - loopI(econd1); - loopI(e7); - break; - case 16: - var edef = _g.edef; - var cases = _g.cases; - var e8 = _g.e; - add("ESwitch"); - loopI(e8); - var _g3 = 0; - while(_g3 < cases.length) { - var c1 = cases[_g3]; - ++_g3; - var _g4 = 0; - var _g11 = c1.values; - while(_g4 < _g11.length) { - var pat = _g11[_g4]; - ++_g4; - loop(tabs + _gthis.tabString + _gthis.tabString,pat); - } - if(c1.expr != null) { - loop(tabs + _gthis.tabString + _gthis.tabString + _gthis.tabString,c1.expr); - } - } - if(edef != null) { - loop(tabs + _gthis.tabString + _gthis.tabString + _gthis.tabString,edef); - } - break; - case 17: - var catches = _g.catches; - var e9 = _g.e; - add("ETry"); - loopI(e9); - var _g5 = 0; - while(_g5 < catches.length) { - var c2 = catches[_g5]; - ++_g5; - loop(tabs + _gthis.tabString + _gthis.tabString,c2.expr); - } - break; - case 18: - var e10 = _g.e; - add("EReturn"); - if(e10 != null) { - loopI(e10); - } - break; - case 19: - add("EBreak"); - break; - case 20: - add("EContinue"); - break; - case 21: - var e13 = _g.e; - add("EUntyped"); - loopI(e13); - break; - case 22: - var e14 = _g.e; - add("EThrow"); - loopI(e14); - break; - case 23: - var t = _g.t; - var e15 = _g.e; - add("ECast"); - loopI(e15); - break; - case 24: - var displayKind = _g.displayKind; - var e16 = _g.e; - add("EDisplay"); - loopI(e16); - break; - case 25: - var t1 = _g.t; - add("EDisplayNew"); - break; - case 26: - var eelse1 = _g.eelse; - var eif1 = _g.eif; - var econd2 = _g.econd; - add("ETernary"); - loopI(econd2); - loopI(eif1); - loopI(eelse1); - break; - case 27: - var t2 = _g.t; - var e17 = _g.e; - add("ECheckType"); - loopI(e17); - break; - case 28: - var e18 = _g.e; - var s1 = _g.s; - add("EMeta " + _gthis.printMetadata(s1)); - loopI(e18); - break; - } - }; - loop("",e); - return buffer_b; - } - ,__class__: haxe_macro_Printer -}; -var haxe_macro_Type = $hxEnums["haxe.macro.Type"] = { __ename__ : "haxe.macro.Type", __constructs__ : ["TMono","TEnum","TInst","TType","TFun","TAnonymous","TDynamic","TLazy","TAbstract"] - ,TMono: ($_=function(t) { return {_hx_index:0,t:t,__enum__:"haxe.macro.Type",toString:$estr}; },$_.__params__ = ["t"],$_) - ,TEnum: ($_=function(t,params) { return {_hx_index:1,t:t,params:params,__enum__:"haxe.macro.Type",toString:$estr}; },$_.__params__ = ["t","params"],$_) - ,TInst: ($_=function(t,params) { return {_hx_index:2,t:t,params:params,__enum__:"haxe.macro.Type",toString:$estr}; },$_.__params__ = ["t","params"],$_) - ,TType: ($_=function(t,params) { return {_hx_index:3,t:t,params:params,__enum__:"haxe.macro.Type",toString:$estr}; },$_.__params__ = ["t","params"],$_) - ,TFun: ($_=function(args,ret) { return {_hx_index:4,args:args,ret:ret,__enum__:"haxe.macro.Type",toString:$estr}; },$_.__params__ = ["args","ret"],$_) - ,TAnonymous: ($_=function(a) { return {_hx_index:5,a:a,__enum__:"haxe.macro.Type",toString:$estr}; },$_.__params__ = ["a"],$_) - ,TDynamic: ($_=function(t) { return {_hx_index:6,t:t,__enum__:"haxe.macro.Type",toString:$estr}; },$_.__params__ = ["t"],$_) - ,TLazy: ($_=function(f) { return {_hx_index:7,f:f,__enum__:"haxe.macro.Type",toString:$estr}; },$_.__params__ = ["f"],$_) - ,TAbstract: ($_=function(t,params) { return {_hx_index:8,t:t,params:params,__enum__:"haxe.macro.Type",toString:$estr}; },$_.__params__ = ["t","params"],$_) -}; -haxe_macro_Type.__empty_constructs__ = []; -var haxe_macro_AnonStatus = $hxEnums["haxe.macro.AnonStatus"] = { __ename__ : "haxe.macro.AnonStatus", __constructs__ : ["AClosed","AOpened","AConst","AExtend","AClassStatics","AEnumStatics","AAbstractStatics"] - ,AClosed: {_hx_index:0,__enum__:"haxe.macro.AnonStatus",toString:$estr} - ,AOpened: {_hx_index:1,__enum__:"haxe.macro.AnonStatus",toString:$estr} - ,AConst: {_hx_index:2,__enum__:"haxe.macro.AnonStatus",toString:$estr} - ,AExtend: ($_=function(tl) { return {_hx_index:3,tl:tl,__enum__:"haxe.macro.AnonStatus",toString:$estr}; },$_.__params__ = ["tl"],$_) - ,AClassStatics: ($_=function(t) { return {_hx_index:4,t:t,__enum__:"haxe.macro.AnonStatus",toString:$estr}; },$_.__params__ = ["t"],$_) - ,AEnumStatics: ($_=function(t) { return {_hx_index:5,t:t,__enum__:"haxe.macro.AnonStatus",toString:$estr}; },$_.__params__ = ["t"],$_) - ,AAbstractStatics: ($_=function(t) { return {_hx_index:6,t:t,__enum__:"haxe.macro.AnonStatus",toString:$estr}; },$_.__params__ = ["t"],$_) -}; -haxe_macro_AnonStatus.__empty_constructs__ = [haxe_macro_AnonStatus.AClosed,haxe_macro_AnonStatus.AOpened,haxe_macro_AnonStatus.AConst]; -var haxe_macro_ClassKind = $hxEnums["haxe.macro.ClassKind"] = { __ename__ : "haxe.macro.ClassKind", __constructs__ : ["KNormal","KTypeParameter","KExtension","KExpr","KGeneric","KGenericInstance","KMacroType","KAbstractImpl","KGenericBuild"] - ,KNormal: {_hx_index:0,__enum__:"haxe.macro.ClassKind",toString:$estr} - ,KTypeParameter: ($_=function(constraints) { return {_hx_index:1,constraints:constraints,__enum__:"haxe.macro.ClassKind",toString:$estr}; },$_.__params__ = ["constraints"],$_) - ,KExtension: ($_=function(cl,params) { return {_hx_index:2,cl:cl,params:params,__enum__:"haxe.macro.ClassKind",toString:$estr}; },$_.__params__ = ["cl","params"],$_) - ,KExpr: ($_=function(expr) { return {_hx_index:3,expr:expr,__enum__:"haxe.macro.ClassKind",toString:$estr}; },$_.__params__ = ["expr"],$_) - ,KGeneric: {_hx_index:4,__enum__:"haxe.macro.ClassKind",toString:$estr} - ,KGenericInstance: ($_=function(cl,params) { return {_hx_index:5,cl:cl,params:params,__enum__:"haxe.macro.ClassKind",toString:$estr}; },$_.__params__ = ["cl","params"],$_) - ,KMacroType: {_hx_index:6,__enum__:"haxe.macro.ClassKind",toString:$estr} - ,KAbstractImpl: ($_=function(a) { return {_hx_index:7,a:a,__enum__:"haxe.macro.ClassKind",toString:$estr}; },$_.__params__ = ["a"],$_) - ,KGenericBuild: {_hx_index:8,__enum__:"haxe.macro.ClassKind",toString:$estr} -}; -haxe_macro_ClassKind.__empty_constructs__ = [haxe_macro_ClassKind.KNormal,haxe_macro_ClassKind.KGeneric,haxe_macro_ClassKind.KMacroType,haxe_macro_ClassKind.KGenericBuild]; -var haxe_macro_FieldKind = $hxEnums["haxe.macro.FieldKind"] = { __ename__ : "haxe.macro.FieldKind", __constructs__ : ["FVar","FMethod"] - ,FVar: ($_=function(read,write) { return {_hx_index:0,read:read,write:write,__enum__:"haxe.macro.FieldKind",toString:$estr}; },$_.__params__ = ["read","write"],$_) - ,FMethod: ($_=function(k) { return {_hx_index:1,k:k,__enum__:"haxe.macro.FieldKind",toString:$estr}; },$_.__params__ = ["k"],$_) -}; -haxe_macro_FieldKind.__empty_constructs__ = []; -var haxe_macro_VarAccess = $hxEnums["haxe.macro.VarAccess"] = { __ename__ : "haxe.macro.VarAccess", __constructs__ : ["AccNormal","AccNo","AccNever","AccResolve","AccCall","AccInline","AccRequire","AccCtor"] - ,AccNormal: {_hx_index:0,__enum__:"haxe.macro.VarAccess",toString:$estr} - ,AccNo: {_hx_index:1,__enum__:"haxe.macro.VarAccess",toString:$estr} - ,AccNever: {_hx_index:2,__enum__:"haxe.macro.VarAccess",toString:$estr} - ,AccResolve: {_hx_index:3,__enum__:"haxe.macro.VarAccess",toString:$estr} - ,AccCall: {_hx_index:4,__enum__:"haxe.macro.VarAccess",toString:$estr} - ,AccInline: {_hx_index:5,__enum__:"haxe.macro.VarAccess",toString:$estr} - ,AccRequire: ($_=function(r,msg) { return {_hx_index:6,r:r,msg:msg,__enum__:"haxe.macro.VarAccess",toString:$estr}; },$_.__params__ = ["r","msg"],$_) - ,AccCtor: {_hx_index:7,__enum__:"haxe.macro.VarAccess",toString:$estr} -}; -haxe_macro_VarAccess.__empty_constructs__ = [haxe_macro_VarAccess.AccNormal,haxe_macro_VarAccess.AccNo,haxe_macro_VarAccess.AccNever,haxe_macro_VarAccess.AccResolve,haxe_macro_VarAccess.AccCall,haxe_macro_VarAccess.AccInline,haxe_macro_VarAccess.AccCtor]; -var haxe_macro_MethodKind = $hxEnums["haxe.macro.MethodKind"] = { __ename__ : "haxe.macro.MethodKind", __constructs__ : ["MethNormal","MethInline","MethDynamic","MethMacro"] - ,MethNormal: {_hx_index:0,__enum__:"haxe.macro.MethodKind",toString:$estr} - ,MethInline: {_hx_index:1,__enum__:"haxe.macro.MethodKind",toString:$estr} - ,MethDynamic: {_hx_index:2,__enum__:"haxe.macro.MethodKind",toString:$estr} - ,MethMacro: {_hx_index:3,__enum__:"haxe.macro.MethodKind",toString:$estr} -}; -haxe_macro_MethodKind.__empty_constructs__ = [haxe_macro_MethodKind.MethNormal,haxe_macro_MethodKind.MethInline,haxe_macro_MethodKind.MethDynamic,haxe_macro_MethodKind.MethMacro]; -var haxe_macro_TConstant = $hxEnums["haxe.macro.TConstant"] = { __ename__ : "haxe.macro.TConstant", __constructs__ : ["TInt","TFloat","TString","TBool","TNull","TThis","TSuper"] - ,TInt: ($_=function(i) { return {_hx_index:0,i:i,__enum__:"haxe.macro.TConstant",toString:$estr}; },$_.__params__ = ["i"],$_) - ,TFloat: ($_=function(s) { return {_hx_index:1,s:s,__enum__:"haxe.macro.TConstant",toString:$estr}; },$_.__params__ = ["s"],$_) - ,TString: ($_=function(s) { return {_hx_index:2,s:s,__enum__:"haxe.macro.TConstant",toString:$estr}; },$_.__params__ = ["s"],$_) - ,TBool: ($_=function(b) { return {_hx_index:3,b:b,__enum__:"haxe.macro.TConstant",toString:$estr}; },$_.__params__ = ["b"],$_) - ,TNull: {_hx_index:4,__enum__:"haxe.macro.TConstant",toString:$estr} - ,TThis: {_hx_index:5,__enum__:"haxe.macro.TConstant",toString:$estr} - ,TSuper: {_hx_index:6,__enum__:"haxe.macro.TConstant",toString:$estr} -}; -haxe_macro_TConstant.__empty_constructs__ = [haxe_macro_TConstant.TNull,haxe_macro_TConstant.TThis,haxe_macro_TConstant.TSuper]; -var haxe_macro_ModuleType = $hxEnums["haxe.macro.ModuleType"] = { __ename__ : "haxe.macro.ModuleType", __constructs__ : ["TClassDecl","TEnumDecl","TTypeDecl","TAbstract"] - ,TClassDecl: ($_=function(c) { return {_hx_index:0,c:c,__enum__:"haxe.macro.ModuleType",toString:$estr}; },$_.__params__ = ["c"],$_) - ,TEnumDecl: ($_=function(e) { return {_hx_index:1,e:e,__enum__:"haxe.macro.ModuleType",toString:$estr}; },$_.__params__ = ["e"],$_) - ,TTypeDecl: ($_=function(t) { return {_hx_index:2,t:t,__enum__:"haxe.macro.ModuleType",toString:$estr}; },$_.__params__ = ["t"],$_) - ,TAbstract: ($_=function(a) { return {_hx_index:3,a:a,__enum__:"haxe.macro.ModuleType",toString:$estr}; },$_.__params__ = ["a"],$_) -}; -haxe_macro_ModuleType.__empty_constructs__ = []; -var haxe_macro_FieldAccess = $hxEnums["haxe.macro.FieldAccess"] = { __ename__ : "haxe.macro.FieldAccess", __constructs__ : ["FInstance","FStatic","FAnon","FDynamic","FClosure","FEnum"] - ,FInstance: ($_=function(c,params,cf) { return {_hx_index:0,c:c,params:params,cf:cf,__enum__:"haxe.macro.FieldAccess",toString:$estr}; },$_.__params__ = ["c","params","cf"],$_) - ,FStatic: ($_=function(c,cf) { return {_hx_index:1,c:c,cf:cf,__enum__:"haxe.macro.FieldAccess",toString:$estr}; },$_.__params__ = ["c","cf"],$_) - ,FAnon: ($_=function(cf) { return {_hx_index:2,cf:cf,__enum__:"haxe.macro.FieldAccess",toString:$estr}; },$_.__params__ = ["cf"],$_) - ,FDynamic: ($_=function(s) { return {_hx_index:3,s:s,__enum__:"haxe.macro.FieldAccess",toString:$estr}; },$_.__params__ = ["s"],$_) - ,FClosure: ($_=function(c,cf) { return {_hx_index:4,c:c,cf:cf,__enum__:"haxe.macro.FieldAccess",toString:$estr}; },$_.__params__ = ["c","cf"],$_) - ,FEnum: ($_=function(e,ef) { return {_hx_index:5,e:e,ef:ef,__enum__:"haxe.macro.FieldAccess",toString:$estr}; },$_.__params__ = ["e","ef"],$_) -}; -haxe_macro_FieldAccess.__empty_constructs__ = []; -var haxe_macro_TypedExprDef = $hxEnums["haxe.macro.TypedExprDef"] = { __ename__ : "haxe.macro.TypedExprDef", __constructs__ : ["TConst","TLocal","TArray","TBinop","TField","TTypeExpr","TParenthesis","TObjectDecl","TArrayDecl","TCall","TNew","TUnop","TFunction","TVar","TBlock","TFor","TIf","TWhile","TSwitch","TTry","TReturn","TBreak","TContinue","TThrow","TCast","TMeta","TEnumParameter","TEnumIndex","TIdent"] - ,TConst: ($_=function(c) { return {_hx_index:0,c:c,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["c"],$_) - ,TLocal: ($_=function(v) { return {_hx_index:1,v:v,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["v"],$_) - ,TArray: ($_=function(e1,e2) { return {_hx_index:2,e1:e1,e2:e2,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["e1","e2"],$_) - ,TBinop: ($_=function(op,e1,e2) { return {_hx_index:3,op:op,e1:e1,e2:e2,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["op","e1","e2"],$_) - ,TField: ($_=function(e,fa) { return {_hx_index:4,e:e,fa:fa,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["e","fa"],$_) - ,TTypeExpr: ($_=function(m) { return {_hx_index:5,m:m,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["m"],$_) - ,TParenthesis: ($_=function(e) { return {_hx_index:6,e:e,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["e"],$_) - ,TObjectDecl: ($_=function(fields) { return {_hx_index:7,fields:fields,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["fields"],$_) - ,TArrayDecl: ($_=function(el) { return {_hx_index:8,el:el,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["el"],$_) - ,TCall: ($_=function(e,el) { return {_hx_index:9,e:e,el:el,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["e","el"],$_) - ,TNew: ($_=function(c,params,el) { return {_hx_index:10,c:c,params:params,el:el,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["c","params","el"],$_) - ,TUnop: ($_=function(op,postFix,e) { return {_hx_index:11,op:op,postFix:postFix,e:e,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["op","postFix","e"],$_) - ,TFunction: ($_=function(tfunc) { return {_hx_index:12,tfunc:tfunc,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["tfunc"],$_) - ,TVar: ($_=function(v,expr) { return {_hx_index:13,v:v,expr:expr,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["v","expr"],$_) - ,TBlock: ($_=function(el) { return {_hx_index:14,el:el,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["el"],$_) - ,TFor: ($_=function(v,e1,e2) { return {_hx_index:15,v:v,e1:e1,e2:e2,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["v","e1","e2"],$_) - ,TIf: ($_=function(econd,eif,eelse) { return {_hx_index:16,econd:econd,eif:eif,eelse:eelse,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["econd","eif","eelse"],$_) - ,TWhile: ($_=function(econd,e,normalWhile) { return {_hx_index:17,econd:econd,e:e,normalWhile:normalWhile,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["econd","e","normalWhile"],$_) - ,TSwitch: ($_=function(e,cases,edef) { return {_hx_index:18,e:e,cases:cases,edef:edef,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["e","cases","edef"],$_) - ,TTry: ($_=function(e,catches) { return {_hx_index:19,e:e,catches:catches,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["e","catches"],$_) - ,TReturn: ($_=function(e) { return {_hx_index:20,e:e,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["e"],$_) - ,TBreak: {_hx_index:21,__enum__:"haxe.macro.TypedExprDef",toString:$estr} - ,TContinue: {_hx_index:22,__enum__:"haxe.macro.TypedExprDef",toString:$estr} - ,TThrow: ($_=function(e) { return {_hx_index:23,e:e,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["e"],$_) - ,TCast: ($_=function(e,m) { return {_hx_index:24,e:e,m:m,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["e","m"],$_) - ,TMeta: ($_=function(m,e1) { return {_hx_index:25,m:m,e1:e1,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["m","e1"],$_) - ,TEnumParameter: ($_=function(e1,ef,index) { return {_hx_index:26,e1:e1,ef:ef,index:index,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["e1","ef","index"],$_) - ,TEnumIndex: ($_=function(e1) { return {_hx_index:27,e1:e1,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["e1"],$_) - ,TIdent: ($_=function(s) { return {_hx_index:28,s:s,__enum__:"haxe.macro.TypedExprDef",toString:$estr}; },$_.__params__ = ["s"],$_) -}; -haxe_macro_TypedExprDef.__empty_constructs__ = [haxe_macro_TypedExprDef.TBreak,haxe_macro_TypedExprDef.TContinue]; -var haxe_macro_TypeTools = function() { }; -$hxClasses["haxe.macro.TypeTools"] = haxe_macro_TypeTools; -haxe_macro_TypeTools.__name__ = "haxe.macro.TypeTools"; -haxe_macro_TypeTools.nullable = function(complexType) { - return haxe_macro_ComplexType.TPath({ pack : [], name : "Null", params : [haxe_macro_TypeParam.TPType(complexType)]}); -}; -haxe_macro_TypeTools.toField = function(cf) { - var varAccessToString = function(va,getOrSet) { - switch(va._hx_index) { - case 0:case 7: - return "default"; - case 1: - return "null"; - case 2: - return "never"; - case 3: - throw new js__$Boot_HaxeError("Invalid TAnonymous"); - case 4: - return getOrSet; - case 5: - return "default"; - case 6: - var _g1 = va.msg; - var _g = va.r; - return "default"; - } - }; - var access = cf.isPublic ? [haxe_macro_Access.APublic] : [haxe_macro_Access.APrivate]; - if(cf.meta.has(":final")) { - access.push(haxe_macro_Access.AFinal); - } - if(cf.params.length == 0) { - var cf1 = cf.name; - var cf2 = cf.doc; - var tmp; - var _g2 = cf.type; - var _g11 = cf.kind; - switch(_g11._hx_index) { - case 0: - var ret = _g2; - var write = _g11.write; - var read = _g11.read; - tmp = haxe_macro_FieldType.FProp(varAccessToString(read,"get"),varAccessToString(write,"set"),haxe_macro_TypeTools.toComplexType(ret),null); - break; - case 1: - var _g21 = _g11.k; - if(_g2._hx_index == 4) { - var ret1 = _g2.ret; - var args = _g2.args; - var _g3 = []; - var _g12 = 0; - while(_g12 < args.length) { - var a = args[_g12]; - ++_g12; - _g3.push({ name : a.name, opt : a.opt, type : haxe_macro_TypeTools.toComplexType(a.t)}); - } - tmp = haxe_macro_FieldType.FFun({ args : _g3, ret : haxe_macro_TypeTools.toComplexType(ret1), expr : null}); - } else { - throw new js__$Boot_HaxeError("Invalid TAnonymous"); - } - break; - } - return { name : cf1, doc : cf2, access : access, kind : tmp, pos : cf.pos, meta : cf.meta.get()}; - } else { - throw new js__$Boot_HaxeError("Invalid TAnonymous"); - } -}; -haxe_macro_TypeTools.toComplexType = function(type) { - if(type == null) { - return null; - } else { - switch(type._hx_index) { - case 0: - var t = type.t.get(); - if(t == null) { - return null; - } else { - return haxe_macro_TypeTools.toComplexType(t); - } - break; - case 1: - var params = type.params; - var baseType = type.t.get(); - return haxe_macro_ComplexType.TPath(haxe_macro_TypeTools.toTypePath(baseType,params)); - case 2: - var params1 = type.params; - var classType = type.t.get(); - var _g = classType.kind; - if(_g._hx_index == 1) { - var _g1 = _g.constraints; - return haxe_macro_ComplexType.TPath({ name : classType.name, pack : []}); - } else { - return haxe_macro_ComplexType.TPath(haxe_macro_TypeTools.toTypePath(classType,params1)); - } - break; - case 3: - var params2 = type.params; - var baseType1 = type.t.get(); - return haxe_macro_ComplexType.TPath(haxe_macro_TypeTools.toTypePath(baseType1,params2)); - case 4: - var ret = type.ret; - var args = type.args; - var _g2 = []; - var _g11 = 0; - while(_g11 < args.length) { - var a = args[_g11]; - ++_g11; - _g2.push(a.opt ? haxe_macro_TypeTools.nullable(haxe_macro_TypeTools.toComplexType(a.t)) : haxe_macro_TypeTools.toComplexType(a.t)); - } - return haxe_macro_ComplexType.TFunction(_g2,haxe_macro_TypeTools.toComplexType(ret)); - case 5: - var _hx_tmp = type.a.get(); - var _g14 = _hx_tmp.status; - var fields = _hx_tmp.fields; - var _g3 = []; - var _g12 = 0; - while(_g12 < fields.length) { - var cf = fields[_g12]; - ++_g12; - _g3.push(haxe_macro_TypeTools.toField(cf)); - } - return haxe_macro_ComplexType.TAnonymous(_g3); - case 6: - var t1 = type.t; - if(t1 == null) { - return haxe_macro_ComplexType.TPath({ pack : [], name : "Dynamic", params : []}); - } else { - var ct = haxe_macro_TypeTools.toComplexType(t1); - return haxe_macro_ComplexType.TPath({ pack : [], name : "Dynamic", params : [haxe_macro_TypeParam.TPType(ct)]}); - } - break; - case 7: - var f = type.f; - return haxe_macro_TypeTools.toComplexType(f()); - case 8: - var params3 = type.params; - var baseType2 = type.t.get(); - return haxe_macro_ComplexType.TPath(haxe_macro_TypeTools.toTypePath(baseType2,params3)); - } - } -}; -haxe_macro_TypeTools.toTypeParam = function(type) { - if(type._hx_index == 2) { - var _g1 = type.params; - var _hx_tmp = type.t.get(); - var _g20 = _hx_tmp.superClass; - var _g19 = _hx_tmp.statics; - var _g18 = _hx_tmp.pos; - var _g17 = _hx_tmp.params; - var _g16 = _hx_tmp.pack; - var _g15 = _hx_tmp.overrides; - var _g14 = _hx_tmp.name; - var _g13 = _hx_tmp.module; - var _g12 = _hx_tmp.meta; - var _g11 = _hx_tmp.kind; - var _g10 = _hx_tmp.isPrivate; - var _g9 = _hx_tmp.isInterface; - var _g8 = _hx_tmp.isFinal; - var _g7 = _hx_tmp.isExtern; - var _g6 = _hx_tmp.interfaces; - var _g5 = _hx_tmp.init; - var _g4 = _hx_tmp.fields; - var _g3 = _hx_tmp.doc; - var _g2 = _hx_tmp.constructor; - if(_g11._hx_index == 3) { - var e = _g11.expr; - return haxe_macro_TypeParam.TPExpr(e); - } else { - return haxe_macro_TypeParam.TPType(haxe_macro_TypeTools.toComplexType(type)); - } - } else { - return haxe_macro_TypeParam.TPType(haxe_macro_TypeTools.toComplexType(type)); - } -}; -haxe_macro_TypeTools.toTypePath = function(baseType,params) { - var module = baseType.module; - var baseType1 = baseType.pack; - var tmp = module.substring(module.lastIndexOf(".") + 1); - var baseType2 = baseType.name; - var _g = []; - var _g1 = 0; - while(_g1 < params.length) { - var t = params[_g1]; - ++_g1; - _g.push(haxe_macro_TypeTools.toTypeParam(t)); - } - return { pack : baseType1, name : tmp, sub : baseType2, params : _g}; -}; -haxe_macro_TypeTools.findField = function(c,name,isStatic) { - if(isStatic == null) { - isStatic = false; - } - var field = Lambda.find((isStatic ? c.statics : c.fields).get(),function(field1) { - return field1.name == name; - }); - if(field != null) { - return field; - } else if(c.superClass != null) { - return haxe_macro_TypeTools.findField(c.superClass.t.get(),name,isStatic); - } else { - return null; - } -}; -var haxe_macro_TypedExprTools = function() { }; -$hxClasses["haxe.macro.TypedExprTools"] = haxe_macro_TypedExprTools; -haxe_macro_TypedExprTools.__name__ = "haxe.macro.TypedExprTools"; -haxe_macro_TypedExprTools.with = function(e,edef,t) { - return { expr : edef == null ? e.expr : edef, pos : e.pos, t : t == null ? e.t : t}; -}; -haxe_macro_TypedExprTools.map = function(e,f) { - var _g = e.expr; - switch(_g._hx_index) { - case 0: - var _g27 = _g.c; - return e; - case 1: - var _g48 = _g.v; - return e; - case 2: - var e2 = _g.e2; - var e1 = _g.e1; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TArray(f(e1),f(e2))); - case 3: - var e21 = _g.e2; - var e11 = _g.e1; - var op = _g.op; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TBinop(op,f(e11),f(e21))); - case 4: - var fa = _g.fa; - var e12 = _g.e; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TField(f(e12),fa)); - case 5: - var _g10 = _g.m; - return e; - case 6: - var e13 = _g.e; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TParenthesis(f(e13))); - case 7: - var fl = _g.fields; - var result = new Array(fl.length); - var _g1 = 0; - var _g11 = fl.length; - while(_g1 < _g11) { - var i = _g1++; - var field = fl[i]; - result[i] = { name : field.name, expr : f(field.expr)}; - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TObjectDecl(result)); - case 8: - var el = _g.el; - var result1 = new Array(el.length); - var _g2 = 0; - var _g12 = el.length; - while(_g2 < _g12) { - var i1 = _g2++; - result1[i1] = f(el[i1]); - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TArrayDecl(result1)); - case 9: - var el1 = _g.el; - var e14 = _g.e; - var tmp = f(e14); - var result2 = new Array(el1.length); - var _g3 = 0; - var _g13 = el1.length; - while(_g3 < _g13) { - var i2 = _g3++; - result2[i2] = f(el1[i2]); - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TCall(tmp,result2)); - case 10: - var el2 = _g.el; - var pl = _g.params; - var t = _g.c; - var result3 = new Array(el2.length); - var _g4 = 0; - var _g14 = el2.length; - while(_g4 < _g14) { - var i3 = _g4++; - result3[i3] = f(el2[i3]); - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TNew(t,pl,result3)); - case 11: - var e15 = _g.e; - var pre = _g.postFix; - var op1 = _g.op; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TUnop(op1,pre,f(e15))); - case 12: - var fu = _g.tfunc; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TFunction({ t : fu.t, args : fu.args, expr : f(fu.expr)})); - case 13: - var eo = _g.expr; - var v = _g.v; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TVar(v,eo == null ? null : f(eo))); - case 14: - var el3 = _g.el; - var result4 = new Array(el3.length); - var _g5 = 0; - var _g15 = el3.length; - while(_g5 < _g15) { - var i4 = _g5++; - result4[i4] = f(el3[i4]); - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TBlock(result4)); - case 15: - var e22 = _g.e2; - var e16 = _g.e1; - var v1 = _g.v; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TFor(v1,f(e16),f(e22))); - case 16: - var e3 = _g.eelse; - var e23 = _g.eif; - var e17 = _g.econd; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TIf(f(e17),f(e23),e3 == null ? null : f(e3))); - case 17: - var flag = _g.normalWhile; - var e24 = _g.e; - var e18 = _g.econd; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TWhile(f(e18),f(e24),flag)); - case 18: - var e25 = _g.edef; - var cases = _g.cases; - var e19 = _g.e; - var tmp1 = f(e19); - var result5 = new Array(cases.length); - var _g6 = 0; - var _g16 = cases.length; - while(_g6 < _g16) { - var i5 = _g6++; - var c = cases[i5]; - var _this = c.values; - var result6 = new Array(_this.length); - var _g7 = 0; - var _g17 = _this.length; - while(_g7 < _g17) { - var i6 = _g7++; - result6[i6] = f(_this[i6]); - } - result5[i5] = { values : result6, expr : f(c.expr)}; - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TSwitch(tmp1,result5,e25 == null ? null : f(e25))); - case 19: - var catches = _g.catches; - var e110 = _g.e; - var tmp2 = f(e110); - var result7 = new Array(catches.length); - var _g8 = 0; - var _g18 = catches.length; - while(_g8 < _g18) { - var i7 = _g8++; - var c1 = catches[i7]; - result7[i7] = { v : c1.v, expr : f(c1.expr)}; - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TTry(tmp2,result7)); - case 20: - var e111 = _g.e; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TReturn(e111 == null ? null : f(e111))); - case 21:case 22: - return e; - case 23: - var e112 = _g.e; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TThrow(f(e112))); - case 24: - var mt = _g.m; - var e113 = _g.e; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TCast(f(e113),mt)); - case 25: - var e114 = _g.e1; - var m = _g.m; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TMeta(m,f(e114))); - case 26: - var i8 = _g.index; - var ef = _g.ef; - var e115 = _g.e1; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TEnumParameter(f(e115),ef,i8)); - case 27: - var e116 = _g.e1; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TEnumIndex(f(e116))); - case 28: - var _g171 = _g.s; - return e; - } -}; -haxe_macro_TypedExprTools.iter = function(e,f) { - var _g = e.expr; - switch(_g._hx_index) { - case 0: - var _g27 = _g.c; - break; - case 1: - var _g48 = _g.v; - break; - case 2: - var e2 = _g.e2; - var e1 = _g.e1; - f(e1); - f(e2); - break; - case 3: - var _g11 = _g.op; - var e21 = _g.e2; - var e11 = _g.e1; - f(e11); - f(e21); - break; - case 4: - var _g32 = _g.fa; - var e12 = _g.e; - f(e12); - break; - case 5: - var _g10 = _g.m; - break; - case 6: - var e13 = _g.e; - f(e13); - break; - case 7: - var fl = _g.fields; - var _g1 = 0; - while(_g1 < fl.length) { - var field = fl[_g1]; - ++_g1; - f(field.expr); - } - break; - case 8: - var el = _g.el; - var _g2 = 0; - while(_g2 < el.length) { - var e3 = el[_g2]; - ++_g2; - f(e3); - } - break; - case 9: - var el1 = _g.el; - var e14 = _g.e; - f(e14); - var _g3 = 0; - while(_g3 < el1.length) { - var e4 = el1[_g3]; - ++_g3; - f(e4); - } - break; - case 10: - var _g6 = _g.params; - var _g5 = _g.c; - var el2 = _g.el; - var _g4 = 0; - while(_g4 < el2.length) { - var e5 = el2[_g4]; - ++_g4; - f(e5); - } - break; - case 11: - var _g37 = _g.postFix; - var _g36 = _g.op; - var e15 = _g.e; - f(e15); - break; - case 12: - var fu = _g.tfunc; - f(fu.expr); - break; - case 13: - var _g8 = _g.v; - var e16 = _g.expr; - if(e16 != null) { - f(e16); - } - break; - case 14: - var el3 = _g.el; - var _g7 = 0; - while(_g7 < el3.length) { - var e6 = el3[_g7]; - ++_g7; - f(e6); - } - break; - case 15: - var _g23 = _g.v; - var e22 = _g.e2; - var e17 = _g.e1; - f(e17); - f(e22); - break; - case 16: - var e31 = _g.eelse; - var e23 = _g.eif; - var e18 = _g.econd; - f(e18); - f(e23); - if(e31 != null) { - f(e31); - } - break; - case 17: - var _g35 = _g.normalWhile; - var e24 = _g.e; - var e19 = _g.econd; - f(e19); - f(e24); - break; - case 18: - var e25 = _g.edef; - var cases = _g.cases; - var e110 = _g.e; - f(e110); - var _g9 = 0; - while(_g9 < cases.length) { - var c = cases[_g9]; - ++_g9; - var _g12 = 0; - var _g13 = c.values; - while(_g12 < _g13.length) { - var v = _g13[_g12]; - ++_g12; - f(v); - } - f(c.expr); - } - if(e25 != null) { - f(e25); - } - break; - case 19: - var catches = _g.catches; - var e111 = _g.e; - f(e111); - var _g14 = 0; - while(_g14 < catches.length) { - var c1 = catches[_g14]; - ++_g14; - f(c1.expr); - } - break; - case 20: - var e112 = _g.e; - if(e112 != null) { - f(e112); - } - break; - case 21:case 22: - break; - case 23: - var e113 = _g.e; - f(e113); - break; - case 24: - var _g16 = _g.m; - var e114 = _g.e; - f(e114); - break; - case 25: - var _g39 = _g.m; - var e115 = _g.e1; - f(e115); - break; - case 26: - var _g31 = _g.index; - var _g21 = _g.ef; - var e116 = _g.e1; - f(e116); - break; - case 27: - var e117 = _g.e1; - f(e117); - break; - case 28: - var _g17 = _g.s; - break; - } -}; -haxe_macro_TypedExprTools.mapWithType = function(e,f,ft,fv) { - var _g = e.expr; - switch(_g._hx_index) { - case 0: - var _g27 = _g.c; - return haxe_macro_TypedExprTools.with(e,null,ft(e.t)); - case 1: - var v = _g.v; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TLocal(fv(v)),ft(e.t)); - case 2: - var e2 = _g.e2; - var e1 = _g.e1; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TArray(f(e1),f(e2)),ft(e.t)); - case 3: - var e21 = _g.e2; - var e11 = _g.e1; - var op = _g.op; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TBinop(op,f(e11),f(e21)),ft(e.t)); - case 4: - var fa = _g.fa; - var e12 = _g.e; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TField(f(e12),fa),ft(e.t)); - case 5: - var _g10 = _g.m; - return haxe_macro_TypedExprTools.with(e,null,ft(e.t)); - case 6: - var e13 = _g.e; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TParenthesis(e13),ft(e.t)); - case 7: - var fl = _g.fields; - var result = new Array(fl.length); - var _g1 = 0; - var _g11 = fl.length; - while(_g1 < _g11) { - var i = _g1++; - var field = fl[i]; - result[i] = { name : field.name, expr : f(field.expr)}; - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TObjectDecl(result),ft(e.t)); - case 8: - var el = _g.el; - var result1 = new Array(el.length); - var _g2 = 0; - var _g12 = el.length; - while(_g2 < _g12) { - var i1 = _g2++; - result1[i1] = f(el[i1]); - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TArrayDecl(result1),ft(e.t)); - case 9: - var el1 = _g.el; - var e14 = _g.e; - var tmp = f(e14); - var result2 = new Array(el1.length); - var _g3 = 0; - var _g13 = el1.length; - while(_g3 < _g13) { - var i2 = _g3++; - result2[i2] = f(el1[i2]); - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TCall(tmp,result2),ft(e.t)); - case 10: - var el2 = _g.el; - var pl = _g.params; - var t = _g.c; - var result3 = new Array(el2.length); - var _g4 = 0; - var _g14 = el2.length; - while(_g4 < _g14) { - var i3 = _g4++; - result3[i3] = f(el2[i3]); - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TNew(t,pl,result3),ft(e.t)); - case 11: - var e15 = _g.e; - var pre = _g.postFix; - var op1 = _g.op; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TUnop(op1,pre,f(e15)),ft(e.t)); - case 12: - var fu = _g.tfunc; - var tmp1 = ft(fu.t); - var _this = fu.args; - var result4 = new Array(_this.length); - var _g5 = 0; - var _g15 = _this.length; - while(_g5 < _g15) { - var i4 = _g5++; - var arg = _this[i4]; - result4[i4] = { v : fv(arg.v), value : arg.value}; - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TFunction({ t : tmp1, args : result4, expr : f(fu.expr)}),ft(e.t)); - case 13: - var eo = _g.expr; - var v1 = _g.v; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TVar(fv(v1),eo == null ? null : f(eo)),ft(e.t)); - case 14: - var el3 = _g.el; - var result5 = new Array(el3.length); - var _g6 = 0; - var _g16 = el3.length; - while(_g6 < _g16) { - var i5 = _g6++; - result5[i5] = f(el3[i5]); - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TBlock(result5),ft(e.t)); - case 15: - var e22 = _g.e2; - var e16 = _g.e1; - var v2 = _g.v; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TFor(fv(v2),f(e16),f(e22)),ft(e.t)); - case 16: - var e3 = _g.eelse; - var e23 = _g.eif; - var e17 = _g.econd; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TIf(f(e17),f(e23),e3 == null ? null : f(e3)),ft(e.t)); - case 17: - var flag = _g.normalWhile; - var e24 = _g.e; - var e18 = _g.econd; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TWhile(f(e18),f(e24),flag),ft(e.t)); - case 18: - var e25 = _g.edef; - var cases = _g.cases; - var e19 = _g.e; - var tmp2 = f(e19); - var result6 = new Array(cases.length); - var _g7 = 0; - var _g17 = cases.length; - while(_g7 < _g17) { - var i6 = _g7++; - var c = cases[i6]; - var _this1 = c.values; - var result7 = new Array(_this1.length); - var _g8 = 0; - var _g18 = _this1.length; - while(_g8 < _g18) { - var i7 = _g8++; - result7[i7] = f(_this1[i7]); - } - result6[i6] = { values : result7, expr : f(c.expr)}; - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TSwitch(tmp2,result6,e25 == null ? null : f(e25)),ft(e.t)); - case 19: - var catches = _g.catches; - var e110 = _g.e; - var tmp3 = f(e110); - var result8 = new Array(catches.length); - var _g9 = 0; - var _g19 = catches.length; - while(_g9 < _g19) { - var i8 = _g9++; - var c1 = catches[i8]; - result8[i8] = { v : fv(c1.v), expr : f(c1.expr)}; - } - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TTry(tmp3,result8),ft(e.t)); - case 20: - var e111 = _g.e; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TReturn(e111 == null ? null : f(e111)),ft(e.t)); - case 21:case 22: - return haxe_macro_TypedExprTools.with(e,null,ft(e.t)); - case 23: - var e112 = _g.e; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TThrow(f(e112)),ft(e.t)); - case 24: - var mt = _g.m; - var e113 = _g.e; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TCast(f(e113),mt),ft(e.t)); - case 25: - var e114 = _g.e1; - var m = _g.m; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TMeta(m,f(e114)),ft(e.t)); - case 26: - var i9 = _g.index; - var ef = _g.ef; - var e115 = _g.e1; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TEnumParameter(f(e115),ef,i9),ft(e.t)); - case 27: - var e116 = _g.e1; - return haxe_macro_TypedExprTools.with(e,haxe_macro_TypedExprDef.TEnumIndex(f(e116)),ft(e.t)); - case 28: - var _g171 = _g.s; - return haxe_macro_TypedExprTools.with(e,null,ft(e.t)); - } -}; -var js__$Boot_HaxeError = function(val) { - Error.call(this); - this.val = val; - if(Error.captureStackTrace) { - Error.captureStackTrace(this,js__$Boot_HaxeError); - } -}; -$hxClasses["js._Boot.HaxeError"] = js__$Boot_HaxeError; -js__$Boot_HaxeError.__name__ = "js._Boot.HaxeError"; -js__$Boot_HaxeError.wrap = function(val) { - if(((val) instanceof Error)) { - return val; - } else { - return new js__$Boot_HaxeError(val); - } -}; -js__$Boot_HaxeError.__super__ = Error; -js__$Boot_HaxeError.prototype = $extend(Error.prototype,{ - val: null - ,__class__: js__$Boot_HaxeError -}); -var js_Boot = function() { }; -$hxClasses["js.Boot"] = js_Boot; -js_Boot.__name__ = "js.Boot"; -js_Boot.isClass = function(o) { - return o.__name__; -}; -js_Boot.isInterface = function(o) { - return o.__isInterface__; -}; -js_Boot.isEnum = function(e) { - return e.__ename__; -}; -js_Boot.getClass = function(o) { - if(o == null) { - return null; - } else if(((o) instanceof Array)) { - return Array; - } else { - var cl = o.__class__; - if(cl != null) { - return cl; - } - var name = js_Boot.__nativeClassName(o); - if(name != null) { - return js_Boot.__resolveNativeClass(name); - } - return null; - } -}; -js_Boot.__string_rec = function(o,s) { - if(o == null) { - return "null"; - } - if(s.length >= 5) { - return "<...>"; - } - var t = typeof(o); - if(t == "function" && (o.__name__ || o.__ename__)) { - t = "object"; - } - switch(t) { - case "function": - return ""; - case "object": - if(o.__enum__) { - var e = $hxEnums[o.__enum__]; - var n = e.__constructs__[o._hx_index]; - var con = e[n]; - if(con.__params__) { - s = s + "\t"; - return n + "(" + ((function($this) { - var $r; - var _g = []; - { - var _g1 = 0; - var _g2 = con.__params__; - while(true) { - if(!(_g1 < _g2.length)) { - break; - } - var p = _g2[_g1]; - _g1 = _g1 + 1; - _g.push(js_Boot.__string_rec(o[p],s)); - } - } - $r = _g; - return $r; - }(this))).join(",") + ")"; - } else { - return n; - } - } - if(((o) instanceof Array)) { - var str = "["; - s += "\t"; - var _g3 = 0; - var _g11 = o.length; - while(_g3 < _g11) { - var i = _g3++; - str += (i > 0 ? "," : "") + js_Boot.__string_rec(o[i],s); - } - str += "]"; - return str; - } - var tostr; - try { - tostr = o.toString; - } catch( e1 ) { - var e2 = ((e1) instanceof js__$Boot_HaxeError) ? e1.val : e1; - return "???"; - } - if(tostr != null && tostr != Object.toString && typeof(tostr) == "function") { - var s2 = o.toString(); - if(s2 != "[object Object]") { - return s2; - } - } - var str1 = "{\n"; - s += "\t"; - var hasp = o.hasOwnProperty != null; - var k = null; - for( k in o ) { - if(hasp && !o.hasOwnProperty(k)) { - continue; - } - if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") { - continue; - } - if(str1.length != 2) { - str1 += ", \n"; - } - str1 += s + k + " : " + js_Boot.__string_rec(o[k],s); - } - s = s.substring(1); - str1 += "\n" + s + "}"; - return str1; - case "string": - return o; - default: - return String(o); - } -}; -js_Boot.__interfLoop = function(cc,cl) { - if(cc == null) { - return false; - } - if(cc == cl) { - return true; - } - if(Object.prototype.hasOwnProperty.call(cc,"__interfaces__")) { - var intf = cc.__interfaces__; - var _g = 0; - var _g1 = intf.length; - while(_g < _g1) { - var i = _g++; - var i1 = intf[i]; - if(i1 == cl || js_Boot.__interfLoop(i1,cl)) { - return true; - } - } - } - return js_Boot.__interfLoop(cc.__super__,cl); -}; -js_Boot.__instanceof = function(o,cl) { - if(cl == null) { - return false; - } - switch(cl) { - case Array: - return ((o) instanceof Array); - case Bool: - return typeof(o) == "boolean"; - case Dynamic: - return o != null; - case Float: - return typeof(o) == "number"; - case Int: - if(typeof(o) == "number") { - return ((o | 0) === o); - } else { - return false; - } - break; - case String: - return typeof(o) == "string"; - default: - if(o != null) { - if(typeof(cl) == "function") { - if(js_Boot.__downcastCheck(o,cl)) { - return true; - } - } else if(typeof(cl) == "object" && js_Boot.__isNativeObj(cl)) { - if(((o) instanceof cl)) { - return true; - } - } - } else { - return false; - } - if(cl == Class ? o.__name__ != null : false) { - return true; - } - if(cl == Enum ? o.__ename__ != null : false) { - return true; - } - return o.__enum__ != null ? $hxEnums[o.__enum__] == cl : false; - } -}; -js_Boot.__downcastCheck = function(o,cl) { - if(!((o) instanceof cl)) { - if(cl.__isInterface__) { - return js_Boot.__interfLoop(js_Boot.getClass(o),cl); - } else { - return false; - } - } else { - return true; - } -}; -js_Boot.__implements = function(o,iface) { - return js_Boot.__interfLoop(js_Boot.getClass(o),iface); -}; -js_Boot.__cast = function(o,t) { - if(o == null || js_Boot.__instanceof(o,t)) { - return o; - } else { - throw new js__$Boot_HaxeError("Cannot cast " + Std.string(o) + " to " + Std.string(t)); - } -}; -js_Boot.__toStr = null; -js_Boot.__nativeClassName = function(o) { - var name = js_Boot.__toStr.call(o).slice(8,-1); - if(name == "Object" || name == "Function" || name == "Math" || name == "JSON") { - return null; - } - return name; -}; -js_Boot.__isNativeObj = function(o) { - return js_Boot.__nativeClassName(o) != null; -}; -js_Boot.__resolveNativeClass = function(name) { - return $global[name]; -}; -var js_Browser = function() { }; -$hxClasses["js.Browser"] = js_Browser; -js_Browser.__name__ = "js.Browser"; -js_Browser.getLocalStorage = function() { - try { - var s = window.localStorage; - s.getItem(""); - if(s.length == 0) { - var key = "_hx_" + Math.random(); - s.setItem(key,key); - s.removeItem(key); - } - return s; - } catch( e ) { - var e1 = ((e) instanceof js__$Boot_HaxeError) ? e.val : e; - return null; - } -}; -js_Browser.getSessionStorage = function() { - try { - var s = window.sessionStorage; - s.getItem(""); - if(s.length == 0) { - var key = "_hx_" + Math.random(); - s.setItem(key,key); - s.removeItem(key); - } - return s; - } catch( e ) { - var e1 = ((e) instanceof js__$Boot_HaxeError) ? e.val : e; - return null; - } -}; -js_Browser.createXMLHttpRequest = function() { - if(typeof XMLHttpRequest != "undefined") { - return new XMLHttpRequest(); - } - if(typeof ActiveXObject != "undefined") { - return new ActiveXObject("Microsoft.XMLHTTP"); - } - throw new js__$Boot_HaxeError("Unable to create XMLHttpRequest object."); -}; -js_Browser.alert = function(v) { - window.alert(Std.string(v)); -}; -var js_Lib = function() { }; -$hxClasses["js.Lib"] = js_Lib; -js_Lib.__name__ = "js.Lib"; -js_Lib.__properties__ = {get_undefined:"get_undefined"}; -js_Lib.debug = function() { - debugger; -}; -js_Lib.alert = function(v) { - alert(js_Boot.__string_rec(v,"")); -}; -js_Lib.eval = function(code) { - return eval(code); -}; -js_Lib.get_undefined = function() { - return undefined; -}; -js_Lib.rethrow = function() { -}; -js_Lib.getOriginalException = function() { - return null; -}; -js_Lib.getNextHaxeUID = function() { - return $global.$haxeUID++; -}; -var js_html__$CanvasElement_CanvasUtil = function() { }; -$hxClasses["js.html._CanvasElement.CanvasUtil"] = js_html__$CanvasElement_CanvasUtil; -js_html__$CanvasElement_CanvasUtil.__name__ = "js.html._CanvasElement.CanvasUtil"; -js_html__$CanvasElement_CanvasUtil.getContextWebGL = function(canvas,attribs) { - var name = "webgl"; - var ctx = canvas.getContext(name,attribs); - if(ctx != null) { - return ctx; - } - var name1 = "experimental-webgl"; - var ctx1 = canvas.getContext(name1,attribs); - if(ctx1 != null) { - return ctx1; - } - return null; -}; -var js_lib__$ArrayBuffer_ArrayBufferCompat = function() { }; -$hxClasses["js.lib._ArrayBuffer.ArrayBufferCompat"] = js_lib__$ArrayBuffer_ArrayBufferCompat; -js_lib__$ArrayBuffer_ArrayBufferCompat.__name__ = "js.lib._ArrayBuffer.ArrayBufferCompat"; -js_lib__$ArrayBuffer_ArrayBufferCompat.sliceImpl = function(begin,end) { - var u = new Uint8Array(this,begin,end == null ? null : end - begin); - var resultArray = new Uint8Array(u.byteLength); - resultArray.set(u); - return resultArray.buffer; -}; -var js_lib__$Object_ObjectEntry_$Impl_$ = {}; -$hxClasses["js.lib._Object.ObjectEntry_Impl_"] = js_lib__$Object_ObjectEntry_$Impl_$; -js_lib__$Object_ObjectEntry_$Impl_$.__name__ = "js.lib._Object.ObjectEntry_Impl_"; -js_lib__$Object_ObjectEntry_$Impl_$.__properties__ = {get_value:"get_value",get_key:"get_key"}; -js_lib__$Object_ObjectEntry_$Impl_$.get_key = function(this1) { - return this1[0]; -}; -js_lib__$Object_ObjectEntry_$Impl_$.get_value = function(this1) { - return this1[1]; -}; -var model_attribute_AttrValue = function() { }; -$hxClasses["model.attribute.AttrValue"] = model_attribute_AttrValue; -model_attribute_AttrValue.__name__ = "model.attribute.AttrValue"; -model_attribute_AttrValue.__isInterface__ = true; -model_attribute_AttrValue.prototype = { - getvalue: null - ,getType: null - ,__class__: model_attribute_AttrValue -}; -var model_attribute_Attribute = function() { }; -$hxClasses["model.attribute.Attribute"] = model_attribute_Attribute; -model_attribute_Attribute.__name__ = "model.attribute.Attribute"; -model_attribute_Attribute.__isInterface__ = true; -model_attribute_Attribute.prototype = { - getdefaultvalue: null - ,getAttrType: null - ,getName: null - ,__class__: model_attribute_Attribute -}; -var model_attribute_Pair = function() { }; -$hxClasses["model.attribute.Pair"] = model_attribute_Pair; -model_attribute_Pair.__name__ = "model.attribute.Pair"; -model_attribute_Pair.__isInterface__ = true; -model_attribute_Pair.prototype = { - getAttr: null - ,getAttrValue: null - ,canupdate: null - ,update: null - ,__class__: model_attribute_Pair -}; -var model_attribute_DelayPair = function(da,dv) { - this.delayAttr = da; - this.delayValue = js_Boot.__cast(dv , model_attribute_IntValue); -}; -$hxClasses["model.attribute.DelayPair"] = model_attribute_DelayPair; -model_attribute_DelayPair.__name__ = "model.attribute.DelayPair"; -model_attribute_DelayPair.__interfaces__ = [model_attribute_Pair]; -model_attribute_DelayPair.prototype = { - delayAttr: null - ,delayValue: null - ,getAttr: function() { - return this.delayAttr; - } - ,getAttrValue: function() { - return this.delayValue; - } - ,canupdate: function(c,n) { - if(!((n) instanceof model_attribute_IntValue)) { - return false; - } - if(n.getvalue() < 0 || n.getvalue() == null) { - return false; - } else { - return true; - } - } - ,update: function(c,n) { - if(this.canupdate(c,n) == true) { - this.delayValue = js_Boot.__cast(n , model_attribute_IntValue); - return true; - } - return false; - } - ,__class__: model_attribute_DelayPair -}; -var model_attribute_IntAttr = function(s) { - this.defaultdelay = new model_attribute_IntValue(0); - this.name = "delay"; - this.name = s; - this.attrType = model_enumeration_AttrType.INT; -}; -$hxClasses["model.attribute.IntAttr"] = model_attribute_IntAttr; -model_attribute_IntAttr.__name__ = "model.attribute.IntAttr"; -model_attribute_IntAttr.__interfaces__ = [model_attribute_Attribute]; -model_attribute_IntAttr.prototype = { - name: null - ,attrType: null - ,defaultdelay: null - ,getName: function() { - return this.name; - } - ,getdefaultvalue: function() { - return this.defaultdelay; - } - ,getAttrType: function() { - return this.attrType; - } - ,__class__: model_attribute_IntAttr -}; -var model_attribute_IntValue = function(d) { - this.delay = d; - this.attrType = model_enumeration_AttrType.INT; -}; -$hxClasses["model.attribute.IntValue"] = model_attribute_IntValue; -model_attribute_IntValue.__name__ = "model.attribute.IntValue"; -model_attribute_IntValue.__interfaces__ = [model_attribute_AttrValue]; -model_attribute_IntValue.prototype = { - delay: null - ,attrType: null - ,getvalue: function() { - return this.delay; - } - ,getType: function() { - return this.attrType; - } - ,__class__: model_attribute_IntValue -}; -var model_attribute_NamePair = function(na,nv) { - this.nameAttr = na; - this.nameValue = js_Boot.__cast(nv , model_attribute_StringValue); -}; -$hxClasses["model.attribute.NamePair"] = model_attribute_NamePair; -model_attribute_NamePair.__name__ = "model.attribute.NamePair"; -model_attribute_NamePair.__interfaces__ = [model_attribute_Pair]; -model_attribute_NamePair.prototype = { - nameAttr: null - ,nameValue: null - ,getAttr: function() { - return this.nameAttr; - } - ,getAttrValue: function() { - return this.nameValue; - } - ,canupdate: function(c,n) { - return true; - } - ,update: function(c,n) { - if(this.canupdate(c,n) == true) { - this.nameValue = js_Boot.__cast(n , model_attribute_StringValue); - return true; - } - return false; - } - ,__class__: model_attribute_NamePair -}; -var model_attribute_OrientationAttr = function() { - this.name = "orientation"; - this.attrType = model_enumeration_AttrType.Orientation; - this.defaultOrientation = new model_attribute_OrientationValue(model_enumeration_ORIENTATION.EAST); -}; -$hxClasses["model.attribute.OrientationAttr"] = model_attribute_OrientationAttr; -model_attribute_OrientationAttr.__name__ = "model.attribute.OrientationAttr"; -model_attribute_OrientationAttr.__interfaces__ = [model_attribute_Attribute]; -model_attribute_OrientationAttr.prototype = { - name: null - ,attrType: null - ,defaultOrientation: null - ,getName: function() { - return this.name; - } - ,getdefaultvalue: function() { - return this.defaultOrientation; - } - ,getAttrType: function() { - return this.attrType; - } - ,__class__: model_attribute_OrientationAttr -}; -var model_attribute_OrientationPair = function(na,nv) { - this.orientationAttr = na; - this.orientationValue = js_Boot.__cast(nv , model_attribute_OrientationValue); -}; -$hxClasses["model.attribute.OrientationPair"] = model_attribute_OrientationPair; -model_attribute_OrientationPair.__name__ = "model.attribute.OrientationPair"; -model_attribute_OrientationPair.__interfaces__ = [model_attribute_Pair]; -model_attribute_OrientationPair.prototype = { - orientationAttr: null - ,orientationValue: null - ,getAttr: function() { - return this.orientationAttr; - } - ,getAttrValue: function() { - return this.orientationValue; - } - ,canupdate: function(c,n) { - if(!((n) instanceof model_attribute_OrientationValue)) { - return false; - } - return true; - } - ,update: function(c,n) { - if(this.canupdate(c,n) == true) { - this.orientationValue = js_Boot.__cast(n , model_attribute_OrientationValue); - return true; - } - return false; - } - ,__class__: model_attribute_OrientationPair -}; -var model_attribute_OrientationValue = function(or) { - this.orientation = or; - this.attrType = model_enumeration_AttrType.Orientation; -}; -$hxClasses["model.attribute.OrientationValue"] = model_attribute_OrientationValue; -model_attribute_OrientationValue.__name__ = "model.attribute.OrientationValue"; -model_attribute_OrientationValue.__interfaces__ = [model_attribute_AttrValue]; -model_attribute_OrientationValue.prototype = { - orientation: null - ,attrType: null - ,getvalue: function() { - return this.orientation; - } - ,getType: function() { - return this.attrType; - } - ,__class__: model_attribute_OrientationValue -}; -var model_attribute_StringAttr = function(s) { - this.defaultname = new model_attribute_StringValue(""); - this.name = "name"; - this.name = s; - this.attrType = model_enumeration_AttrType.STRING; -}; -$hxClasses["model.attribute.StringAttr"] = model_attribute_StringAttr; -model_attribute_StringAttr.__name__ = "model.attribute.StringAttr"; -model_attribute_StringAttr.__interfaces__ = [model_attribute_Attribute]; -model_attribute_StringAttr.prototype = { - name: null - ,attrType: null - ,defaultname: null - ,getName: function() { - return this.name; - } - ,getdefaultvalue: function() { - return this.defaultname; - } - ,getAttrType: function() { - return this.attrType; - } - ,__class__: model_attribute_StringAttr -}; -var model_attribute_StringValue = function(s) { - this.name = s; -}; -$hxClasses["model.attribute.StringValue"] = model_attribute_StringValue; -model_attribute_StringValue.__name__ = "model.attribute.StringValue"; -model_attribute_StringValue.__interfaces__ = [model_attribute_AttrValue]; -model_attribute_StringValue.prototype = { - name: null - ,getvalue: function() { - return this.name; - } - ,getType: function() { - return model_enumeration_AttrType.STRING; - } - ,__class__: model_attribute_StringValue -}; -var model_observe_Observer = function() { -}; -$hxClasses["model.observe.Observer"] = model_observe_Observer; -model_observe_Observer.__name__ = "model.observe.Observer"; -model_observe_Observer.prototype = { - update: function(c,data) { - } - ,__class__: model_observe_Observer -}; -var model_component_CircuitDiagramI = function() { }; -$hxClasses["model.component.CircuitDiagramI"] = model_component_CircuitDiagramI; -model_component_CircuitDiagramI.__name__ = "model.component.CircuitDiagramI"; -model_component_CircuitDiagramI.__isInterface__ = true; -model_component_CircuitDiagramI.prototype = { - get_componentIterator: null - ,get_componentReverseIterator: null - ,get_linkReverseIterator: null - ,get_linkIterator: null - ,get_name: null - ,set_name: null - ,addLink: null - ,addComponent: null - ,removeLink: null - ,removeComponent: null - ,setNewOirentation: null - ,deleteLink: null - ,deleteComponent: null - ,componentSetName: null - ,computeDiagramSize: null - ,get_diagramWidth: null - ,get_diagramHeight: null - ,get_xMin: null - ,get_yMin: null - ,get_xMax: null - ,get_yMax: null - ,getComponentAndLinkCenterCoordinate: null - ,draw: null - ,findHitList: null - ,findWorldPoint: null - ,isEmpty: null - ,__class__: model_component_CircuitDiagramI -}; -var model_component_CircuitDiagram = function() { - this.linkArrayReverseFlag = false; - this.componentArrayReverseFlag = false; - this.linkArray = []; - this.componentArray = []; - model_observe_Observer.call(this); - this.componentAndLinkCenter = new type_Coordinate(0,0); - this.margin = 50; -}; -$hxClasses["model.component.CircuitDiagram"] = model_component_CircuitDiagram; -model_component_CircuitDiagram.__name__ = "model.component.CircuitDiagram"; -model_component_CircuitDiagram.__interfaces__ = [model_component_CircuitDiagramI]; -model_component_CircuitDiagram.__super__ = model_observe_Observer; -model_component_CircuitDiagram.prototype = $extend(model_observe_Observer.prototype,{ - Obable: null - ,componentArray: null - ,linkArray: null - ,name: null - ,componentArrayReverseFlag: null - ,linkArrayReverseFlag: null - ,diagramWidth: null - ,diagramHeight: null - ,xMin: null - ,yMin: null - ,xMax: null - ,yMax: null - ,margin: null - ,componentAndLinkCenter: null - ,computeDiagramSize: function() { - this.xMin = 99999999; - this.yMin = 99999999; - this.xMax = 0; - this.yMax = 0; - var _g = 0; - var _g1 = this.componentArray; - while(_g < _g1.length) { - var i = _g1[_g]; - ++_g; - if(i.get_xPosition() - i.get_width() / 2 < this.xMin) { - this.xMin = i.get_xPosition() - i.get_width() / 2; - } - if(i.get_xPosition() + i.get_width() / 2 > this.xMax) { - this.xMax = i.get_xPosition() + i.get_width() / 2; - } - if(i.get_yPosition() - i.get_height() / 2 < this.yMin) { - this.yMin = i.get_yPosition() - i.get_height() / 2; - } - if(i.get_yPosition() + i.get_height() / 2 > this.yMax) { - this.yMax = i.get_yPosition() + i.get_height() / 2; - } - } - var _g2 = 0; - var _g3 = this.linkArray; - while(_g2 < _g3.length) { - var i1 = _g3[_g2]; - ++_g2; - if(i1.get_leftEndpoint().get_xPosition() < this.xMin) { - this.xMin = i1.get_leftEndpoint().get_xPosition(); - } - if(i1.get_leftEndpoint().get_xPosition() > this.xMax) { - this.xMax = i1.get_leftEndpoint().get_xPosition(); - } - if(i1.get_leftEndpoint().get_yPosition() < this.yMin) { - this.yMin = i1.get_leftEndpoint().get_yPosition(); - } - if(i1.get_leftEndpoint().get_yPosition() > this.yMax) { - this.yMax = i1.get_leftEndpoint().get_yPosition(); - } - if(i1.get_rightEndpoint().get_xPosition() < this.xMin) { - this.xMin = i1.get_rightEndpoint().get_xPosition(); - } - if(i1.get_rightEndpoint().get_xPosition() > this.xMax) { - this.xMax = i1.get_rightEndpoint().get_xPosition(); - } - if(i1.get_rightEndpoint().get_yPosition() < this.yMin) { - this.yMin = i1.get_rightEndpoint().get_yPosition(); - } - if(i1.get_rightEndpoint().get_yPosition() > this.yMax) { - this.yMax = i1.get_rightEndpoint().get_yPosition(); - } - } - this.componentAndLinkCenter.set_xPosition((this.xMin + this.xMax) / 2); - this.componentAndLinkCenter.set_yPosition((this.yMin + this.yMax) / 2); - this.diagramWidth = this.xMax - this.xMin + this.margin; - this.diagramHeight = this.yMax - this.yMin + this.margin; - if(this.diagramHeight > this.diagramWidth) { - this.diagramWidth = this.diagramHeight; - } else { - this.diagramHeight = this.diagramWidth; - } - } - ,getComponentAndLinkCenterCoordinate: function() { - return this.componentAndLinkCenter; - } - ,get_diagramWidth: function() { - return this.diagramWidth; - } - ,get_diagramHeight: function() { - return this.diagramHeight; - } - ,get_xMin: function() { - return this.xMin; - } - ,get_yMin: function() { - return this.yMin; - } - ,get_xMax: function() { - return this.xMax; - } - ,get_yMax: function() { - return this.yMax; - } - ,get_componentIterator: function() { - if(this.componentArrayReverseFlag) { - this.componentArrayReverse(); - } - return HxOverrides.iter(this.componentArray); - } - ,get_componentReverseIterator: function() { - if(!this.componentArrayReverseFlag) { - this.componentArrayReverse(); - } - return HxOverrides.iter(this.componentArray); - } - ,componentArrayReverse: function() { - this.componentArrayReverseFlag = !this.componentArrayReverseFlag; - this.componentArray.reverse(); - } - ,get_linkIterator: function() { - if(this.linkArrayReverseFlag) { - this.linkArrayReverse(); - } - return HxOverrides.iter(this.linkArray); - } - ,get_linkReverseIterator: function() { - if(!this.linkArrayReverseFlag) { - this.linkArrayReverse(); - } - return HxOverrides.iter(this.linkArray); - } - ,linkArrayReverse: function() { - this.linkArrayReverseFlag = !this.linkArrayReverseFlag; - this.linkArray.reverse(); - } - ,get_name: function() { - return this.name; - } - ,set_name: function(value) { - this.name = value; - } - ,addLink: function(link) { - this.linkArray.push(link); - } - ,addComponent: function(component) { - this.componentArray.push(component); - component.addObserver(this); - } - ,removeLink: function(link) { - HxOverrides.remove(this.linkArray,link); - } - ,removeComponent: function(component) { - HxOverrides.remove(this.componentArray,component); - } - ,setNewOirentation: function(component,newOrientation) { - var _g = 0; - var _g1 = this.componentArray.length; - while(_g < _g1) { - var i = _g++; - if(component == this.componentArray[i]) { - this.componentArray[i].set_orientation(newOrientation); - this.componentArray[i].updateMoveComponentPortPosition(this.componentArray[i].get_xPosition(),this.componentArray[i].get_yPosition()); - this.linkArraySelfUpdate(); - break; - } - } - } - ,deleteLink: function(link) { - HxOverrides.remove(this.linkArray,link); - } - ,deleteComponent: function(component) { - HxOverrides.remove(this.componentArray,component); - var i = component.get_inportIterator(); - while(i.hasNext()) { - var i1 = i.next(); - var _g = 0; - var _g1 = this.linkArray.length; - while(_g < _g1) { - var j = _g++; - if(i1 == this.linkArray[j].get_leftEndpoint().get_port()) { - this.linkArray[j].get_leftEndpoint().set_port(null); - } - if(i1 == this.linkArray[j].get_rightEndpoint().get_port()) { - this.linkArray[j].get_rightEndpoint().set_port(null); - } - } - } - var i2 = component.get_outportIterator(); - while(i2.hasNext()) { - var i3 = i2.next(); - var _g2 = 0; - var _g11 = this.linkArray.length; - while(_g2 < _g11) { - var j1 = _g2++; - if(i3 == this.linkArray[j1].get_leftEndpoint().get_port()) { - this.linkArray[j1].get_leftEndpoint().set_port(null); - } - if(i3 == this.linkArray[j1].get_rightEndpoint().get_port()) { - this.linkArray[j1].get_rightEndpoint().set_port(null); - } - } - } - } - ,linkArraySelfUpdate: function() { - var _g = 0; - var _g1 = this.linkArray.length; - while(_g < _g1) { - var i = _g++; - this.linkArray[i].get_leftEndpoint().updatePosition(); - this.linkArray[i].get_rightEndpoint().updatePosition(); - } - } - ,componentSetName: function(component,name) { - this.componentArray[this.componentArray.indexOf(component)].set_name(name); - } - ,draw: function(drawingAdapter,linkAndComponentArray) { - var drawFlag = false; - var _g = 0; - var _g1 = this.componentArray; - while(_g < _g1.length) { - var i = _g1[_g]; - ++_g; - if(linkAndComponentArray != null && linkAndComponentArray.getComponentIteratorLength() != 0) { - var j = linkAndComponentArray.get_componentIterator(); - while(j.hasNext()) { - var j1 = j.next(); - if(j1 == i) { - i.drawComponent(drawingAdapter,true); - drawFlag = true; - } - } - } - if(!drawFlag) { - if(i.getNameOfTheComponentKind() != "CC") { - i.drawComponent(drawingAdapter,false); - } else { - i.drawComponent(drawingAdapter,false,linkAndComponentArray); - } - } - drawFlag = false; - } - drawFlag = false; - var _g2 = 0; - var _g3 = this.linkArray; - while(_g2 < _g3.length) { - var i1 = _g3[_g2]; - ++_g2; - if(linkAndComponentArray != null && linkAndComponentArray.getLinkIteratorLength() != 0) { - var j2 = linkAndComponentArray.get_linkIterator(); - while(j2.hasNext()) { - var j3 = j2.next(); - if(j3 == i1) { - i1.drawLink(drawingAdapter,true); - drawFlag = true; - } - } - } - if(!drawFlag) { - i1.drawLink(drawingAdapter,false); - } - drawFlag = false; - } - } - ,findHitList: function(coordinate,mode) { - var hitObjectArray = []; - var hitLinkArray = []; - var _g = 0; - var _g1 = this.linkArray; - while(_g < _g1.length) { - var i = _g1[_g]; - ++_g; - hitLinkArray = i.findHitList(coordinate,mode); - var _g2 = 0; - while(_g2 < hitLinkArray.length) { - var j = hitLinkArray[_g2]; - ++_g2; - j.set_circuitDiagram(this); - hitObjectArray.push(j); - } - } - var result = []; - var _g21 = 0; - var _g3 = this.componentArray; - while(_g21 < _g3.length) { - var i1 = _g3[_g21]; - ++_g21; - result = i1.findHitList(coordinate,mode); - var _g22 = 0; - while(_g22 < result.length) { - var j1 = result[_g22]; - ++_g22; - if(j1.get_circuitDiagram() == null) { - j1.set_circuitDiagram(this); - } - hitObjectArray.push(j1); - } - } - return hitObjectArray; - } - ,findWorldPoint: function(worldCoordinate,mode) { - var worldPointArray = []; - var _g = 0; - var _g1 = this.componentArray; - while(_g < _g1.length) { - var i = _g1[_g]; - ++_g; - var tempWorldPointArray = i.findWorldPoint(worldCoordinate,mode); - var _g2 = 0; - while(_g2 < tempWorldPointArray.length) { - var j = tempWorldPointArray[_g2]; - ++_g2; - worldPointArray.push(j); - } - if(worldPointArray.length != 0) { - break; - } - } - if(worldPointArray.length == 0 || mode == model_enumeration_POINT_$MODE.PATH) { - worldPointArray.push(new type_WorldPoint(this,worldCoordinate)); - } - return worldPointArray; - } - ,isEmpty: function() { - if(this.componentArray.length == 0 && this.linkArray.length == 0) { - return true; - } else { - return false; - } - } - ,__class__: model_component_CircuitDiagram -}); -var model_observe_Observable = function() { - this.observers = []; -}; -$hxClasses["model.observe.Observable"] = model_observe_Observable; -model_observe_Observable.__name__ = "model.observe.Observable"; -model_observe_Observable.prototype = { - observers: null - ,addObserver: function(obs) { - if(obs == null) { - return false; - } else { - this.observers.push(obs); - return true; - } - } - ,removeObserver: function(obs) { - return HxOverrides.remove(this.observers,obs); - } - ,notifyObservers: function(c,data) { - var _g = 0; - var _g1 = this.observers; - while(_g < _g1.length) { - var n = _g1[_g]; - ++_g; - n.update(c,data); - } - } - ,__class__: model_observe_Observable -}; -var model_component_Component = function(xPosition,yPosition,height,width,orientation,componentKind,inportNum) { - this.list = new haxe_ds_StringMap(); - this.outportArray = []; - this.inportArray = []; - model_observe_Observable.call(this); - this.xPosition = xPosition; - this.yPosition = yPosition; - this.height = height; - this.width = width; - this.componentKind = componentKind; - this.componentKind.set_component(this); - this.inportsNum = inportNum; - this.boxType = model_enumeration_BOX.WHITE_BOX; - var portArray = []; - portArray = this.componentKind.createPorts(xPosition,yPosition,width,height,orientation,inportNum); - var _g = 0; - var _g1 = portArray.length; - while(_g < _g1) { - var o = _g++; - var port = portArray[o]; - if(port.get_portDescription() == model_enumeration_IOTYPE.INPUT || port.get_portDescription() == model_enumeration_IOTYPE.CLK || port.get_portDescription() == model_enumeration_IOTYPE.D || port.get_portDescription() == model_enumeration_IOTYPE.S) { - this.inportArray.push(port); - } else { - this.outportArray.push(port); - } - } - var _g2 = 0; - var _g3 = componentKind.getAttr(); - while(_g2 < _g3.length) { - var n = _g3[_g2]; - ++_g2; - if(n.getName() == "delay") { - var this1 = this.list; - var key = n.getName(); - var value = new model_attribute_DelayPair(js_Boot.__cast(n , model_attribute_IntAttr),(js_Boot.__cast(n , model_attribute_IntAttr)).getdefaultvalue()); - var _this = this1; - if(__map_reserved[key] != null) { - _this.setReserved(key,value); - } else { - _this.h[key] = value; - } - } else if(n.getName() == "name") { - var this2 = this.list; - var key1 = n.getName(); - var value1 = new model_attribute_NamePair(js_Boot.__cast(n , model_attribute_StringAttr),(js_Boot.__cast(n , model_attribute_StringAttr)).getdefaultvalue()); - var _this1 = this2; - if(__map_reserved[key1] != null) { - _this1.setReserved(key1,value1); - } else { - _this1.h[key1] = value1; - } - } else if(n.getName() == "orientation") { - var this3 = this.list; - var key2 = n.getName(); - var value2 = new model_attribute_OrientationPair(js_Boot.__cast(n , model_attribute_OrientationAttr),(js_Boot.__cast(n , model_attribute_OrientationAttr)).getdefaultvalue()); - var _this2 = this3; - if(__map_reserved[key2] != null) { - _this2.setReserved(key2,value2); - } else { - _this2.h[key2] = value2; - } - } - } - var _this3 = this.list; - (__map_reserved["orientation"] != null ? _this3.getReserved("orientation") : _this3.h["orientation"]).update(this,new model_attribute_OrientationValue(orientation)); -}; -$hxClasses["model.component.Component"] = model_component_Component; -model_component_Component.__name__ = "model.component.Component"; -model_component_Component.__super__ = model_observe_Observable; -model_component_Component.prototype = $extend(model_observe_Observable.prototype,{ - xPosition: null - ,yPosition: null - ,height: null - ,width: null - ,componentKind: null - ,inportArray: null - ,outportArray: null - ,inportsNum: null - ,boxType: null - ,list: null - ,cd: null - ,getmap: function() { - return this.list; - } - ,hasAttr: function(s) { - var _this = this.list; - if(__map_reserved[s] != null) { - return _this.existsReserved(s); - } else { - return _this.h.hasOwnProperty(s); - } - } - ,getAttr: function(s) { - var _tmp0 = this.list; - var _e = _tmp0; - var _tmp1 = function(key) { - if(__map_reserved[key] != null) { - return _e.existsReserved(key); - } else { - return _e.h.hasOwnProperty(key); - } - }; - var _tmp2 = s; - var _tmp3 = _tmp1(_tmp2); - if(!_tmp3) { - var e = new assertions_AssertionFailure("list.exists(s)",[{ expr : "list", value : _tmp0},{ expr : "list.exists", value : _tmp1},{ expr : "s", value : _tmp2},{ expr : "list.exists(s)", value : _tmp3}]); - haxe_Log.trace("Throwing exception " + Std.string(e),{ fileName : "src/model/component/Component.hx", lineNumber : 109, className : "model.component.Component", methodName : "getAttr"}); - throw new js__$Boot_HaxeError(e); - } - var _this = this.list; - return (__map_reserved[s] != null ? _this.getReserved(s) : _this.h[s]).getAttrValue(); - } - ,getAttrInt: function(s) { - var _tmp0 = this.list; - var _e = _tmp0; - var _tmp1 = function(key) { - if(__map_reserved[key] != null) { - return _e.existsReserved(key); - } else { - return _e.h.hasOwnProperty(key); - } - }; - var _tmp2 = s; - var _tmp3 = _tmp1(_tmp2); - if(!_tmp3) { - var e = new assertions_AssertionFailure("list.exists(s)",[{ expr : "list", value : _tmp0},{ expr : "list.exists", value : _tmp1},{ expr : "s", value : _tmp2},{ expr : "list.exists(s)", value : _tmp3}]); - haxe_Log.trace("Throwing exception " + Std.string(e),{ fileName : "src/model/component/Component.hx", lineNumber : 114, className : "model.component.Component", methodName : "getAttrInt"}); - throw new js__$Boot_HaxeError(e); - } - var _this = this.list; - return (__map_reserved[s] != null ? _this.getReserved(s) : _this.h[s]).getAttrValue().getvalue(); - } - ,canupdate: function(s,v) { - var _tmp0 = this.list; - var _e = _tmp0; - var _tmp1 = function(key) { - if(__map_reserved[key] != null) { - return _e.existsReserved(key); - } else { - return _e.h.hasOwnProperty(key); - } - }; - var _tmp2 = s; - var _tmp3 = _tmp1(_tmp2); - if(!_tmp3) { - var e = new assertions_AssertionFailure("list.exists(s)",[{ expr : "list", value : _tmp0},{ expr : "list.exists", value : _tmp1},{ expr : "s", value : _tmp2},{ expr : "list.exists(s)", value : _tmp3}]); - haxe_Log.trace("Throwing exception " + Std.string(e),{ fileName : "src/model/component/Component.hx", lineNumber : 119, className : "model.component.Component", methodName : "canupdate"}); - throw new js__$Boot_HaxeError(e); - } - var _this = this.list; - if(__map_reserved[s] != null ? _this.existsReserved(s) : _this.h.hasOwnProperty(s)) { - var _this1 = this.list; - return (__map_reserved[s] != null ? _this1.getReserved(s) : _this1.h[s]).canupdate(this,v); - } - return false; - } - ,update: function(s,v) { - var _tmp0 = this.list; - var _e = _tmp0; - var _tmp1 = function(key) { - if(__map_reserved[key] != null) { - return _e.existsReserved(key); - } else { - return _e.h.hasOwnProperty(key); - } - }; - var _tmp2 = s; - var _tmp3 = _tmp1(_tmp2); - if(!_tmp3) { - var e = new assertions_AssertionFailure("list.exists(s)",[{ expr : "list", value : _tmp0},{ expr : "list.exists", value : _tmp1},{ expr : "s", value : _tmp2},{ expr : "list.exists(s)", value : _tmp3}]); - haxe_Log.trace("Throwing exception " + Std.string(e),{ fileName : "src/model/component/Component.hx", lineNumber : 127, className : "model.component.Component", methodName : "update"}); - throw new js__$Boot_HaxeError(e); - } - var _this = this.list; - if(__map_reserved[s] != null ? _this.existsReserved(s) : _this.h.hasOwnProperty(s)) { - var _this1 = this.list; - if((__map_reserved[s] != null ? _this1.getReserved(s) : _this1.h[s]).canupdate(this,v)) { - var _this2 = this.list; - return (__map_reserved[s] != null ? _this2.getReserved(s) : _this2.h[s]).update(this,v); - } - } - return false; - } - ,get_CircuitDiagram: function() { - return this.cd; - } - ,get_xPosition: function() { - return this.xPosition; - } - ,set_xPosition: function(value) { - return this.xPosition = value; - } - ,get_yPosition: function() { - return this.yPosition; - } - ,set_yPosition: function(value) { - return this.yPosition = value; - } - ,get_orientation: function() { - var _this = this.list; - return (__map_reserved["orientation"] != null ? _this.getReserved("orientation") : _this.h["orientation"]).getAttrValue().getvalue(); - } - ,set_orientation: function(value) { - var _this = this.list; - (__map_reserved["orientation"] != null ? _this.getReserved("orientation") : _this.h["orientation"]).update(this,new model_attribute_OrientationValue(value)); - } - ,get_componentKind: function() { - return this.componentKind; - } - ,set_componentKind: function(value) { - return this.componentKind = value; - } - ,get_boxType: function() { - return this.boxType; - } - ,set_boxType: function(value) { - this.boxType = value; - } - ,get_inportIterator: function() { - return HxOverrides.iter(this.inportArray); - } - ,get_inportIteratorLength: function() { - return this.inportArray.length; - } - ,get_outportIteratorLength: function() { - return this.outportArray.length; - } - ,get_outportIterator: function() { - return HxOverrides.iter(this.outportArray); - } - ,get_name: function() { - var _this = this.list; - return (__map_reserved["name"] != null ? _this.getReserved("name") : _this.h["name"]).getAttrValue().getvalue(); - } - ,set_name: function(value) { - var _this = this.list; - (__map_reserved["name"] != null ? _this.getReserved("name") : _this.h["name"]).update(this,new model_attribute_StringValue(value)); - } - ,get_height: function() { - return this.height; - } - ,set_height: function(value) { - return this.height = value; - } - ,get_width: function() { - return this.width; - } - ,set_width: function(value) { - return this.width = value; - } - ,get_inportsNum: function() { - return this.inportsNum; - } - ,setNameOfTheComponentKind: function(name) { - } - ,getNameOfTheComponentKind: function() { - return this.componentKind.getname(); - } - ,removeInport: function(inport) { - return HxOverrides.remove(this.inportArray,inport); - } - ,updateMoveComponentPortPosition: function(xPosition,yPosition) { - var _this = this.list; - this.inportArray = this.componentKind.updateInPortPosition(this.inportArray,xPosition,yPosition,this.height,this.width,(__map_reserved["orientation"] != null ? _this.getReserved("orientation") : _this.h["orientation"]).getAttrValue().getvalue()); - var _this1 = this.list; - this.outportArray = this.componentKind.updateOutPortPosition(this.outportArray,xPosition,yPosition,this.height,this.width,(__map_reserved["orientation"] != null ? _this1.getReserved("orientation") : _this1.h["orientation"]).getAttrValue().getvalue()); - return this; - } - ,drawComponent: function(drawingAdpater,highLight,linkAndComponentArray) { - if(this.componentKind.checkInnerCircuitDiagramPortsChange()) { - var i = this.componentKind.getInnerCircuitDiagram().get_componentIterator(); - while(i.hasNext()) { - var i1 = i.next(); - var inputFlag = false; - var outputFlag = false; - var _g = 0; - var _g1 = this.inportArray; - while(_g < _g1.length) { - var j = _g1[_g]; - ++_g; - if(i1.getNameOfTheComponentKind() == "Input") { - if(i1.get_componentKind().get_sequence() == j.get_sequence()) { - inputFlag = true; - } - } - } - var _g2 = 0; - var _g3 = this.outportArray; - while(_g2 < _g3.length) { - var j1 = _g3[_g2]; - ++_g2; - if(i1.getNameOfTheComponentKind() == "Output") { - if(i1.get_componentKind().get_sequence() == j1.get_sequence()) { - outputFlag = true; - } - } - } - if(!inputFlag && !outputFlag) { - if(i1.getNameOfTheComponentKind() == "Input") { - var port = this.componentKind.addInPort(); - port.set_sequence(i1.get_componentKind().get_sequence()); - this.inportArray.push(port); - } else { - var port1 = this.componentKind.addOutPort(); - port1.set_sequence(i1.get_componentKind().get_sequence()); - this.outportArray.push(port1); - } - } - } - var _g4 = 0; - var _g11 = this.inportArray; - while(_g4 < _g11.length) { - var i2 = _g11[_g4]; - ++_g4; - var flag_delete = true; - var j2 = this.componentKind.getInnerCircuitDiagram().get_componentIterator(); - while(j2.hasNext()) { - var j3 = j2.next(); - if(i2.get_sequence() == j3.get_componentKind().get_sequence() && j3.getNameOfTheComponentKind() == "Input") { - flag_delete = false; - } - } - if(flag_delete) { - HxOverrides.remove(this.inportArray,i2); - } - } - var _g21 = 0; - var _g31 = this.outportArray; - while(_g21 < _g31.length) { - var i3 = _g31[_g21]; - ++_g21; - var flag_delete1 = true; - var j4 = this.componentKind.getInnerCircuitDiagram().get_componentIterator(); - while(j4.hasNext()) { - var j5 = j4.next(); - if(i3.get_sequence() == j5.get_componentKind().get_sequence() && j5.getNameOfTheComponentKind() == "Output") { - flag_delete1 = false; - } - } - if(flag_delete1) { - HxOverrides.remove(this.outportArray,i3); - } - } - var _this = this.list; - this.componentKind.updateInPortPosition(this.inportArray,this.xPosition,this.yPosition,this.height,this.width,(__map_reserved["orientation"] != null ? _this.getReserved("orientation") : _this.h["orientation"]).getAttrValue().getvalue()); - var _this1 = this.list; - this.componentKind.updateOutPortPosition(this.outportArray,this.xPosition,this.yPosition,this.height,this.width,(__map_reserved["orientation"] != null ? _this1.getReserved("orientation") : _this1.h["orientation"]).getAttrValue().getvalue()); - } - if(this.componentKind.getname() != "CC") { - this.componentKind.drawComponent(drawingAdpater,highLight); - } else { - this.componentKind.drawComponent(drawingAdpater,highLight,linkAndComponentArray); - } - } - ,findHitList: function(coordinate,mode) { - return this.componentKind.findHitList(coordinate,mode); - } - ,findWorldPoint: function(coordinate,mode) { - return this.componentKind.findWorldPoint(coordinate,mode); - } - ,__class__: model_component_Component -}); -var model_component_Endpoint = function(xPosition,yPosition) { - this.xPosition = xPosition; - this.yPosition = yPosition; -}; -$hxClasses["model.component.Endpoint"] = model_component_Endpoint; -model_component_Endpoint.__name__ = "model.component.Endpoint"; -model_component_Endpoint.prototype = { - xPosition: null - ,yPosition: null - ,port: null - ,get_xPosition: function() { - return this.xPosition; - } - ,get_yPosition: function() { - return this.yPosition; - } - ,get_port: function() { - return this.port; - } - ,set_xPosition: function(value) { - return this.xPosition = value; - } - ,set_yPosition: function(value) { - return this.yPosition = value; - } - ,set_port: function(value) { - return this.port = value; - } - ,updatePosition: function() { - if(this.port != null) { - this.xPosition = this.port.get_xPosition(); - this.yPosition = this.port.get_yPosition(); - } - } - ,createJSon: function() { - var jsonString = "{ \"xPosition\": \"" + this.xPosition + "\","; - jsonString += "\"yPosition\": \"" + this.yPosition + "\""; - jsonString += "}"; - return jsonString; - } - ,__class__: model_component_Endpoint -}; -var model_component_Port = function() { }; -$hxClasses["model.component.Port"] = model_component_Port; -model_component_Port.__name__ = "model.component.Port"; -model_component_Port.__isInterface__ = true; -model_component_Port.prototype = { - get_xPosition: null - ,get_yPosition: null - ,set_xPosition: null - ,set_yPosition: null - ,get_value: null - ,set_value: null - ,get_portDescription: null - ,set_portDescription: null - ,get_sequence: null - ,set_sequence: null - ,createJSon: null - ,__class__: model_component_Port -}; -var model_component_Inport = function(xPosition,yPosition) { - this.sequence = -1; - this.xPosition = xPosition; - this.yPosition = yPosition; - this.portDescription = model_enumeration_IOTYPE.INPUT; -}; -$hxClasses["model.component.Inport"] = model_component_Inport; -model_component_Inport.__name__ = "model.component.Inport"; -model_component_Inport.__interfaces__ = [model_component_Port]; -model_component_Inport.prototype = { - xPosition: null - ,yPosition: null - ,portDescription: null - ,value: null - ,sequence: null - ,get_xPosition: function() { - return this.xPosition; - } - ,get_yPosition: function() { - return this.yPosition; - } - ,set_xPosition: function(xPosition) { - this.xPosition = xPosition; - } - ,set_yPosition: function(yPosition) { - this.yPosition = yPosition; - } - ,get_value: function() { - return this.value; - } - ,set_value: function(value) { - this.value = value; - } - ,get_portDescription: function() { - return this.portDescription; - } - ,set_portDescription: function(value) { - this.portDescription = value; - } - ,get_sequence: function() { - return this.sequence; - } - ,set_sequence: function(sequence) { - this.sequence = sequence; - } - ,createJSon: function() { - var jsonString = "{ \"xPosition\": \"" + this.xPosition + "\","; - jsonString += "\"yPosition\": \"" + this.yPosition + "\","; - jsonString += "\"portDescription\": \"" + Std.string(this.portDescription) + "\","; - jsonString += "\"value\": \"" + Std.string(this.value) + "\","; - jsonString += "\"sequence\": \"" + this.sequence + "\""; - jsonString += "}"; - return jsonString; - } - ,__class__: model_component_Inport -}; -var model_component_Link = function(leftEndpoint,rightEndpoint,circuitDiagram) { - this.leftEndpoint = leftEndpoint; - this.rightEndpoint = rightEndpoint; - this.circuitDiagram = circuitDiagram; -}; -$hxClasses["model.component.Link"] = model_component_Link; -model_component_Link.__name__ = "model.component.Link"; -model_component_Link.prototype = { - leftEndpoint: null - ,rightEndpoint: null - ,circuitDiagram: null - ,getLinkLength: function() { - return Math.sqrt(Math.pow(Math.abs(this.leftEndpoint.get_xPosition() - this.rightEndpoint.get_xPosition()),2) + Math.pow(Math.abs(this.leftEndpoint.get_yPosition() - this.rightEndpoint.get_yPosition()),2)); - } - ,getCircuitDiagram: function() { - return this.circuitDiagram; - } - ,setCircuitDiagram: function(circuitDiagram) { - this.circuitDiagram = circuitDiagram; - } - ,get_leftEndpoint: function() { - return this.leftEndpoint; - } - ,set_leftEndpoint: function(value) { - return this.leftEndpoint = value; - } - ,get_rightEndpoint: function() { - return this.rightEndpoint; - } - ,set_rightEndpoint: function(value) { - return this.rightEndpoint = value; - } - ,drawLink: function(drawingAdapter,highLight) { - var drawComponent = new view_drawComponents_DrawLink(this,drawingAdapter); - if(highLight) { - drawComponent.drawCorrespondingComponent("red"); - } else { - drawComponent.drawCorrespondingComponent("black"); - } - } - ,findHitList: function(coordinate,mode) { - var hitObjectArray = []; - var link = this.isOnLink(coordinate); - if(link != null) { - var hitObject = new type_HitObject(); - hitObject.set_link(link); - hitObjectArray.push(hitObject); - } - var endpoint = this.pointOnEndpoint(coordinate); - if(endpoint != null) { - var hitObject1 = new type_HitObject(); - hitObject1.set_endpoint(endpoint); - hitObjectArray.push(hitObject1); - } - return hitObjectArray; - } - ,pointOnEndpoint: function(coordinate) { - if(this.pointsDistance(this.leftEndpoint.get_xPosition(),this.leftEndpoint.get_yPosition(),coordinate.get_xPosition(),coordinate.get_yPosition()) <= global_Constant.pointToEndpointDistance) { - return this.leftEndpoint; - } - if(this.pointsDistance(this.rightEndpoint.get_xPosition(),this.rightEndpoint.get_yPosition(),coordinate.get_xPosition(),coordinate.get_yPosition()) <= global_Constant.pointToEndpointDistance) { - return this.rightEndpoint; - } - return null; - } - ,isOnLink: function(coordinate) { - if(this.pointToLine(this.leftEndpoint.get_xPosition(),this.leftEndpoint.get_yPosition(),this.rightEndpoint.get_xPosition(),this.rightEndpoint.get_yPosition(),coordinate.get_xPosition(),coordinate.get_yPosition()) <= global_Constant.pointToLineDistance) { - var theDistanaceToLeftEndpoint = Math.sqrt(Math.pow(Math.abs(coordinate.get_xPosition() - this.leftEndpoint.get_xPosition()),2) + Math.pow(Math.abs(coordinate.get_yPosition() - this.leftEndpoint.get_yPosition()),2)); - var theDistanceToRightEndpoint = Math.sqrt(Math.pow(Math.abs(coordinate.get_xPosition() - this.rightEndpoint.get_xPosition()),2) + Math.pow(Math.abs(coordinate.get_yPosition() - this.rightEndpoint.get_yPosition()),2)); - if(theDistanaceToLeftEndpoint >= theDistanceToRightEndpoint) { - if(theDistanceToRightEndpoint >= global_Constant.pointToEndpointDistance) { - return this; - } - } else if(theDistanaceToLeftEndpoint >= global_Constant.pointToEndpointDistance) { - return this; - } - } - return null; - } - ,pointToLine: function(x1,y1,x2,y2,x0,y0) { - var space = 0; - var a = this.pointsDistance(x1,y1,x2,y2); - var b = this.pointsDistance(x1,y1,x0,y0); - var c = this.pointsDistance(x2,y2,x0,y0); - if(c + b == a) { - space = 0; - return space; - } - if(a <= 0.00001) { - space = b; - return space; - } - if(c * c > a * a + b * b) { - space = b; - return space; - } - if(b * b >= a * a + c * c) { - space = c; - return space; - } - var p = (a + b + c) / 2; - var s = Math.sqrt(p * (p - a) * (p - b) * (p - c)); - space = 2 * s / a; - return space; - } - ,pointsDistance: function(x1,y1,x2,y2) { - var lineLength = 0; - lineLength = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); - return lineLength; - } - ,createJSon: function() { - var jsonString = "{ \"leftEndpoint\": " + this.leftEndpoint.createJSon() + ","; - jsonString += "\"rightEndpoint\": " + this.rightEndpoint.createJSon(); - jsonString += "}"; - return jsonString; - } - ,__class__: model_component_Link -}; -var model_component_Outport = function(xPosition,yPosition) { - this.xPosition = xPosition; - this.yPosition = yPosition; - this.portDescription = model_enumeration_IOTYPE.OUTPUT; -}; -$hxClasses["model.component.Outport"] = model_component_Outport; -model_component_Outport.__name__ = "model.component.Outport"; -model_component_Outport.__interfaces__ = [model_component_Port]; -model_component_Outport.prototype = { - xPosition: null - ,yPosition: null - ,portDescription: null - ,value: null - ,sequence: null - ,get_xPosition: function() { - return this.xPosition; - } - ,get_yPosition: function() { - return this.yPosition; - } - ,set_xPosition: function(xPosition) { - this.xPosition = xPosition; - } - ,set_yPosition: function(yPosition) { - this.yPosition = yPosition; - } - ,get_value: function() { - return this.value; - } - ,set_value: function(value) { - this.value = value; - } - ,get_portDescription: function() { - return this.portDescription; - } - ,set_portDescription: function(value) { - this.portDescription = value; - } - ,get_sequence: function() { - return this.sequence; - } - ,set_sequence: function(sequence) { - this.sequence = sequence; - } - ,createJSon: function() { - var jsonString = "{ \"xPosition\": \"" + this.xPosition + "\","; - jsonString += "\"yPosition\": \"" + this.yPosition + "\","; - jsonString += "\"portDescription\": \"" + Std.string(this.portDescription) + "\","; - jsonString += "\"value\": \"" + Std.string(this.value) + "\","; - jsonString += "\"sequence\": \"" + this.sequence + "\""; - jsonString += "}"; - return jsonString; - } - ,__class__: model_component_Outport -}; -var model_drawingInterface_Box = function(x_position,y_position,width,height,orientation,transform) { - var wnw = new type_Coordinate(x_position - width / 2,y_position - height / 2); - var wse = new type_Coordinate(x_position + width / 2,y_position + height / 2); - var vnw = transform.pointConvert(wnw); - var vse = transform.pointConvert(wse); - var x0 = vnw.get_xPosition(); - var y0 = vnw.get_yPosition(); - var x1 = vse.get_xPosition(); - var y1 = vse.get_yPosition(); - switch(orientation._hx_index) { - case 0: - this.xb = x0; - this.yb = y0; - this.xc = x1; - this.yc = y0; - this.xd = x1; - this.yd = y1; - this.xa = x0; - this.ya = y1; - break; - case 1: - this.xd = x0; - this.yd = y0; - this.xa = x1; - this.ya = y0; - this.xb = x1; - this.yb = y1; - this.xc = x0; - this.yc = y1; - break; - case 2: - this.xc = x0; - this.yc = y0; - this.xd = x1; - this.yd = y0; - this.xa = x1; - this.ya = y1; - this.xb = x0; - this.yb = y1; - break; - case 3: - this.xa = x0; - this.ya = y0; - this.xb = x1; - this.yb = y0; - this.xc = x1; - this.yc = y1; - this.xd = x0; - this.yd = y1; - break; - default: - } -}; -$hxClasses["model.drawingInterface.Box"] = model_drawingInterface_Box; -model_drawingInterface_Box.__name__ = "model.drawingInterface.Box"; -model_drawingInterface_Box.prototype = { - xa: null - ,ya: null - ,xb: null - ,yb: null - ,xc: null - ,yc: null - ,xd: null - ,yd: null - ,get_xa: function() { - return this.xa; - } - ,get_ya: function() { - return this.ya; - } - ,get_xb: function() { - return this.xb; - } - ,get_yb: function() { - return this.yb; - } - ,get_xc: function() { - return this.xc; - } - ,get_yc: function() { - return this.yc; - } - ,get_xd: function() { - return this.xd; - } - ,get_yd: function() { - return this.yd; - } - ,__class__: model_drawingInterface_Box -}; -var model_drawingInterface_DrawingAdapterI = function() { }; -$hxClasses["model.drawingInterface.DrawingAdapterI"] = model_drawingInterface_DrawingAdapterI; -model_drawingInterface_DrawingAdapterI.__name__ = "model.drawingInterface.DrawingAdapterI"; -model_drawingInterface_DrawingAdapterI.__isInterface__ = true; -model_drawingInterface_DrawingAdapterI.prototype = { - setStrokeColor: null - ,setFillColor: null - ,setTextColor: null - ,setTextFont: null - ,setLineWidth: null - ,setClip: null - ,getTransform: null - ,transform: null - ,resetDrawingParam: null - ,drawAndShape: null - ,drawNAndShape: null - ,drawOrShape: null - ,drawNOrShape: null - ,drawBufferShape: null - ,drawNotShape: null - ,drawXorShape: null - ,drawRect: null - ,drawText: null - ,drawCricle: null - ,drawLine: null - ,__class__: model_drawingInterface_DrawingAdapterI -}; -var model_drawingInterface_DrawingAdapter = function(transform,context) { - this.font = "8px serif"; - this.lineWidth = 1.0; - this.textColor = "black"; - this.fillColor = "gray"; - this.strokeColor = "black"; - this.trans = transform; - this.cxt = context; -}; -$hxClasses["model.drawingInterface.DrawingAdapter"] = model_drawingInterface_DrawingAdapter; -model_drawingInterface_DrawingAdapter.__name__ = "model.drawingInterface.DrawingAdapter"; -model_drawingInterface_DrawingAdapter.__interfaces__ = [model_drawingInterface_DrawingAdapterI]; -model_drawingInterface_DrawingAdapter.prototype = { - cxt: null - ,strokeColor: null - ,fillColor: null - ,textColor: null - ,lineWidth: null - ,font: null - ,trans: null - ,resetDrawingParam: function() { - this.strokeColor = "black"; - this.fillColor = "gray"; - this.textColor = "black"; - this.lineWidth = 1.0; - this.font = "8px serif"; - } - ,setStrokeColor: function(color) { - this.strokeColor = color; - } - ,setFillColor: function(color) { - this.fillColor = color; - } - ,setTextColor: function(color) { - this.textColor = color; - } - ,setTextFont: function(font) { - this.font = font; - } - ,setLineWidth: function(width) { - this.cxt.lineWidth = width; - } - ,getTransform: function() { - return this.trans; - } - ,transform: function(transform) { - var drawingAdapter = new model_drawingInterface_DrawingAdapter(transform.compose(this.trans),this.cxt); - return drawingAdapter; - } - ,setClip: function(x,y,width,height) { - } - ,drawAndShape: function(x,y,width,height,orientation) { - var r = new model_drawingInterface_Box(x,y,width,height,orientation,this.trans); - var vCenterCoordinate = this.trans.pointConvert(new type_Coordinate(x,y)); - this.cxt.beginPath(); - this.cxt.moveTo(r.get_xa(),r.get_ya()); - this.cxt.lineTo((r.get_xa() + r.get_xb()) / 2,(r.get_ya() + r.get_yb()) / 2); - var cxmin = Math.min(Math.min(r.get_xa(),r.get_xb()),Math.min(r.get_xc(),r.get_xd())); - var cymin = Math.min(Math.min(r.get_ya(),r.get_yb()),Math.min(r.get_yc(),r.get_yd())); - var cxmax = Math.max(Math.max(r.get_xa(),r.get_xb()),Math.max(r.get_xc(),r.get_xd())); - var cymax = Math.max(Math.max(r.get_ya(),r.get_yb()),Math.max(r.get_yc(),r.get_yd())); - switch(orientation._hx_index) { - case 0: - this.cxt.ellipse(vCenterCoordinate.get_xPosition(),vCenterCoordinate.get_yPosition(),(cxmax - cxmin) / 2,(cymax - cymin) / 2,180 * Math.PI / 180,0,Math.PI); - break; - case 1: - this.cxt.ellipse(vCenterCoordinate.get_xPosition(),vCenterCoordinate.get_yPosition(),(cxmax - cxmin) / 2,(cymax - cymin) / 2,0 * Math.PI / 180,0,Math.PI); - break; - case 2: - this.cxt.ellipse(vCenterCoordinate.get_xPosition(),vCenterCoordinate.get_yPosition(),(cxmax - cxmin) / 2,(cymax - cymin) / 2,90 * Math.PI / 180,0,Math.PI); - break; - case 3: - this.cxt.ellipse(vCenterCoordinate.get_xPosition(),vCenterCoordinate.get_yPosition(),(cxmax - cxmin) / 2,(cymax - cymin) / 2,270 * Math.PI / 180,0,Math.PI); - break; - default: - } - this.cxt.lineTo(r.get_xd(),r.get_yd()); - this.cxt.closePath(); - this.cxt.fillStyle = this.fillColor; - this.cxt.strokeStyle = this.strokeColor; - this.cxt.lineWidth = this.lineWidth; - this.cxt.fill(); - this.cxt.stroke(); - } - ,drawNAndShape: function(x,y,width,height,orientation) { - var r = new model_drawingInterface_Box(x,y,width,height,orientation,this.trans); - var vCenterCoordinate = this.trans.pointConvert(new type_Coordinate(x,y)); - this.cxt.beginPath(); - this.cxt.moveTo(r.get_xa(),r.get_ya()); - this.cxt.lineTo((r.get_xa() + r.get_xb()) / 2,(r.get_ya() + r.get_yb()) / 2); - this.cxt.closePath(); - var cxmin = Math.min(Math.min(r.get_xa(),r.get_xb()),Math.min(r.get_xc(),r.get_xd())); - var cymin = Math.min(Math.min(r.get_ya(),r.get_yb()),Math.min(r.get_yc(),r.get_yd())); - var cxmax = Math.max(Math.max(r.get_xa(),r.get_xb()),Math.max(r.get_xc(),r.get_xd())); - var cymax = Math.max(Math.max(r.get_ya(),r.get_yb()),Math.max(r.get_yc(),r.get_yd())); - var circleCentreX = (r.get_xb() + r.get_xc()) / 2; - var circleCentreY = (r.get_yb() + r.get_yc()) / 2; - var radius = Math.sqrt((r.get_xb() - r.get_xc()) * (r.get_xb() - r.get_xc()) + (r.get_yb() - r.get_yc()) * (r.get_yb() - r.get_yc())) / 20; - switch(orientation._hx_index) { - case 0: - this.cxt.ellipse(vCenterCoordinate.get_xPosition(),vCenterCoordinate.get_yPosition(),(cxmax - cxmin) / 2,(cymax - cymin) / 2 - 2 * radius,180 * Math.PI / 180,0,Math.PI); - break; - case 1: - this.cxt.ellipse(vCenterCoordinate.get_xPosition(),vCenterCoordinate.get_yPosition(),(cxmax - cxmin) / 2,(cymax - cymin) / 2 - 2 * radius,0 * Math.PI / 180,0,Math.PI); - break; - case 2: - this.cxt.ellipse(vCenterCoordinate.get_xPosition(),vCenterCoordinate.get_yPosition(),(cxmax - cxmin) / 2,(cymax - cymin) / 2 - 2 * radius,90 * Math.PI / 180,0,Math.PI); - break; - case 3: - this.cxt.ellipse(vCenterCoordinate.get_xPosition(),vCenterCoordinate.get_yPosition(),(cxmax - cxmin) / 2,(cymax - cymin) / 2 - 2 * radius,270 * Math.PI / 180,0,Math.PI); - break; - default: - } - this.cxt.lineTo(r.get_xd(),r.get_yd()); - this.cxt.closePath(); - this.cxt.moveTo(vCenterCoordinate.get_xPosition() + (cymax - cymin) / 2 - 2 * radius,vCenterCoordinate.get_yPosition()); - this.cxt.arc(vCenterCoordinate.get_xPosition() + (cymax - cymin) / 2 - 2 * radius,vCenterCoordinate.get_yPosition(),radius,0,2 * Math.PI,false); - this.cxt.closePath(); - this.cxt.fillStyle = this.fillColor; - this.cxt.strokeStyle = this.strokeColor; - this.cxt.lineWidth = this.lineWidth; - this.cxt.fill(); - this.cxt.stroke(); - } - ,drawOrShape: function(x,y,width,height,orientation) { - var r = new model_drawingInterface_Box(x,y,width,height,orientation,this.trans); - this.cxt.beginPath(); - this.cxt.moveTo(r.get_xa(),r.get_ya()); - this.cxt.quadraticCurveTo((r.get_xa() + r.get_xb()) / 2,(r.get_ya() + r.get_yb()) / 2,(r.get_xb() + r.get_xc()) / 2,(r.get_yb() + r.get_yc()) / 2); - this.cxt.quadraticCurveTo((r.get_xc() + r.get_xd()) / 2,(r.get_yc() + r.get_yd()) / 2,r.get_xd(),r.get_yd()); - this.cxt.quadraticCurveTo(0.25 * (r.get_xa() + r.get_xb() + r.get_xc() + r.get_xd()),0.25 * (r.get_ya() + r.get_yb() + r.get_yc() + r.get_yd()),r.get_xa(),r.get_ya()); - this.cxt.closePath(); - this.cxt.fillStyle = this.fillColor; - this.cxt.strokeStyle = this.strokeColor; - this.cxt.lineWidth = this.lineWidth; - this.cxt.fill(); - this.cxt.stroke(); - } - ,drawNOrShape: function(x,y,width,height,orientation) { - var r = new model_drawingInterface_Box(x,y,width,height,orientation,this.trans); - var radius = Math.sqrt((r.get_xb() - r.get_xc()) * (r.get_xb() - r.get_xc()) + (r.get_yb() - r.get_yc()) * (r.get_yb() - r.get_yc())) / 10; - this.cxt.beginPath(); - this.cxt.moveTo(r.get_xa(),r.get_ya()); - this.cxt.quadraticCurveTo((r.get_xa() + r.get_xb()) / 2,(r.get_ya() + r.get_yb()) / 2,(r.get_xb() + r.get_xc()) / 2,(r.get_yb() + r.get_yc()) / 2); - this.cxt.quadraticCurveTo((r.get_xc() + r.get_xd()) / 2,(r.get_yc() + r.get_yd()) / 2,r.get_xd(),r.get_yd()); - this.cxt.quadraticCurveTo(0.25 * (r.get_xa() + r.get_xb() + r.get_xc() + r.get_xd()),0.25 * (r.get_ya() + r.get_yb() + r.get_yc() + r.get_yd()),r.get_xa(),r.get_ya()); - this.cxt.closePath(); - this.cxt.lineWidth = this.lineWidth; - this.cxt.strokeStyle = this.strokeColor; - this.cxt.fillStyle = this.fillColor; - this.cxt.fill(); - this.cxt.stroke(); - } - ,drawBufferShape: function(x,y,width,height,orientation) { - var r = new model_drawingInterface_Box(x,y,width,height,orientation,this.trans); - this.cxt.beginPath(); - this.cxt.moveTo(r.get_xa(),r.get_ya()); - this.cxt.lineTo((r.get_xb() + r.get_xc()) / 2,(r.get_yb() + r.get_yc()) / 2); - this.cxt.lineTo(r.get_xd(),r.get_yd()); - this.cxt.fillStyle = this.fillColor; - this.cxt.strokeStyle = this.strokeColor; - this.cxt.lineWidth = this.lineWidth; - this.cxt.closePath(); - this.cxt.fill(); - this.cxt.stroke(); - } - ,drawNotShape: function(x,y,width,height,orientation) { - var r = new model_drawingInterface_Box(x,y,width,height,orientation,this.trans); - this.cxt.beginPath(); - this.cxt.moveTo(r.get_xa(),r.get_ya()); - this.cxt.lineTo((r.get_xb() + r.get_xc()) / 2,(r.get_yb() + r.get_yc()) / 2); - this.cxt.lineTo(r.get_xd(),r.get_yd()); - this.cxt.closePath(); - var circleCentreX = (r.get_xb() + r.get_xc()) / 2; - var circleCentreY = (r.get_yb() + r.get_yc()) / 2; - var radius = Math.sqrt((r.get_xb() - r.get_xc()) * (r.get_xb() - r.get_xc()) + (r.get_yb() - r.get_yc()) * (r.get_yb() - r.get_yc())) / 10; - switch(orientation._hx_index) { - case 0: - this.cxt.arc(circleCentreX,circleCentreY + radius / 2,radius,0,2 * Math.PI,false); - break; - case 1: - this.cxt.arc(circleCentreX,circleCentreY - radius / 2,radius,0,2 * Math.PI,false); - break; - case 2: - this.cxt.arc(circleCentreX + radius / 2,circleCentreY,radius,0,2 * Math.PI,false); - break; - case 3: - this.cxt.arc(circleCentreX - radius / 2,circleCentreY,radius,0,2 * Math.PI,false); - break; - default: - } - this.cxt.lineWidth = this.lineWidth; - this.cxt.fillStyle = this.fillColor; - this.cxt.strokeStyle = this.strokeColor; - this.cxt.fill(); - this.cxt.stroke(); - } - ,drawXorShape: function(x,y,width,height,orientation) { - var r = new model_drawingInterface_Box(x,y,width,height,orientation,this.trans); - var vCenterCoordinate = this.trans.pointConvert(new type_Coordinate(x,y)); - this.cxt.beginPath(); - this.cxt.moveTo(r.get_xa(),r.get_ya()); - this.cxt.quadraticCurveTo((r.get_xa() + r.get_xb()) / 2,(r.get_ya() + r.get_yb()) / 2,(r.get_xb() + r.get_xc()) / 2,(r.get_yb() + r.get_yc()) / 2); - this.cxt.quadraticCurveTo((r.get_xc() + r.get_xd()) / 2,(r.get_yc() + r.get_yd()) / 2,r.get_xd(),r.get_yd()); - this.cxt.quadraticCurveTo(0.25 * (r.get_xa() + r.get_xb() + r.get_xc() + r.get_xd()),0.25 * (r.get_ya() + r.get_yb() + r.get_yc() + r.get_yd()),r.get_xa(),r.get_ya()); - this.cxt.closePath(); - this.cxt.lineWidth = this.lineWidth; - this.cxt.fillStyle = this.fillColor; - this.cxt.strokeStyle = this.strokeColor; - this.cxt.fill(); - switch(orientation._hx_index) { - case 0: - this.cxt.moveTo(r.get_xa() + (r.get_xb() - r.get_xa()) / 8,r.get_ya()); - this.cxt.quadraticCurveTo(vCenterCoordinate.get_xPosition(),vCenterCoordinate.get_yPosition() + (r.get_yc() - r.get_yb()) / 7,r.get_xa() + (r.get_xb() - r.get_xa()) / 8 * 7,r.get_ya()); - break; - case 1: - this.cxt.moveTo(r.get_xa() - (r.get_xb() - r.get_xa()) / 8,r.get_ya()); - this.cxt.quadraticCurveTo(vCenterCoordinate.get_xPosition(),vCenterCoordinate.get_yPosition() - (r.get_yc() - r.get_yb()) / 7,r.get_xa() - (r.get_xb() - r.get_xa()) / 8 * 7,r.get_ya()); - break; - case 2: - this.cxt.moveTo(r.get_xa(),r.get_ya() - (r.get_xb() - r.get_xa()) / 8); - this.cxt.quadraticCurveTo(vCenterCoordinate.get_xPosition() + (r.get_xb() - r.get_xa()) / 7,vCenterCoordinate.get_yPosition(),r.get_xa(),r.get_ya() - (r.get_xb() - r.get_xa()) / 8 * 7); - break; - case 3: - this.cxt.moveTo(r.get_xa(),r.get_ya() + (r.get_xb() - r.get_xa()) / 8); - this.cxt.quadraticCurveTo(vCenterCoordinate.get_xPosition() - (r.get_xb() - r.get_xa()) / 7,vCenterCoordinate.get_yPosition(),r.get_xa(),r.get_ya() + (r.get_xb() - r.get_xa()) / 8 * 7); - break; - default: - } - this.cxt.stroke(); - } - ,drawRect: function(x,y,width,height) { - var wnw = new type_Coordinate(x - width / 2,y - height / 2); - var wse = new type_Coordinate(x + width / 2,y + height / 2); - var vnw = this.trans.pointConvert(wnw); - var vse = this.trans.pointConvert(wse); - var x0 = vnw.get_xPosition(); - var y0 = vnw.get_yPosition(); - var x1 = vse.get_xPosition(); - var y1 = vse.get_yPosition(); - this.cxt.beginPath(); - this.cxt.rect(Math.min(x0,x1),Math.min(y0,y1),Math.abs(x1 - x0),Math.abs(y1 - y0)); - this.cxt.closePath(); - this.cxt.lineWidth = this.lineWidth; - this.cxt.fillStyle = this.fillColor; - this.cxt.strokeStyle = this.strokeColor; - this.cxt.fillRect(Math.min(x0,x1),Math.min(y0,y1),Math.abs(x1 - x0),Math.abs(y1 - y0)); - this.cxt.stroke(); - } - ,drawText: function(str,x,y,width) { - var wCoordinate = new type_Coordinate(x - width / 2,y); - var eCoordinate = new type_Coordinate(x + width / 2,y); - var vwCoordinate = this.trans.pointConvert(wCoordinate); - var veCoordinate = this.trans.pointConvert(eCoordinate); - var x0 = vwCoordinate.get_xPosition(); - var y0 = vwCoordinate.get_yPosition(); - this.cxt.lineWidth = this.lineWidth; - this.cxt.font = this.font; - this.cxt.fillStyle = this.textColor; - this.cxt.strokeStyle = this.strokeColor; - this.cxt.beginPath(); - this.cxt.fillText(str,x0,y0,veCoordinate.get_xPosition() - vwCoordinate.get_xPosition()); - this.cxt.closePath(); - } - ,drawCricle: function(x,y,radius) { - var wnw = new type_Coordinate(x - radius,y); - var wse = new type_Coordinate(x + radius,y); - var vnw = this.trans.pointConvert(wnw); - var vse = this.trans.pointConvert(wse); - radius = (vse.get_xPosition() - vnw.get_xPosition()) / 2; - var x0 = vnw.get_xPosition() + radius; - var y0 = vse.get_yPosition(); - this.cxt.beginPath(); - this.cxt.arc(x0,y0,radius,0,2 * Math.PI,false); - this.cxt.closePath(); - this.cxt.lineWidth = this.lineWidth; - this.cxt.fillStyle = this.fillColor; - this.cxt.strokeStyle = this.strokeColor; - this.cxt.fill(); - this.cxt.stroke(); - } - ,drawLine: function(x0,y0,x1,y1) { - var coordinate0 = this.trans.pointConvert(new type_Coordinate(x0,y0)); - var coordinate1 = this.trans.pointConvert(new type_Coordinate(x1,y1)); - var x01 = coordinate0.get_xPosition(); - var y01 = coordinate0.get_yPosition(); - var x11 = coordinate1.get_xPosition(); - var y11 = coordinate1.get_yPosition(); - this.cxt.beginPath(); - this.cxt.moveTo(x01,y01); - this.cxt.lineTo(x11,y11); - this.cxt.closePath(); - this.cxt.lineWidth = this.lineWidth; - this.cxt.fillStyle = this.fillColor; - this.cxt.strokeStyle = this.strokeColor; - this.cxt.fill(); - this.cxt.stroke(); - } - ,__class__: model_drawingInterface_DrawingAdapter -}; -var model_drawingInterface_RectangleI = function() { }; -$hxClasses["model.drawingInterface.RectangleI"] = model_drawingInterface_RectangleI; -model_drawingInterface_RectangleI.__name__ = "model.drawingInterface.RectangleI"; -model_drawingInterface_RectangleI.__isInterface__ = true; -model_drawingInterface_RectangleI.prototype = { - min: null - ,max: null - ,width: null - ,height: null - ,set_minCoordinate: null - ,set_maxCoordinate: null - ,__class__: model_drawingInterface_RectangleI -}; -var model_drawingInterface_Rectangle = function(corner0,corner1) { - this.minCoordinate = new type_Coordinate(Math.min(corner0.get_xPosition(),corner1.get_xPosition()),Math.min(corner0.get_yPosition(),corner1.get_yPosition())); - this.maxCoordinate = new type_Coordinate(Math.max(corner0.get_xPosition(),corner1.get_xPosition()),Math.max(corner0.get_yPosition(),corner1.get_yPosition())); - this.updateWidthAndHeight(); -}; -$hxClasses["model.drawingInterface.Rectangle"] = model_drawingInterface_Rectangle; -model_drawingInterface_Rectangle.__name__ = "model.drawingInterface.Rectangle"; -model_drawingInterface_Rectangle.__interfaces__ = [model_drawingInterface_RectangleI]; -model_drawingInterface_Rectangle.prototype = { - minCoordinate: null - ,maxCoordinate: null - ,width_: null - ,height_: null - ,min: function() { - return this.minCoordinate; - } - ,max: function() { - return this.maxCoordinate; - } - ,width: function() { - return this.width_; - } - ,height: function() { - return this.height_; - } - ,set_minCoordinate: function(value) { - this.minCoordinate = value; - this.updateWidthAndHeight(); - } - ,set_maxCoordinate: function(value) { - this.maxCoordinate = value; - this.updateWidthAndHeight(); - } - ,updateWidthAndHeight: function() { - this.width_ = this.maxCoordinate.get_xPosition() - this.minCoordinate.get_xPosition(); - this.height_ = this.maxCoordinate.get_yPosition() - this.minCoordinate.get_yPosition(); - } - ,__class__: model_drawingInterface_Rectangle -}; -var model_drawingInterface_Transform = function(m,im) { - this.convertMatrix = m; - this.invertMatrix = im; -}; -$hxClasses["model.drawingInterface.Transform"] = model_drawingInterface_Transform; -model_drawingInterface_Transform.__name__ = "model.drawingInterface.Transform"; -model_drawingInterface_Transform.identity = function() { - return new model_drawingInterface_Transform([1,0,0,0,1,0,0,0,1],[1,0,0,0,1,0,0,0,1]); -}; -model_drawingInterface_Transform.prototype = { - convertMatrix: null - ,invertMatrix: null - ,pointConvert: function(c) { - return new type_Coordinate(this.convertMatrix[0] * c.get_xPosition() + this.convertMatrix[1] * c.get_yPosition() + this.convertMatrix[2],this.convertMatrix[3] * c.get_xPosition() + this.convertMatrix[4] * c.get_yPosition() + this.convertMatrix[5]); - } - ,pointInvert: function(c) { - return new type_Coordinate(this.invertMatrix[0] * c.get_xPosition() + this.invertMatrix[1] * c.get_yPosition() + this.invertMatrix[2],this.invertMatrix[3] * c.get_xPosition() + this.invertMatrix[4] * c.get_yPosition() + this.invertMatrix[5]); - } - ,rectConvert: function(c) { - var maxCoordinate = this.pointConvert(c.max()); - var minCoordinate = this.pointConvert(c.min()); - return new model_drawingInterface_Rectangle(maxCoordinate,minCoordinate); - } - ,rectInvert: function(c) { - var maxCoordinate = this.pointInvert(c.max()); - var minCoordinate = this.pointInvert(c.min()); - return new model_drawingInterface_Rectangle(maxCoordinate,minCoordinate); - } - ,scale: function(xRatio,yRatio) { - var scaleArray = [xRatio,0,0,0,yRatio,0,0,0,1]; - var invScaleArray = [1 / xRatio,0,0,0,1 / yRatio,0,0,0,1]; - return new model_drawingInterface_Transform(this.multiply(scaleArray,this.convertMatrix),this.multiply(this.invertMatrix,invScaleArray)); - } - ,translate: function(xDelta,yDelta) { - var translateArray = [1,0,xDelta,0,1,yDelta,0,0,1]; - var invTranslateArray = [1,0,-xDelta,0,1,-yDelta,0,0,1]; - return new model_drawingInterface_Transform(this.multiply(translateArray,this.convertMatrix),this.multiply(this.invertMatrix,invTranslateArray)); - } - ,quadrantRotate: function(n) { - return null; - } - ,compose: function(other) { - return new model_drawingInterface_Transform(this.multiply(other.convertMatrix,this.convertMatrix),this.multiply(this.invertMatrix,other.invertMatrix)); - } - ,multiply: function(matrix1,matrix2) { - var n = Math.sqrt(matrix1.length); - var tempArray = []; - var _g = 0; - var _g1 = n; - while(_g < _g1) { - var i = _g++; - var _g2 = 0; - var _g11 = n; - while(_g2 < _g11) { - var j = _g2++; - tempArray[n * i + j] = 0; - } - } - var _g21 = 0; - var _g3 = n; - while(_g21 < _g3) { - var i1 = _g21++; - var _g22 = 0; - var _g31 = n; - while(_g22 < _g31) { - var j1 = _g22++; - var _g23 = 0; - var _g32 = n; - while(_g23 < _g32) { - var k = _g23++; - tempArray[n * i1 + j1] += matrix1[n * i1 + k] * matrix2[n * k + j1]; - } - } - } - return tempArray; - } - ,__class__: model_drawingInterface_Transform -}; -var model_enumeration_AttrType = $hxEnums["model.enumeration.AttrType"] = { __ename__ : "model.enumeration.AttrType", __constructs__ : ["INT","STRING","Orientation"] - ,INT: {_hx_index:0,__enum__:"model.enumeration.AttrType",toString:$estr} - ,STRING: {_hx_index:1,__enum__:"model.enumeration.AttrType",toString:$estr} - ,Orientation: {_hx_index:2,__enum__:"model.enumeration.AttrType",toString:$estr} -}; -model_enumeration_AttrType.__empty_constructs__ = [model_enumeration_AttrType.INT,model_enumeration_AttrType.STRING,model_enumeration_AttrType.Orientation]; -var model_enumeration_BOX = $hxEnums["model.enumeration.BOX"] = { __ename__ : "model.enumeration.BOX", __constructs__ : ["WHITE_BOX","BLACK_BOX"] - ,WHITE_BOX: {_hx_index:0,__enum__:"model.enumeration.BOX",toString:$estr} - ,BLACK_BOX: {_hx_index:1,__enum__:"model.enumeration.BOX",toString:$estr} -}; -model_enumeration_BOX.__empty_constructs__ = [model_enumeration_BOX.WHITE_BOX,model_enumeration_BOX.BLACK_BOX]; -var model_enumeration_ComponentType = $hxEnums["model.enumeration.ComponentType"] = { __ename__ : "model.enumeration.ComponentType", __constructs__ : ["AND","NAND","OR","NOR","XOR","NOT","COMPOUND_COMPONENT"] - ,AND: {_hx_index:0,__enum__:"model.enumeration.ComponentType",toString:$estr} - ,NAND: {_hx_index:1,__enum__:"model.enumeration.ComponentType",toString:$estr} - ,OR: {_hx_index:2,__enum__:"model.enumeration.ComponentType",toString:$estr} - ,NOR: {_hx_index:3,__enum__:"model.enumeration.ComponentType",toString:$estr} - ,XOR: {_hx_index:4,__enum__:"model.enumeration.ComponentType",toString:$estr} - ,NOT: {_hx_index:5,__enum__:"model.enumeration.ComponentType",toString:$estr} - ,COMPOUND_COMPONENT: {_hx_index:6,__enum__:"model.enumeration.ComponentType",toString:$estr} -}; -model_enumeration_ComponentType.__empty_constructs__ = [model_enumeration_ComponentType.AND,model_enumeration_ComponentType.NAND,model_enumeration_ComponentType.OR,model_enumeration_ComponentType.NOR,model_enumeration_ComponentType.XOR,model_enumeration_ComponentType.NOT,model_enumeration_ComponentType.COMPOUND_COMPONENT]; -var model_enumeration_ComponentTypes = function(circuitDiagram) { - this.notComponentKind = new model_gates_NOT(); - this.xorComponentKind = new model_gates_XOR(); - this.norComponentKind = new model_gates_NOR(); - this.orComponentKind = new model_gates_OR(); - this.nandComponentKind = new model_gates_NAND(); - this.andComponentKind = new model_gates_AND(); - this.compoundComponentKind = new model_gates_CompoundComponent(circuitDiagram); -}; -$hxClasses["model.enumeration.ComponentTypes"] = model_enumeration_ComponentTypes; -model_enumeration_ComponentTypes.__name__ = "model.enumeration.ComponentTypes"; -model_enumeration_ComponentTypes.prototype = { - andComponentKind: null - ,nandComponentKind: null - ,orComponentKind: null - ,norComponentKind: null - ,xorComponentKind: null - ,notComponentKind: null - ,compoundComponentKind: null - ,toComponentKind: function(ct) { - switch(ct._hx_index) { - case 0: - return this.andComponentKind; - case 1: - return this.nandComponentKind; - case 2: - return this.orComponentKind; - case 3: - return this.norComponentKind; - case 4: - return this.xorComponentKind; - case 5: - return this.notComponentKind; - case 6: - return this.compoundComponentKind; - } - } - ,__class__: model_enumeration_ComponentTypes -}; -var model_enumeration_IOTYPE = $hxEnums["model.enumeration.IOTYPE"] = { __ename__ : "model.enumeration.IOTYPE", __constructs__ : ["INPUT","S","D","CLK","OUTPUT","Q","QN"] - ,INPUT: {_hx_index:0,__enum__:"model.enumeration.IOTYPE",toString:$estr} - ,S: {_hx_index:1,__enum__:"model.enumeration.IOTYPE",toString:$estr} - ,D: {_hx_index:2,__enum__:"model.enumeration.IOTYPE",toString:$estr} - ,CLK: {_hx_index:3,__enum__:"model.enumeration.IOTYPE",toString:$estr} - ,OUTPUT: {_hx_index:4,__enum__:"model.enumeration.IOTYPE",toString:$estr} - ,Q: {_hx_index:5,__enum__:"model.enumeration.IOTYPE",toString:$estr} - ,QN: {_hx_index:6,__enum__:"model.enumeration.IOTYPE",toString:$estr} -}; -model_enumeration_IOTYPE.__empty_constructs__ = [model_enumeration_IOTYPE.INPUT,model_enumeration_IOTYPE.S,model_enumeration_IOTYPE.D,model_enumeration_IOTYPE.CLK,model_enumeration_IOTYPE.OUTPUT,model_enumeration_IOTYPE.Q,model_enumeration_IOTYPE.QN]; -var model_enumeration_MODE = $hxEnums["model.enumeration.MODE"] = { __ename__ : "model.enumeration.MODE", __constructs__ : ["EXCLUDE_PARENTS","INCLUDE_PARENTS"] - ,EXCLUDE_PARENTS: {_hx_index:0,__enum__:"model.enumeration.MODE",toString:$estr} - ,INCLUDE_PARENTS: {_hx_index:1,__enum__:"model.enumeration.MODE",toString:$estr} -}; -model_enumeration_MODE.__empty_constructs__ = [model_enumeration_MODE.EXCLUDE_PARENTS,model_enumeration_MODE.INCLUDE_PARENTS]; -var model_enumeration_ORIENTATION = $hxEnums["model.enumeration.ORIENTATION"] = { __ename__ : "model.enumeration.ORIENTATION", __constructs__ : ["NORTH","SOUTH","WEST","EAST","UNKNOW"] - ,NORTH: {_hx_index:0,__enum__:"model.enumeration.ORIENTATION",toString:$estr} - ,SOUTH: {_hx_index:1,__enum__:"model.enumeration.ORIENTATION",toString:$estr} - ,WEST: {_hx_index:2,__enum__:"model.enumeration.ORIENTATION",toString:$estr} - ,EAST: {_hx_index:3,__enum__:"model.enumeration.ORIENTATION",toString:$estr} - ,UNKNOW: {_hx_index:4,__enum__:"model.enumeration.ORIENTATION",toString:$estr} -}; -model_enumeration_ORIENTATION.__empty_constructs__ = [model_enumeration_ORIENTATION.NORTH,model_enumeration_ORIENTATION.SOUTH,model_enumeration_ORIENTATION.WEST,model_enumeration_ORIENTATION.EAST,model_enumeration_ORIENTATION.UNKNOW]; -var model_enumeration_POINT_$MODE = $hxEnums["model.enumeration.POINT_MODE"] = { __ename__ : "model.enumeration.POINT_MODE", __constructs__ : ["ONE","PATH"] - ,ONE: {_hx_index:0,__enum__:"model.enumeration.POINT_MODE",toString:$estr} - ,PATH: {_hx_index:1,__enum__:"model.enumeration.POINT_MODE",toString:$estr} -}; -model_enumeration_POINT_$MODE.__empty_constructs__ = [model_enumeration_POINT_$MODE.ONE,model_enumeration_POINT_$MODE.PATH]; -var model_enumeration_VALUE_$LOGIC = $hxEnums["model.enumeration.VALUE_LOGIC"] = { __ename__ : "model.enumeration.VALUE_LOGIC", __constructs__ : ["FALSE","TRUE","UNDEFINED","RISING_EDGE","DOWN_EDGE"] - ,FALSE: {_hx_index:0,__enum__:"model.enumeration.VALUE_LOGIC",toString:$estr} - ,TRUE: {_hx_index:1,__enum__:"model.enumeration.VALUE_LOGIC",toString:$estr} - ,UNDEFINED: {_hx_index:2,__enum__:"model.enumeration.VALUE_LOGIC",toString:$estr} - ,RISING_EDGE: {_hx_index:3,__enum__:"model.enumeration.VALUE_LOGIC",toString:$estr} - ,DOWN_EDGE: {_hx_index:4,__enum__:"model.enumeration.VALUE_LOGIC",toString:$estr} -}; -model_enumeration_VALUE_$LOGIC.__empty_constructs__ = [model_enumeration_VALUE_$LOGIC.FALSE,model_enumeration_VALUE_$LOGIC.TRUE,model_enumeration_VALUE_$LOGIC.UNDEFINED,model_enumeration_VALUE_$LOGIC.RISING_EDGE,model_enumeration_VALUE_$LOGIC.DOWN_EDGE]; -var model_gates_AbstractComponentKind = function() { - this.attributes = []; - this.sequence = -1; - this.attributes.push(new model_attribute_OrientationAttr()); - this.attributes.push(new model_attribute_StringAttr("name")); -}; -$hxClasses["model.gates.AbstractComponentKind"] = model_gates_AbstractComponentKind; -model_gates_AbstractComponentKind.__name__ = "model.gates.AbstractComponentKind"; -model_gates_AbstractComponentKind.prototype = { - sequence: null - ,component: null - ,attributes: null - ,getAttr: function() { - return this.attributes; - } - ,get_component: function() { - return this.component; - } - ,set_component: function(value) { - this.component = value; - } - ,addInPort: function() { - return new model_component_Inport(); - } - ,addOutPort: function() { - return new model_component_Outport(); - } - ,get_sequence: function() { - return this.sequence; - } - ,set_sequence: function(value) { - return this.sequence = value; - } - ,updateInPortPosition: function(portArray,xPosition,yPosition,height,width,orientation) { - switch(orientation._hx_index) { - case 0: - var _g = 0; - var _g1 = portArray.length; - while(_g < _g1) { - var i = _g++; - portArray[i].set_xPosition(xPosition - width / 2 + width / (portArray.length + 1) * (i + 1)); - portArray[i].set_yPosition(yPosition + height / 2); - } - break; - case 1: - var _g2 = 0; - var _g11 = portArray.length; - while(_g2 < _g11) { - var i1 = _g2++; - portArray[i1].set_xPosition(xPosition - width / 2 + width / (portArray.length + 1) * (i1 + 1)); - portArray[i1].set_yPosition(yPosition - height / 2); - } - break; - case 2: - var _g3 = 0; - var _g12 = portArray.length; - while(_g3 < _g12) { - var i2 = _g3++; - portArray[i2].set_xPosition(xPosition + width / 2); - portArray[i2].set_yPosition(height / (portArray.length + 1) * (i2 + 1) + (yPosition - height / 2)); - } - break; - case 3: - var _g4 = 0; - var _g13 = portArray.length; - while(_g4 < _g13) { - var i3 = _g4++; - portArray[i3].set_xPosition(xPosition - width / 2); - portArray[i3].set_yPosition(height / (portArray.length + 1) * (i3 + 1) + (yPosition - height / 2)); - } - break; - default: - } - return portArray; - } - ,updateOutPortPosition: function(portArray,xPosition,yPosition,height,width,orientation) { - switch(orientation._hx_index) { - case 0: - var _g = 0; - var _g1 = portArray.length; - while(_g < _g1) { - var i = _g++; - portArray[i].set_xPosition(xPosition); - portArray[i].set_yPosition(yPosition - height / 2); - } - break; - case 1: - var _g2 = 0; - var _g11 = portArray.length; - while(_g2 < _g11) { - var i1 = _g2++; - portArray[i1].set_xPosition(xPosition); - portArray[i1].set_yPosition(yPosition + height / 2); - } - break; - case 2: - var _g3 = 0; - var _g12 = portArray.length; - while(_g3 < _g12) { - var i2 = _g3++; - portArray[i2].set_xPosition(xPosition - width / 2); - portArray[i2].set_yPosition(yPosition); - } - break; - case 3: - var _g4 = 0; - var _g13 = portArray.length; - while(_g4 < _g13) { - var i3 = _g4++; - portArray[i3].set_xPosition(xPosition + width / 2); - portArray[i3].set_yPosition(yPosition); - } - break; - default: - } - return portArray; - } - ,findHitList: function(coordinate,mode) { - var hitObjectArray = []; - var component = this.isInComponent(coordinate); - if(component != null) { - var hitObject = new type_HitObject(); - hitObject.set_component(component); - hitObjectArray.push(hitObject); - } - var port = this.isOnPort(coordinate); - if(port != null) { - var hitObject1 = new type_HitObject(); - hitObject1.set_port(port); - hitObjectArray.push(hitObject1); - } - return hitObjectArray; - } - ,isInComponent: function(coordinate) { - if(this.isInScope(this.component.get_xPosition(),this.component.get_yPosition(),coordinate.get_xPosition(),coordinate.get_yPosition(),this.component.get_height(),this.component.get_width()) == true) { - return this.component; - } - return null; - } - ,isInScope: function(orignalXposition,orignalYposition,mouseXPosition,mouseYposition,heigh,width) { - if(mouseXPosition >= orignalXposition - width / 2 && mouseXPosition <= orignalXposition + width / 2 && (mouseYposition >= orignalYposition - heigh / 2 && mouseYposition <= orignalYposition + heigh / 2)) { - return true; - } else { - return false; - } - } - ,isOnPort: function(cooridnate) { - var port; - var j = this.component.get_inportIterator(); - while(j.hasNext()) { - var j1 = j.next(); - if(this.isInCircle(cooridnate,j1.get_xPosition(),j1.get_yPosition())) { - port = j1; - return port; - } - } - var j2 = this.component.get_outportIterator(); - while(j2.hasNext()) { - var j3 = j2.next(); - if(this.isInCircle(cooridnate,j3.get_xPosition(),j3.get_yPosition())) { - port = j3; - return port; - } - } - return null; - } - ,isInCircle: function(coordinate,orignalXPosition,orignalYPosition) { - if(Math.abs(coordinate.get_xPosition() - orignalXPosition) <= global_Constant.portRadius && Math.abs(coordinate.get_yPosition() - orignalYPosition) <= global_Constant.portRadius) { - return true; - } else { - return false; - } - } - ,findWorldPoint: function(worldCoordinate,mode) { - return []; - } - ,getInnerCircuitDiagram: function() { - var e = new assertions_AssertionFailure("false",[]); - haxe_Log.trace("Throwing exception " + Std.string(e),{ fileName : "src/model/gates/AbstractComponentKind.hx", lineNumber : 235, className : "model.gates.AbstractComponentKind", methodName : "getInnerCircuitDiagram"}); - throw new js__$Boot_HaxeError(e); - } - ,checkInnerCircuitDiagramPortsChange: function() { - return false; - } - ,__class__: model_gates_AbstractComponentKind -}; -var model_gates_ComponentKind = function() { }; -$hxClasses["model.gates.ComponentKind"] = model_gates_ComponentKind; -model_gates_ComponentKind.__name__ = "model.gates.ComponentKind"; -model_gates_ComponentKind.__isInterface__ = true; -model_gates_ComponentKind.prototype = { - getname: null - ,getAttr: null - ,createPorts: null - ,checkInnerCircuitDiagramPortsChange: null - ,addInPort: null - ,addOutPort: null - ,updateInPortPosition: null - ,updateOutPortPosition: null - ,drawComponent: null - ,get_sequence: null - ,set_sequence: null - ,get_component: null - ,set_component: null - ,findHitList: null - ,findWorldPoint: null - ,getInnerCircuitDiagram: null - ,setname: null - ,__class__: model_gates_ComponentKind -}; -var model_gates_AND = function() { - this.nameOfTheComponentKind = "AND"; - model_gates_AbstractComponentKind.call(this); - this.attributes.push(new model_attribute_IntAttr("delay")); -}; -$hxClasses["model.gates.AND"] = model_gates_AND; -model_gates_AND.__name__ = "model.gates.AND"; -model_gates_AND.__interfaces__ = [model_gates_ComponentKind]; -model_gates_AND.__super__ = model_gates_AbstractComponentKind; -model_gates_AND.prototype = $extend(model_gates_AbstractComponentKind.prototype,{ - nameOfTheComponentKind: null - ,getname: function() { - return this.nameOfTheComponentKind; - } - ,setname: function(s) { - this.nameOfTheComponentKind = s; - } - ,createPorts: function(xPosition,yPosition,height,width,orientation,inportNum) { - var portArray = []; - switch(orientation._hx_index) { - case 0: - var counter = 0; - while(counter < inportNum) { - var inport = new model_component_Inport(xPosition - width / 2 + width / (inportNum + 1) * (counter + 1),yPosition + height / 2); - inport.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport); - ++counter; - } - var outport_ = new model_component_Outport(xPosition,yPosition - height / 2); - outport_.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_); - break; - case 1: - var counter1 = 0; - while(counter1 < inportNum) { - var inport1 = new model_component_Inport(xPosition - width / 2 + width / (inportNum + 1) * (counter1 + 1),yPosition - height / 2); - inport1.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport1); - ++counter1; - } - var outport_1 = new model_component_Outport(xPosition,yPosition + height / 2); - outport_1.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_1); - break; - case 2: - var counter2 = 0; - while(counter2 < inportNum) { - var inport2 = new model_component_Inport(xPosition + width / 2,height / (inportNum + 1) * (counter2 + 1) + (yPosition - height / 2)); - inport2.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport2); - ++counter2; - } - var outport_2 = new model_component_Outport(xPosition - width / 2,yPosition); - outport_2.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_2); - break; - case 3: - var counter3 = 0; - while(counter3 < inportNum) { - var inport3 = new model_component_Inport(xPosition - width / 2,height / (inportNum + 1) * (counter3 + 1) + (yPosition - height / 2)); - inport3.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport3); - ++counter3; - } - var outport_3 = new model_component_Outport(xPosition + width / 2,yPosition); - outport_3.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_3); - break; - default: - } - return portArray; - } - ,drawComponent: function(drawingAdapter,highLight,linkAndComponentArray) { - var drawComponent = new view_drawComponents_DrawAND(this.component,drawingAdapter); - if(highLight) { - drawComponent.drawCorrespondingComponent("red"); - } else { - drawComponent.drawCorrespondingComponent("black"); - } - } - ,__class__: model_gates_AND -}); -var model_gates_CompoundComponent = function(circuitDiagram) { - this.nameOfTheComponentKind = "CC"; - model_gates_AbstractComponentKind.call(this); - this.circuitDiagram = circuitDiagram; -}; -$hxClasses["model.gates.CompoundComponent"] = model_gates_CompoundComponent; -model_gates_CompoundComponent.__name__ = "model.gates.CompoundComponent"; -model_gates_CompoundComponent.__interfaces__ = [model_gates_ComponentKind]; -model_gates_CompoundComponent.__super__ = model_gates_AbstractComponentKind; -model_gates_CompoundComponent.prototype = $extend(model_gates_AbstractComponentKind.prototype,{ - Ob: null - ,Obable: null - ,circuitDiagram: null - ,nameOfTheComponentKind: null - ,setname: function(s) { - this.nameOfTheComponentKind = s; - } - ,getname: function() { - return this.nameOfTheComponentKind; - } - ,getInnerCircuitDiagram: function() { - return this.circuitDiagram; - } - ,checkInnerCircuitDiagramPortsChange: function() { - var inputNumberTemp = 0; - var outputNumberTemp = 0; - var i = this.circuitDiagram.get_componentIterator(); - while(i.hasNext()) { - var i1 = i.next(); - if(i1.getNameOfTheComponentKind() == "Input") { - ++inputNumberTemp; - } - if(i1.getNameOfTheComponentKind() == "Output") { - ++outputNumberTemp; - } - } - if(inputNumberTemp == this.component.get_inportIteratorLength() && outputNumberTemp == this.component.get_outportIteratorLength()) { - return false; - } else { - return true; - } - } - ,createPorts: function(xPosition,yPosition,height,width,orientation,inportNum) { - var inportCount = 0; - var outportCount = 0; - var i = this.circuitDiagram.get_componentIterator(); - while(i.hasNext()) { - var i1 = i.next(); - if(i1.getNameOfTheComponentKind() == "Input") { - ++inportCount; - } else if(i1.getNameOfTheComponentKind() == "Output") { - ++outportCount; - } - } - var portArray = []; - switch(orientation._hx_index) { - case 0: - var i2 = this.circuitDiagram.get_componentIterator(); - while(i2.hasNext()) { - var i3 = i2.next(); - if(i3.getNameOfTheComponentKind() == "Input") { - var inport_1 = new model_component_Inport(xPosition - width / 2 + width / (inportCount + 1) * (i3.get_componentKind().get_sequence() + 1),height + height / 2); - inport_1.set_sequence(i3.get_componentKind().get_sequence()); - portArray.push(inport_1); - } else if(i3.getNameOfTheComponentKind() == "Output") { - var outport_ = new model_component_Outport(xPosition - width / 2 + width / (outportCount + 1) * (i3.get_componentKind().get_sequence() + 1),height - height / 2); - outport_.set_sequence(i3.get_componentKind().get_sequence()); - portArray.push(outport_); - } - } - break; - case 1: - var i4 = this.circuitDiagram.get_componentIterator(); - while(i4.hasNext()) { - var i5 = i4.next(); - if(i5.getNameOfTheComponentKind() == "Input") { - var inport_11 = new model_component_Inport(xPosition - width / 2 + width / (inportCount + 1) * (i5.get_componentKind().get_sequence() + 1),height - height / 2); - inport_11.set_sequence(i5.get_componentKind().get_sequence()); - portArray.push(inport_11); - } else if(i5.getNameOfTheComponentKind() == "Output") { - var outport_1 = new model_component_Outport(xPosition - width / 2 + width / (outportCount + 1) * (i5.get_componentKind().get_sequence() + 1),height + height / 2); - outport_1.set_sequence(i5.get_componentKind().get_sequence()); - portArray.push(outport_1); - } - } - break; - case 2: - var i6 = this.circuitDiagram.get_componentIterator(); - while(i6.hasNext()) { - var i7 = i6.next(); - if(i7.getNameOfTheComponentKind() == "Input") { - var inport_12 = new model_component_Inport(xPosition + width / 2,height / (inportCount + 1) * (i7.get_componentKind().get_sequence() + 1) + (yPosition - height / 2)); - inport_12.set_sequence(i7.get_componentKind().get_sequence()); - portArray.push(inport_12); - } else if(i7.getNameOfTheComponentKind() == "Output") { - var outport_2 = new model_component_Outport(xPosition - width / 2,height / (outportCount + 1) * (i7.get_componentKind().get_sequence() + 1) + (yPosition - height / 2)); - outport_2.set_sequence(i7.get_componentKind().get_sequence()); - portArray.push(outport_2); - } - } - break; - case 3: - var i8 = this.circuitDiagram.get_componentIterator(); - while(i8.hasNext()) { - var i9 = i8.next(); - if(i9.getNameOfTheComponentKind() == "Input") { - var inport_13 = new model_component_Inport(xPosition - width / 2,height / (inportCount + 1) * (i9.get_componentKind().get_sequence() + 1) + (yPosition - height / 2)); - inport_13.set_sequence(i9.get_componentKind().get_sequence()); - portArray.push(inport_13); - } else if(i9.getNameOfTheComponentKind() == "Output") { - var outport_3 = new model_component_Outport(xPosition + width / 2,height / (outportCount + 1) * (i9.get_componentKind().get_sequence() + 1) + (yPosition - height / 2)); - outport_3.set_sequence(i9.get_componentKind().get_sequence()); - portArray.push(outport_3); - } - } - break; - default: - var e = new assertions_AssertionFailure("false",[]); - haxe_Log.trace("Throwing exception " + Std.string(e),{ fileName : "src/model/gates/CompoundComponent.hx", lineNumber : 152, className : "model.gates.CompoundComponent", methodName : "createPorts"}); - throw new js__$Boot_HaxeError(e); - } - return portArray; - } - ,drawComponent: function(drawingAdapter,hightLight,linkAndComponentArray) { - var drawingAdapterTrans = drawingAdapter.transform(this.makeTransform()); - var drawComponent = new view_drawComponents_DrawCompoundComponent(this.component,drawingAdapter,drawingAdapterTrans); - if(hightLight) { - drawComponent.drawCorrespondingComponent("red"); - } else { - drawComponent.drawCorrespondingComponent("black"); - } - if(this.component.get_boxType() == model_enumeration_BOX.WHITE_BOX) { - this.circuitDiagram.draw(drawingAdapterTrans,linkAndComponentArray); - } - } - ,makeTransform: function() { - var transform = model_drawingInterface_Transform.identity(); - transform = transform.translate(-this.circuitDiagram.getComponentAndLinkCenterCoordinate().get_xPosition(),-this.circuitDiagram.getComponentAndLinkCenterCoordinate().get_yPosition()).scale(this.component.get_width() / this.circuitDiagram.get_diagramWidth(),this.component.get_height() / this.circuitDiagram.get_diagramHeight()).translate(this.component.get_xPosition(),this.component.get_yPosition()); - return transform; - } - ,findHitList: function(outerWorldCoordinates,mode) { - var hitObjectArray = []; - var hitComponent = this.isInComponent(outerWorldCoordinates); - if(hitComponent == null) { - return hitObjectArray; - } else if(this.component.get_boxType() == model_enumeration_BOX.WHITE_BOX) { - var transform = this.makeTransform(); - var innerWorldCoordinates = transform.pointInvert(outerWorldCoordinates); - var result = this.circuitDiagram.findHitList(innerWorldCoordinates,mode); - if(result.length == 0 || mode == model_enumeration_MODE.INCLUDE_PARENTS) { - var hitObject = new type_HitObject(); - hitObject.set_component(this.component); - result.push(hitObject); - } - return result; - } else { - var hitObject1 = new type_HitObject(); - hitObject1.set_component(this.component); - hitObjectArray.push(hitObject1); - return hitObjectArray; - } - } - ,findWorldPoint: function(worldCoordinate,mode) { - var worldPointArray = []; - if(this.isInComponent(worldCoordinate) == null) { - return worldPointArray; - } else if(this.component.get_boxType() == model_enumeration_BOX.WHITE_BOX) { - var transform = this.makeTransform(); - var wForDiagram = transform.pointInvert(worldCoordinate); - return this.circuitDiagram.findWorldPoint(wForDiagram,mode); - } else { - return worldPointArray; - } - } - ,__class__: model_gates_CompoundComponent -}); -var model_gates_NAND = function() { - this.nameOfTheComponentKind = "NAND"; - model_gates_AbstractComponentKind.call(this); - this.attributes.push(new model_attribute_IntAttr("delay")); -}; -$hxClasses["model.gates.NAND"] = model_gates_NAND; -model_gates_NAND.__name__ = "model.gates.NAND"; -model_gates_NAND.__interfaces__ = [model_gates_ComponentKind]; -model_gates_NAND.__super__ = model_gates_AbstractComponentKind; -model_gates_NAND.prototype = $extend(model_gates_AbstractComponentKind.prototype,{ - nameOfTheComponentKind: null - ,setname: function(s) { - this.nameOfTheComponentKind = s; - } - ,getname: function() { - return this.nameOfTheComponentKind; - } - ,createPorts: function(xPosition,yPosition,height,width,orientation,inportNum) { - var portArray = []; - if(inportNum == null || inportNum < 2) { - inportNum = 2; - } - switch(orientation._hx_index) { - case 0: - var counter = 0; - while(counter < inportNum) { - var inport = new model_component_Inport(xPosition - width / 2 + width / (inportNum + 1) * (counter + 1),yPosition + height / 2); - inport.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport); - ++counter; - } - var outport_ = new model_component_Outport(xPosition,yPosition - height / 2); - outport_.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_); - break; - case 1: - var counter1 = 0; - while(counter1 < inportNum) { - var inport1 = new model_component_Inport(xPosition - width / 2 + width / (inportNum + 1) * (counter1 + 1),yPosition - height / 2); - inport1.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport1); - ++counter1; - } - var outport_1 = new model_component_Outport(xPosition,yPosition + height / 2); - outport_1.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_1); - break; - case 2: - var counter2 = 0; - while(counter2 < inportNum) { - var inport2 = new model_component_Inport(xPosition + width / 2,height / (inportNum + 1) * (counter2 + 1) + (yPosition - height / 2)); - inport2.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport2); - ++counter2; - } - var outport_2 = new model_component_Outport(xPosition - width / 2,yPosition); - outport_2.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_2); - break; - case 3: - var counter3 = 0; - while(counter3 < inportNum) { - var inport3 = new model_component_Inport(xPosition - width / 2,height / (inportNum + 1) * (counter3 + 1) + (yPosition - height / 2)); - inport3.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport3); - ++counter3; - } - var outport_3 = new model_component_Outport(xPosition + width / 2,yPosition); - outport_3.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_3); - break; - default: - } - return portArray; - } - ,drawComponent: function(drawingAdapter,highLight,linkAndComponentArray) { - var drawComponent = new view_drawComponents_DrawNAND(this.component,drawingAdapter); - if(highLight) { - drawComponent.drawCorrespondingComponent("red"); - } else { - drawComponent.drawCorrespondingComponent("black"); - } - } - ,__class__: model_gates_NAND -}); -var model_gates_NOR = function() { - this.nameOfTheComponentKind = "NOR"; - model_gates_AbstractComponentKind.call(this); - this.attributes.push(new model_attribute_IntAttr("delay")); -}; -$hxClasses["model.gates.NOR"] = model_gates_NOR; -model_gates_NOR.__name__ = "model.gates.NOR"; -model_gates_NOR.__interfaces__ = [model_gates_ComponentKind]; -model_gates_NOR.__super__ = model_gates_AbstractComponentKind; -model_gates_NOR.prototype = $extend(model_gates_AbstractComponentKind.prototype,{ - nameOfTheComponentKind: null - ,setname: function(s) { - this.nameOfTheComponentKind = s; - } - ,getname: function() { - return this.nameOfTheComponentKind; - } - ,createPorts: function(xPosition,yPosition,height,width,orientation,inportNum) { - var portArray = []; - if(inportNum == null || inportNum < 2) { - inportNum = 2; - } - switch(orientation._hx_index) { - case 0: - var counter = 0; - while(counter < inportNum) { - var inport = new model_component_Inport(xPosition - width / 2 + width / (inportNum + 1) * (counter + 1),yPosition + height / 2); - inport.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport); - ++counter; - } - var outport_ = new model_component_Outport(xPosition,yPosition - height / 2); - outport_.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_); - break; - case 1: - var counter1 = 0; - while(counter1 < inportNum) { - var inport1 = new model_component_Inport(xPosition - width / 2 + width / (inportNum + 1) * (counter1 + 1),yPosition - height / 2); - inport1.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport1); - ++counter1; - } - var outport_1 = new model_component_Outport(xPosition,yPosition + height / 2); - outport_1.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_1); - break; - case 2: - var counter2 = 0; - while(counter2 < inportNum) { - var inport2 = new model_component_Inport(xPosition + width / 2,height / (inportNum + 1) * (counter2 + 1) + (yPosition - height / 2)); - inport2.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport2); - ++counter2; - } - var outport_2 = new model_component_Outport(xPosition - width / 2,yPosition); - outport_2.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_2); - break; - case 3: - var counter3 = 0; - while(counter3 < inportNum) { - var inport3 = new model_component_Inport(xPosition - width / 2,height / (inportNum + 1) * (counter3 + 1) + (yPosition - height / 2)); - inport3.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport3); - ++counter3; - } - var outport_3 = new model_component_Outport(xPosition + width / 2,yPosition); - outport_3.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_3); - break; - default: - } - return portArray; - } - ,drawComponent: function(drawingAdapter,highLight,linkAndComponentArray) { - var drawComponent = new view_drawComponents_DrawNOR(this.component,drawingAdapter); - if(highLight) { - drawComponent.drawCorrespondingComponent("red"); - } else { - drawComponent.drawCorrespondingComponent("black"); - } - } - ,__class__: model_gates_NOR -}); -var model_gates_NOT = function() { - this.nameOfTheComponentKind = "NOT"; - model_gates_AbstractComponentKind.call(this); - this.attributes.push(new model_attribute_IntAttr("delay")); -}; -$hxClasses["model.gates.NOT"] = model_gates_NOT; -model_gates_NOT.__name__ = "model.gates.NOT"; -model_gates_NOT.__interfaces__ = [model_gates_ComponentKind]; -model_gates_NOT.__super__ = model_gates_AbstractComponentKind; -model_gates_NOT.prototype = $extend(model_gates_AbstractComponentKind.prototype,{ - nameOfTheComponentKind: null - ,setname: function(s) { - this.nameOfTheComponentKind = s; - } - ,getname: function() { - return this.nameOfTheComponentKind; - } - ,createPorts: function(xPosition,yPosition,height,width,orientation,inportNum) { - var portArray = []; - inportNum = 1; - switch(orientation._hx_index) { - case 0: - var counter = 0; - while(counter < inportNum) { - var inport = new model_component_Inport(xPosition - width / 2 + width / (inportNum + 1) * (counter + 1),yPosition + height / 2); - inport.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport); - ++counter; - } - var outport_ = new model_component_Outport(xPosition,yPosition - height / 2); - outport_.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_); - break; - case 1: - var counter1 = 0; - while(counter1 < inportNum) { - var inport1 = new model_component_Inport(xPosition - width / 2 + width / (inportNum + 1) * (counter1 + 1),yPosition - height / 2); - inport1.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport1); - ++counter1; - } - var outport_1 = new model_component_Outport(xPosition,yPosition + height / 2); - outport_1.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_1); - break; - case 2: - var counter2 = 0; - while(counter2 < inportNum) { - var inport2 = new model_component_Inport(xPosition + width / 2,height / (inportNum + 1) * (counter2 + 1) + (yPosition - height / 2)); - inport2.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport2); - ++counter2; - } - var outport_2 = new model_component_Outport(xPosition - width / 2,yPosition); - outport_2.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_2); - break; - case 3: - var counter3 = 0; - while(counter3 < inportNum) { - var inport3 = new model_component_Inport(xPosition - width / 2,height / (inportNum + 1) * (counter3 + 1) + (yPosition - height / 2)); - inport3.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport3); - ++counter3; - } - var outport_3 = new model_component_Outport(xPosition + width / 2,yPosition); - outport_3.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_3); - break; - default: - } - return portArray; - } - ,drawComponent: function(drawingAdapter,highLight,linkAndComponentArray) { - var drawComponent = new view_drawComponents_DrawNOT(this.component,drawingAdapter); - if(highLight) { - drawComponent.drawCorrespondingComponent("red"); - } else { - drawComponent.drawCorrespondingComponent("black"); - } - } - ,__class__: model_gates_NOT -}); -var model_gates_OR = function() { - this.nameOfTheComponentKind = "OR"; - model_gates_AbstractComponentKind.call(this); - this.attributes.push(new model_attribute_IntAttr("delay")); -}; -$hxClasses["model.gates.OR"] = model_gates_OR; -model_gates_OR.__name__ = "model.gates.OR"; -model_gates_OR.__interfaces__ = [model_gates_ComponentKind]; -model_gates_OR.__super__ = model_gates_AbstractComponentKind; -model_gates_OR.prototype = $extend(model_gates_AbstractComponentKind.prototype,{ - nameOfTheComponentKind: null - ,setname: function(s) { - this.nameOfTheComponentKind = s; - } - ,getname: function() { - return this.nameOfTheComponentKind; - } - ,createPorts: function(xPosition,yPosition,height,width,orientation,inportNum) { - var portArray = []; - if(inportNum == null || inportNum < 3) { - inportNum = 2; - } - switch(orientation._hx_index) { - case 0: - var counter = 0; - while(counter < inportNum) { - var inport = new model_component_Inport(xPosition - width / 2 + width / (inportNum + 1) * (counter + 1),yPosition + height / 2); - inport.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport); - ++counter; - } - var outport_ = new model_component_Outport(xPosition,yPosition - height / 2); - outport_.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_); - break; - case 1: - var counter1 = 0; - while(counter1 < inportNum) { - var inport1 = new model_component_Inport(xPosition - width / 2 + width / (inportNum + 1) * (counter1 + 1),yPosition - height / 2); - inport1.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport1); - ++counter1; - } - var outport_1 = new model_component_Outport(xPosition,yPosition + height / 2); - outport_1.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_1); - break; - case 2: - var counter2 = 0; - while(counter2 < inportNum) { - var inport2 = new model_component_Inport(xPosition + width / 2,height / (inportNum + 1) * (counter2 + 1) + (yPosition - height / 2)); - inport2.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport2); - ++counter2; - } - var outport_2 = new model_component_Outport(xPosition - width / 2,yPosition); - outport_2.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_2); - break; - case 3: - var counter3 = 0; - while(counter3 < inportNum) { - var inport3 = new model_component_Inport(xPosition - width / 2,height / (inportNum + 1) * (counter3 + 1) + (yPosition - height / 2)); - inport3.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport3); - ++counter3; - } - var outport_3 = new model_component_Outport(xPosition + width / 2,yPosition); - outport_3.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_3); - break; - default: - } - return portArray; - } - ,drawComponent: function(drawingAdapter,highLight,linkAndComponentArray) { - var drawComponent = new view_drawComponents_DrawOR(this.component,drawingAdapter); - if(highLight) { - drawComponent.drawCorrespondingComponent("red"); - } else { - drawComponent.drawCorrespondingComponent("black"); - } - } - ,__class__: model_gates_OR -}); -var model_gates_XOR = function() { - this.nameOfTheComponentKind = "XOR"; - model_gates_AbstractComponentKind.call(this); - this.attributes.push(new model_attribute_IntAttr("delay")); -}; -$hxClasses["model.gates.XOR"] = model_gates_XOR; -model_gates_XOR.__name__ = "model.gates.XOR"; -model_gates_XOR.__interfaces__ = [model_gates_ComponentKind]; -model_gates_XOR.__super__ = model_gates_AbstractComponentKind; -model_gates_XOR.prototype = $extend(model_gates_AbstractComponentKind.prototype,{ - nameOfTheComponentKind: null - ,setname: function(s) { - this.nameOfTheComponentKind = s; - } - ,getname: function() { - return this.nameOfTheComponentKind; - } - ,createPorts: function(xPosition,yPosition,height,width,orientation,inportNum) { - var portArray = []; - if(inportNum == null || inportNum < 2) { - inportNum = 2; - } - switch(orientation._hx_index) { - case 0: - var counter = 0; - while(counter < inportNum) { - var inport = new model_component_Inport(xPosition - width / 2 + width / (inportNum + 1) * (counter + 1),yPosition + height / 2); - inport.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport); - ++counter; - } - var outport_ = new model_component_Outport(xPosition,yPosition - height / 2); - outport_.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_); - break; - case 1: - var counter1 = 0; - while(counter1 < inportNum) { - var inport1 = new model_component_Inport(xPosition - width / 2 + width / (inportNum + 1) * (counter1 + 1),yPosition - height / 2); - inport1.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport1); - ++counter1; - } - var outport_1 = new model_component_Outport(xPosition,yPosition + height / 2); - outport_1.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_1); - break; - case 2: - var counter2 = 0; - while(counter2 < inportNum) { - var inport2 = new model_component_Inport(xPosition + width / 2,height / (inportNum + 1) * (counter2 + 1) + (yPosition - height / 2)); - inport2.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport2); - ++counter2; - } - var outport_2 = new model_component_Outport(xPosition - width / 2,yPosition); - outport_2.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_2); - break; - case 3: - var counter3 = 0; - while(counter3 < inportNum) { - var inport3 = new model_component_Inport(xPosition - width / 2,height / (inportNum + 1) * (counter3 + 1) + (yPosition - height / 2)); - inport3.set_portDescription(model_enumeration_IOTYPE.INPUT); - portArray.push(inport3); - ++counter3; - } - var outport_3 = new model_component_Outport(xPosition + width / 2,yPosition); - outport_3.set_portDescription(model_enumeration_IOTYPE.OUTPUT); - portArray.push(outport_3); - break; - default: - } - return portArray; - } - ,drawComponent: function(drawingAdapter,highLight,linkAndComponentArray) { - var drawComponent = new view_drawComponents_DrawXOR(this.component,drawingAdapter); - if(highLight) { - drawComponent.drawCorrespondingComponent("red"); - } else { - drawComponent.drawCorrespondingComponent("black"); - } - } - ,__class__: model_gates_XOR -}); -var model_selectionModel_SelectionModel = function(linkArray,componentArray) { - this.selectedComponents = componentArray; - this.selectedLinks = linkArray; -}; -$hxClasses["model.selectionModel.SelectionModel"] = model_selectionModel_SelectionModel; -model_selectionModel_SelectionModel.__name__ = "model.selectionModel.SelectionModel"; -model_selectionModel_SelectionModel.prototype = { - selectedComponents: null - ,selectedLinks: null - ,getSelectedComponents: function() { - return this.selectedComponents; - } - ,getSelectedLinks: function() { - return this.selectedLinks; - } - ,addLinkToSelection: function(link) { - this.selectedLinks.push(link); - } - ,addComponentToSelection: function(component) { - this.selectedComponents.push(component); - } - ,removeLinkFromSelection: function(link) { - HxOverrides.remove(this.selectedLinks,link); - } - ,removeComponentFromSelection: function(component) { - HxOverrides.remove(this.selectedComponents,component); - } - ,__class__: model_selectionModel_SelectionModel -}; -var model_tabModel_TabModel = function(circuitDiagram,view) { - var _gthis = this; - this.view = view; - this.circuitDiagram = circuitDiagram; - this.selectionModel = new model_selectionModel_SelectionModel([],[]); - var canvasDisplayScreen = window.document.querySelector("#displayScreen"); - var innerCanvas = window.document.createElement("canvas"); - innerCanvas.id = "canvasToDraw"; - canvasDisplayScreen.appendChild(innerCanvas); - innerCanvas.style.width = "100%"; - innerCanvas.style.height = "100%"; - canvasDisplayScreen.addEventListener("dragover",function(event) { - event.preventDefault(); - event.dataTransfer.dropEffect = "move"; - }); - canvasDisplayScreen.addEventListener("drop",function(event1) { - event1.preventDefault(); - var data = event1.dataTransfer.getData("text/plain"); - console.log("co-ordinates ::",event1.layerX,event1.layerY); - var eventPassed = JSON.parse(data); - eventPassed.posX = event1.pageX; - eventPassed.posY = event1.pageY; - _gthis.view.updateCanvasListener(eventPassed); - }); - this.canvasElement = innerCanvas; -}; -$hxClasses["model.tabModel.TabModel"] = model_tabModel_TabModel; -model_tabModel_TabModel.__name__ = "model.tabModel.TabModel"; -model_tabModel_TabModel.prototype = { - view: null - ,selectionModel: null - ,circuitDiagram: null - ,canvasElement: null - ,getCircuitDiagram: function() { - return this.circuitDiagram; - } - ,getSelectionModel: function() { - return this.selectionModel; - } - ,addLinksToSelection: function(links) { - this.selectionModel.getSelectedLinks().concat(links); - } - ,addComponentsToSelection: function(components) { - this.selectionModel.getSelectedComponents().concat(components); - } - ,removeLinksFromSelection: function(links) { - var _g = 0; - while(_g < links.length) { - var link = links[_g]; - ++_g; - this.selectionModel.removeLinkFromSelection(link); - } - } - ,removeComponentsFromSelection: function(components) { - var _g = 0; - while(_g < components.length) { - var component = components[_g]; - ++_g; - this.selectionModel.removeComponentFromSelection(component); - } - } - ,getCanvasContext: function() { - return this.canvasElement; - } - ,setCanvasContext: function(canvas) { - this.canvasElement = canvas; - } - ,__class__: model_tabModel_TabModel -}; -var type_Coordinate = function(xPosition,yPosition) { - this.set_xPosition(xPosition); - this.set_yPosition(yPosition); -}; -$hxClasses["type.Coordinate"] = type_Coordinate; -type_Coordinate.__name__ = "type.Coordinate"; -type_Coordinate.prototype = { - xPosition: null - ,yPosition: null - ,get_xPosition: function() { - return this.xPosition; - } - ,set_xPosition: function(value) { - return this.xPosition = value; - } - ,get_yPosition: function() { - return this.yPosition; - } - ,set_yPosition: function(value) { - return this.yPosition = value; - } - ,__class__: type_Coordinate - ,__properties__: {set_yPosition:"set_yPosition",get_yPosition:"get_yPosition",set_xPosition:"set_xPosition",get_xPosition:"get_xPosition"} -}; -var type_HitObject = function() { -}; -$hxClasses["type.HitObject"] = type_HitObject; -type_HitObject.__name__ = "type.HitObject"; -type_HitObject.prototype = { - circuitDiagram: null - ,component: null - ,link: null - ,port: null - ,endpoint: null - ,hitNothing: function() { - if(this.component == null && this.link == null && this.port == null && this.endpoint == null) { - return true; - } else { - return false; - } - } - ,get_circuitDiagram: function() { - return this.circuitDiagram; - } - ,set_circuitDiagram: function(value) { - return this.circuitDiagram = value; - } - ,get_component: function() { - return this.component; - } - ,set_component: function(value) { - return this.component = value; - } - ,get_link: function() { - return this.link; - } - ,set_link: function(value) { - return this.link = value; - } - ,get_port: function() { - return this.port; - } - ,set_port: function(value) { - return this.port = value; - } - ,get_endpoint: function() { - return this.endpoint; - } - ,set_endpoint: function(value) { - return this.endpoint = value; - } - ,__class__: type_HitObject -}; -var type_LinkAndComponentAndEndpointAndPortArray = function() { - this.linkArray = []; - this.componentArray = []; - this.endponentArray = []; - this.portArray = []; -}; -$hxClasses["type.LinkAndComponentAndEndpointAndPortArray"] = type_LinkAndComponentAndEndpointAndPortArray; -type_LinkAndComponentAndEndpointAndPortArray.__name__ = "type.LinkAndComponentAndEndpointAndPortArray"; -type_LinkAndComponentAndEndpointAndPortArray.prototype = { - linkArray: null - ,componentArray: null - ,endponentArray: null - ,portArray: null - ,addLink: function(link) { - if(this.linkArray.indexOf(link) == -1 && link != null) { - this.linkArray.push(link); - } - } - ,addComponent: function(component) { - if(this.componentArray.indexOf(component) == -1 && component != null) { - this.componentArray.push(component); - } - } - ,addEndpoint: function(endpoint) { - if(this.endponentArray.indexOf(endpoint) == -1 && endpoint != null) { - this.endponentArray.push(endpoint); - } - } - ,addPort: function(port) { - if(this.portArray.indexOf(port) == -1 && port != null) { - this.portArray.push(port); - } - } - ,removeLink: function(link) { - if(this.linkArray.indexOf(link) != -1 && link != null) { - HxOverrides.remove(this.linkArray,link); - } - } - ,removeComponent: function(component) { - if(this.componentArray.indexOf(component) != -1 && component != null) { - HxOverrides.remove(this.componentArray,component); - } - } - ,removeEndpoint: function(endpoint) { - if(this.endponentArray.indexOf(endpoint) != -1 && endpoint != null) { - HxOverrides.remove(this.endponentArray,endpoint); - } - } - ,removePort: function(port) { - if(this.portArray.indexOf(port) != -1 && port != null) { - HxOverrides.remove(this.portArray,port); - } - } - ,get_linkIterator: function() { - return HxOverrides.iter(this.linkArray); - } - ,get_componentIterator: function() { - return HxOverrides.iter(this.componentArray); - } - ,get_endpointIterator: function() { - return HxOverrides.iter(this.endponentArray); - } - ,get_portIterator: function() { - return HxOverrides.iter(this.portArray); - } - ,getLinkIteratorLength: function() { - return this.linkArray.length; - } - ,getEndppointIteratorLength: function() { - return this.endponentArray.length; - } - ,getComponentIteratorLength: function() { - return this.componentArray.length; - } - ,getPortIteratorLength: function() { - return this.portArray.length; - } - ,getComponentFromIndex: function(index) { - return this.componentArray[index]; - } - ,getLinkFromIndex: function(index) { - return this.linkArray[index]; - } - ,getEndpointFromIndex: function(index) { - return this.endponentArray[index]; - } - ,getPortFromIndex: function(index) { - return this.portArray[index]; - } - ,setArray: function(array) { - this.clean(); - var i = array.get_linkIterator(); - while(i.hasNext()) { - var i1 = i.next(); - this.addLink(i1); - } - var i2 = array.get_componentIterator(); - while(i2.hasNext()) { - var i3 = i2.next(); - this.addComponent(i3); - } - var i4 = array.get_portIterator(); - while(i4.hasNext()) { - var i5 = i4.next(); - this.addPort(i5); - } - var i6 = array.get_endpointIterator(); - while(i6.hasNext()) { - var i7 = i6.next(); - this.addEndpoint(i7); - } - } - ,clean: function() { - this.linkArray.splice(0,this.linkArray.length); - this.componentArray.splice(0,this.componentArray.length); - this.endponentArray.splice(0,this.endponentArray.length); - this.portArray.splice(0,this.portArray.length); - } - ,isEmpty: function() { - if(this.linkArray.length == 0 && this.componentArray.length == 0 && this.endponentArray.length == 0 && this.portArray.length == 0) { - return true; - } else { - return false; - } - } - ,__class__: type_LinkAndComponentAndEndpointAndPortArray -}; -var type_WorldPoint = function(circuitDiagram,coordinate) { - this.circuitDiagram = circuitDiagram; - this.coordinate = coordinate; -}; -$hxClasses["type.WorldPoint"] = type_WorldPoint; -type_WorldPoint.__name__ = "type.WorldPoint"; -type_WorldPoint.prototype = { - circuitDiagram: null - ,coordinate: null - ,get_circuitDiagram: function() { - return this.circuitDiagram; - } - ,set_circuitDiagram: function(value) { - return this.circuitDiagram = value; - } - ,get_coordinate: function() { - return this.coordinate; - } - ,set_coordinate: function(value) { - return this.coordinate = value; - } - ,__class__: type_WorldPoint -}; -var view_View = function() { - this.allTabs = []; - var _gthis = this; - this.activeTab = new model_tabModel_TabModel(new model_component_CircuitDiagram(),this); - this.allTabs.push(this.activeTab); - haxe_Log.trace("DOM example",{ fileName : "src/view/View.hx", lineNumber : 28, className : "view.View", methodName : "new"}); - window.document.addEventListener("DOMContentLoaded",function(event) { - haxe_Log.trace("DOM ready",{ fileName : "src/view/View.hx", lineNumber : 31, className : "view.View", methodName : "new"}); - window.document.querySelector("#clickMe").addEventListener("click",function(event1) { - console.log("clickable was clicked"); - _gthis.sidebarListener.update("clickMe"); - }); - var draggableBox = window.document.querySelector("#dragMe"); - draggableBox.draggable = true; - draggableBox.addEventListener("drag",function(event2) { - console.log("draggable is being dragged"); - }); - draggableBox.addEventListener("dragstart",function(event3) { - event3.dataTransfer.setData("text/plain",event3.target.id); - console.log(event3.dataTransfer.items); - event3.dataTransfer.dropEffect = "move"; - }); - }); -}; -$hxClasses["view.View"] = view_View; -view_View.__name__ = "view.View"; -view_View.prototype = { - sidebarListener: null - ,canvasListener: null - ,activeTab: null - ,allTabs: null - ,setSidebarListener: function(listener) { - this.sidebarListener = listener; - } - ,setCanvasListener: function(listener) { - this.canvasListener = listener; - } - ,updateThisBox: function(updateString) { - var updateThis = window.document.querySelector("#updateThis"); - updateThis.innerText = updateString; - } - ,updateSidebarOptions: function() { - console.log("updateSidebarOptions has been called"); - } - ,updateCanvasListener: function(eventObject) { - if(eventObject.eventType == "sidebarDrag") { - this.canvasListener.addComponentToCanvas(eventObject); - } - } - ,updateCanvas: function() { - console.log("view.updateCanvas"); - var drawingAdapter = new model_drawingInterface_DrawingAdapter(model_drawingInterface_Transform.identity(),this.activeTab.getCanvasContext().getContext("2d",null)); - this.activeTab.getCircuitDiagram().draw(drawingAdapter); - } - ,setActiveTab: function() { - this.canvasListener.setActiveTab(this.activeTab); - } - ,__class__: view_View -}; -var view_drawComponents_DrawComponent = function() { }; -$hxClasses["view.drawComponents.DrawComponent"] = view_drawComponents_DrawComponent; -view_drawComponents_DrawComponent.__name__ = "view.drawComponents.DrawComponent"; -view_drawComponents_DrawComponent.__isInterface__ = true; -view_drawComponents_DrawComponent.prototype = { - drawCorrespondingComponent: null - ,__class__: view_drawComponents_DrawComponent -}; -var view_drawComponents_DrawAND = function(component,drawingAdapter) { - this.component = component; - this.drawingAdapter = drawingAdapter; -}; -$hxClasses["view.drawComponents.DrawAND"] = view_drawComponents_DrawAND; -view_drawComponents_DrawAND.__name__ = "view.drawComponents.DrawAND"; -view_drawComponents_DrawAND.__interfaces__ = [view_drawComponents_DrawComponent]; -view_drawComponents_DrawAND.prototype = { - drawingAdapter: null - ,component: null - ,drawCorrespondingComponent: function(strokeColor) { - if(strokeColor == null || strokeColor == "") { - strokeColor = "black"; - } - this.drawingAdapter.setStrokeColor(strokeColor); - this.drawingAdapter.drawAndShape(this.component.get_xPosition(),this.component.get_yPosition(),this.component.get_width(),this.component.get_height(),this.component.get_orientation()); - var i = this.component.get_inportIterator(); - while(i.hasNext()) { - var i1 = i.next(); - var port = i1; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port.get_xPosition(),port.get_yPosition(),global_Constant.portRadius); - } - var i2 = this.component.get_outportIterator(); - while(i2.hasNext()) { - var i3 = i2.next(); - var port1 = i3; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port1.get_xPosition(),port1.get_yPosition(),global_Constant.portRadius); - } - this.drawingAdapter.resetDrawingParam(); - } - ,__class__: view_drawComponents_DrawAND -}; -var view_drawComponents_DrawCompoundComponent = function(component,drawingAdapter,drawingAdapterTrans) { - this.component = component; - this.drawingAdapter = drawingAdapter; - this.drawingAdapterTrans = drawingAdapterTrans; -}; -$hxClasses["view.drawComponents.DrawCompoundComponent"] = view_drawComponents_DrawCompoundComponent; -view_drawComponents_DrawCompoundComponent.__name__ = "view.drawComponents.DrawCompoundComponent"; -view_drawComponents_DrawCompoundComponent.__interfaces__ = [view_drawComponents_DrawComponent]; -view_drawComponents_DrawCompoundComponent.prototype = { - drawingAdapter: null - ,component: null - ,drawingAdapterTrans: null - ,drawCorrespondingComponent: function(strokeColor) { - if(strokeColor == null || strokeColor == "") { - strokeColor = "black"; - } - var i = this.component.get_inportIterator(); - while(i.hasNext()) { - var i1 = i.next(); - var port = i1; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port.get_xPosition(),port.get_yPosition(),global_Constant.portRadius); - } - var i2 = this.component.get_outportIterator(); - while(i2.hasNext()) { - var i3 = i2.next(); - var port1 = i3; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port1.get_xPosition(),port1.get_yPosition(),global_Constant.portRadius); - } - this.drawingAdapter.setStrokeColor(strokeColor); - if(this.component.get_boxType() == model_enumeration_BOX.WHITE_BOX) { - this.drawingAdapter.setFillColor("white"); - } else { - this.drawingAdapter.setFillColor("gray"); - } - this.drawingAdapter.drawRect(this.component.get_xPosition(),this.component.get_yPosition(),this.component.get_width(),this.component.get_height()); - this.drawingAdapter.setClip(this.component.get_xPosition(),this.component.get_yPosition(),this.component.get_width(),this.component.get_height()); - if(this.component.get_boxType() == model_enumeration_BOX.BLACK_BOX) { - this.drawingAdapter.setTextColor("black"); - this.drawingAdapter.drawText(this.component.get_name(),this.component.get_xPosition(),this.component.get_yPosition(),this.component.get_width()); - } - this.drawInportAndOutport(); - this.drawingAdapter.resetDrawingParam(); - } - ,drawInportAndOutport: function() { - var i = this.component.get_inportIterator(); - while(i.hasNext()) { - var i1 = i.next(); - var port = i1; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port.get_xPosition(),port.get_yPosition(),global_Constant.portRadius); - if(this.component.get_boxType() == model_enumeration_BOX.WHITE_BOX) { - var j = this.component.get_componentKind().getInnerCircuitDiagram().get_componentIterator(); - while(j.hasNext()) { - var j1 = j.next(); - if(j1.getNameOfTheComponentKind() == "Input") { - if(i1.get_sequence() == j1.get_componentKind().get_sequence()) { - var k = j1.get_inportIterator(); - while(k.hasNext()) { - var k1 = k.next(); - var coordinate = this.drawingAdapterTrans.getTransform().pointConvert(new type_Coordinate(k1.get_xPosition(),k1.get_yPosition())); - coordinate = this.drawingAdapter.getTransform().pointInvert(coordinate); - this.drawingAdapter.drawLine(i1.get_xPosition(),i1.get_yPosition(),coordinate.get_xPosition(),coordinate.get_yPosition()); - } - } - } - } - } - } - var i2 = this.component.get_outportIterator(); - while(i2.hasNext()) { - var i3 = i2.next(); - var port1 = i3; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port1.get_xPosition(),port1.get_yPosition(),global_Constant.portRadius); - if(this.component.get_boxType() == model_enumeration_BOX.WHITE_BOX) { - var j2 = this.component.get_componentKind().getInnerCircuitDiagram().get_componentIterator(); - while(j2.hasNext()) { - var j3 = j2.next(); - if(j3.getNameOfTheComponentKind() == "Output") { - if(i3.get_sequence() == j3.get_componentKind().get_sequence()) { - var k2 = j3.get_outportIterator(); - while(k2.hasNext()) { - var k3 = k2.next(); - var coordinate1 = this.drawingAdapterTrans.getTransform().pointConvert(new type_Coordinate(k3.get_xPosition(),k3.get_yPosition())); - coordinate1 = this.drawingAdapter.getTransform().pointInvert(coordinate1); - this.drawingAdapter.drawLine(i3.get_xPosition(),i3.get_yPosition(),coordinate1.get_xPosition(),coordinate1.get_yPosition()); - } - } - } - } - } - } - } - ,__class__: view_drawComponents_DrawCompoundComponent -}; -var view_drawComponents_DrawLink = function(link,drawingAdapter) { - this.link = link; - this.drawingAdapter = drawingAdapter; -}; -$hxClasses["view.drawComponents.DrawLink"] = view_drawComponents_DrawLink; -view_drawComponents_DrawLink.__name__ = "view.drawComponents.DrawLink"; -view_drawComponents_DrawLink.__interfaces__ = [view_drawComponents_DrawComponent]; -view_drawComponents_DrawLink.prototype = { - drawingAdapter: null - ,link: null - ,drawCorrespondingComponent: function(strokeColor) { - if(strokeColor == null || strokeColor == "") { - strokeColor = "black"; - } - this.drawingAdapter.setStrokeColor(strokeColor); - this.drawingAdapter.drawLine(this.link.get_leftEndpoint().get_xPosition(),this.link.get_leftEndpoint().get_yPosition(),this.link.get_rightEndpoint().get_xPosition(),this.link.get_rightEndpoint().get_yPosition()); - } - ,__class__: view_drawComponents_DrawLink -}; -var view_drawComponents_DrawNAND = function(component,drawingAdapter) { - this.component = component; - this.drawingAdapter = drawingAdapter; -}; -$hxClasses["view.drawComponents.DrawNAND"] = view_drawComponents_DrawNAND; -view_drawComponents_DrawNAND.__name__ = "view.drawComponents.DrawNAND"; -view_drawComponents_DrawNAND.__interfaces__ = [view_drawComponents_DrawComponent]; -view_drawComponents_DrawNAND.prototype = { - drawingAdapter: null - ,component: null - ,drawCorrespondingComponent: function(strokeColor) { - if(strokeColor == null || strokeColor == "") { - strokeColor = "black"; - } - this.drawingAdapter.setStrokeColor(strokeColor); - this.drawingAdapter.drawNAndShape(this.component.get_xPosition(),this.component.get_yPosition(),this.component.get_width(),this.component.get_height(),this.component.get_orientation()); - var i = this.component.get_inportIterator(); - while(i.hasNext()) { - var i1 = i.next(); - var port = i1; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port.get_xPosition(),port.get_yPosition(),global_Constant.portRadius); - } - var i2 = this.component.get_outportIterator(); - while(i2.hasNext()) { - var i3 = i2.next(); - var port1 = i3; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port1.get_xPosition(),port1.get_yPosition(),global_Constant.portRadius); - } - this.drawingAdapter.resetDrawingParam(); - } - ,__class__: view_drawComponents_DrawNAND -}; -var view_drawComponents_DrawNOR = function(component,drawingAdapter) { - this.component = component; - this.drawingAdapter = drawingAdapter; -}; -$hxClasses["view.drawComponents.DrawNOR"] = view_drawComponents_DrawNOR; -view_drawComponents_DrawNOR.__name__ = "view.drawComponents.DrawNOR"; -view_drawComponents_DrawNOR.__interfaces__ = [view_drawComponents_DrawComponent]; -view_drawComponents_DrawNOR.prototype = { - drawingAdapter: null - ,component: null - ,drawCorrespondingComponent: function(strokeColor) { - if(strokeColor == null || strokeColor == "") { - strokeColor = "black"; - } - this.drawingAdapter.setStrokeColor(strokeColor); - this.drawingAdapter.drawNOrShape(this.component.get_xPosition(),this.component.get_yPosition(),this.component.get_width(),this.component.get_height(),this.component.get_orientation()); - var i = this.component.get_inportIterator(); - while(i.hasNext()) { - var i1 = i.next(); - var port = i1; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port.get_xPosition(),port.get_yPosition(),global_Constant.portRadius); - } - var i2 = this.component.get_outportIterator(); - while(i2.hasNext()) { - var i3 = i2.next(); - var port1 = i3; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port1.get_xPosition(),port1.get_yPosition(),global_Constant.portRadius); - } - this.drawingAdapter.resetDrawingParam(); - } - ,__class__: view_drawComponents_DrawNOR -}; -var view_drawComponents_DrawNOT = function(component,drawingAdapter) { - this.component = component; - this.drawingAdapter = drawingAdapter; -}; -$hxClasses["view.drawComponents.DrawNOT"] = view_drawComponents_DrawNOT; -view_drawComponents_DrawNOT.__name__ = "view.drawComponents.DrawNOT"; -view_drawComponents_DrawNOT.__interfaces__ = [view_drawComponents_DrawComponent]; -view_drawComponents_DrawNOT.prototype = { - drawingAdapter: null - ,component: null - ,drawCorrespondingComponent: function(strokeColor) { - if(strokeColor == null || strokeColor == "") { - strokeColor = "black"; - } - this.drawingAdapter.setStrokeColor(strokeColor); - this.drawingAdapter.drawNotShape(this.component.get_xPosition(),this.component.get_yPosition(),this.component.get_width(),this.component.get_height(),this.component.get_orientation()); - var i = this.component.get_inportIterator(); - while(i.hasNext()) { - var i1 = i.next(); - var port = i1; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port.get_xPosition(),port.get_yPosition(),global_Constant.portRadius); - } - var i2 = this.component.get_outportIterator(); - while(i2.hasNext()) { - var i3 = i2.next(); - var port1 = i3; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port1.get_xPosition(),port1.get_yPosition(),global_Constant.portRadius); - } - this.drawingAdapter.resetDrawingParam(); - } - ,__class__: view_drawComponents_DrawNOT -}; -var view_drawComponents_DrawOR = function(component,drawingAdapter) { - this.component = component; - this.drawingAdapter = drawingAdapter; -}; -$hxClasses["view.drawComponents.DrawOR"] = view_drawComponents_DrawOR; -view_drawComponents_DrawOR.__name__ = "view.drawComponents.DrawOR"; -view_drawComponents_DrawOR.__interfaces__ = [view_drawComponents_DrawComponent]; -view_drawComponents_DrawOR.prototype = { - drawingAdapter: null - ,component: null - ,drawCorrespondingComponent: function(strokeColor) { - if(strokeColor == null || strokeColor == "") { - strokeColor = "black"; - } - this.drawingAdapter.setStrokeColor(strokeColor); - this.drawingAdapter.drawOrShape(this.component.get_xPosition(),this.component.get_yPosition(),this.component.get_width(),this.component.get_height(),this.component.get_orientation()); - var i = this.component.get_inportIterator(); - while(i.hasNext()) { - var i1 = i.next(); - var port = i1; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port.get_xPosition(),port.get_yPosition(),global_Constant.portRadius); - } - var i2 = this.component.get_outportIterator(); - while(i2.hasNext()) { - var i3 = i2.next(); - var port1 = i3; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port1.get_xPosition(),port1.get_yPosition(),global_Constant.portRadius); - } - this.drawingAdapter.resetDrawingParam(); - } - ,__class__: view_drawComponents_DrawOR -}; -var view_drawComponents_DrawXOR = function(component,drawingAdapter) { - this.component = component; - this.drawingAdapter = drawingAdapter; -}; -$hxClasses["view.drawComponents.DrawXOR"] = view_drawComponents_DrawXOR; -view_drawComponents_DrawXOR.__name__ = "view.drawComponents.DrawXOR"; -view_drawComponents_DrawXOR.__interfaces__ = [view_drawComponents_DrawComponent]; -view_drawComponents_DrawXOR.prototype = { - drawingAdapter: null - ,component: null - ,drawCorrespondingComponent: function(strokeColor) { - if(strokeColor == null || strokeColor == "") { - strokeColor = "black"; - } - this.drawingAdapter.setStrokeColor(strokeColor); - this.drawingAdapter.drawXorShape(this.component.get_xPosition(),this.component.get_yPosition(),this.component.get_width(),this.component.get_height(),this.component.get_orientation()); - var i = this.component.get_inportIterator(); - while(i.hasNext()) { - var i1 = i.next(); - var port = i1; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port.get_xPosition(),port.get_yPosition(),global_Constant.portRadius); - } - var i2 = this.component.get_outportIterator(); - while(i2.hasNext()) { - var i3 = i2.next(); - var port1 = i3; - this.drawingAdapter.setFillColor("black"); - this.drawingAdapter.drawCricle(port1.get_xPosition(),port1.get_yPosition(),global_Constant.portRadius); - } - this.drawingAdapter.resetDrawingParam(); - } - ,__class__: view_drawComponents_DrawXOR -}; -var view_viewUpdaters_AbstractUpdate = function() { }; -$hxClasses["view.viewUpdaters.AbstractUpdate"] = view_viewUpdaters_AbstractUpdate; -view_viewUpdaters_AbstractUpdate.__name__ = "view.viewUpdaters.AbstractUpdate"; -view_viewUpdaters_AbstractUpdate.__interfaces__ = [controller_viewUpdateInterfaces_ViewUpdate]; -view_viewUpdaters_AbstractUpdate.prototype = { - viewToUpdate: null - ,setViewToUpdate: function(view1) { - this.viewToUpdate = view1; - } - ,updateView: function(string) { - } - ,updateCanvas: function() { - } - ,__class__: view_viewUpdaters_AbstractUpdate -}; -var view_viewUpdaters_CanvasUpdate = function(view1) { - view_viewUpdaters_AbstractUpdate.prototype.setViewToUpdate.call(this,view1); -}; -$hxClasses["view.viewUpdaters.CanvasUpdate"] = view_viewUpdaters_CanvasUpdate; -view_viewUpdaters_CanvasUpdate.__name__ = "view.viewUpdaters.CanvasUpdate"; -view_viewUpdaters_CanvasUpdate.__super__ = view_viewUpdaters_AbstractUpdate; -view_viewUpdaters_CanvasUpdate.prototype = $extend(view_viewUpdaters_AbstractUpdate.prototype,{ - updateView: function(string) { - this.viewToUpdate.updateThisBox(string); - } - ,updateCanvas: function() { - console.log("view.viewUpdaters.updateCanvas"); - this.viewToUpdate.updateCanvas(); - } - ,__class__: view_viewUpdaters_CanvasUpdate -}); -var view_viewUpdaters_SidebarUpdate = function(view1) { - view_viewUpdaters_AbstractUpdate.prototype.setViewToUpdate.call(this,view1); - this.populateSidebar(); -}; -$hxClasses["view.viewUpdaters.SidebarUpdate"] = view_viewUpdaters_SidebarUpdate; -view_viewUpdaters_SidebarUpdate.__name__ = "view.viewUpdaters.SidebarUpdate"; -view_viewUpdaters_SidebarUpdate.__super__ = view_viewUpdaters_AbstractUpdate; -view_viewUpdaters_SidebarUpdate.prototype = $extend(view_viewUpdaters_AbstractUpdate.prototype,{ - createSidebarItemElement: function(drawComponentString,component) { - var height = 50; - var width = 50; - var sidebarItem = window.document.createElement("div"); - sidebarItem.id = "sidebarItem_" + Std.string(drawComponentString); - sidebarItem.style.height = height + "px"; - sidebarItem.style.width = "100%"; - sidebarItem.style.border = "solid 1px black"; - sidebarItem.draggable = true; - sidebarItem.addEventListener("drag",function(event) { - }); - sidebarItem.addEventListener("dragstart",function(event1) { - var draggedItemEvent = { eventType : "sidebarDrag", from : "sidebar", to : "canvas", component : Std.string(drawComponentString)}; - var stringEvent = JSON.stringify(draggedItemEvent); - event1.dataTransfer.setData("text/plain",stringEvent); - event1.dataTransfer.dropEffect = "move"; - }); - var sidebarItemCanvas = window.document.createElement("canvas"); - sidebarItem.appendChild(sidebarItemCanvas); - sidebarItemCanvas.style.width = "100%"; - sidebarItemCanvas.style.height = "100%"; - var drawingAdapter = new model_drawingInterface_DrawingAdapter(model_drawingInterface_Transform.identity(),sidebarItemCanvas.getContext("2d",null)); - switch(drawComponentString._hx_index) { - case 0: - drawingAdapter.drawAndShape(80,75,70,70,model_enumeration_ORIENTATION.EAST); - break; - case 1: - drawingAdapter.drawNAndShape(80,75,70,70,model_enumeration_ORIENTATION.EAST); - break; - case 2: - drawingAdapter.drawOrShape(80,75,70,70,model_enumeration_ORIENTATION.EAST); - break; - case 3: - drawingAdapter.drawNOrShape(80,75,70,70,model_enumeration_ORIENTATION.EAST); - break; - case 4: - drawingAdapter.drawXorShape(80,75,70,70,model_enumeration_ORIENTATION.EAST); - break; - case 5: - drawingAdapter.drawNotShape(80,75,70,70,model_enumeration_ORIENTATION.EAST); - break; - case 6: - console.log("CC"); - break; - } - return sidebarItem; - } - ,populateSidebar: function() { - var defaultSidebarItems = [model_enumeration_ComponentType.AND,model_enumeration_ComponentType.NAND,model_enumeration_ComponentType.OR,model_enumeration_ComponentType.NOR,model_enumeration_ComponentType.XOR,model_enumeration_ComponentType.NOT]; - var sidebarTable = window.document.querySelector("#sidebarTable"); - var tableBody = sidebarTable.childNodes[1]; - var _g = 0; - while(_g < defaultSidebarItems.length) { - var defaultItem = defaultSidebarItems[_g]; - ++_g; - var tr = window.document.createElement("tr"); - var td = tr.insertCell(0); - td.appendChild(this.createSidebarItemElement(defaultItem)); - tableBody.appendChild(tr); - } - this.viewToUpdate.updateSidebarOptions(); - } - ,updateView: function(string) { - this.viewToUpdate.updateThisBox(string); - } - ,__class__: view_viewUpdaters_SidebarUpdate -}); -function $getIterator(o) { if( o instanceof Array ) return HxOverrides.iter(o); else return o.iterator(); } -function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $global.$haxeUID++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = m.bind(o); o.hx__closures__[m.__id__] = f; } return f; } -$global.$haxeUID |= 0; -$hxClasses["Math"] = Math; -if( String.fromCodePoint == null ) String.fromCodePoint = function(c) { return c < 0x10000 ? String.fromCharCode(c) : String.fromCharCode((c>>10)+0xD7C0)+String.fromCharCode((c&0x3FF)+0xDC00); } -String.prototype.__class__ = $hxClasses["String"] = String; -String.__name__ = "String"; -$hxClasses["Array"] = Array; -Array.__name__ = "Array"; -Date.prototype.__class__ = $hxClasses["Date"] = Date; -Date.__name__ = "Date"; -var Int = { }; -var Dynamic = { }; -var Float = Number; -var Bool = Boolean; -var Class = { }; -var Enum = { }; -haxe_ds_ObjectMap.count = 0; -var __map_reserved = {}; -Object.defineProperty(js__$Boot_HaxeError.prototype,"message",{ get : function() { - return String(this.val); -}}); -js_Boot.__toStr = ({ }).toString; -if(ArrayBuffer.prototype.slice == null) { - ArrayBuffer.prototype.slice = js_lib__$ArrayBuffer_ArrayBufferCompat.sliceImpl; -} -EReg.escapeRe = new RegExp("[.*+?^${}()|[\\]\\\\]","g"); -haxe_SysTools.winMetaCharacters = [32,40,41,37,33,94,34,60,62,38,124,10,13,44,59]; -StringTools.winMetaCharacters = haxe_SysTools.winMetaCharacters; -StringTools.MIN_SURROGATE_CODE_POINT = 65536; -global_Constant.portRadius = 3; -global_Constant.pointToLineDistance = 5; -global_Constant.pointToEndpointDistance = 6; -global_Constant.PIXELRATIO = 1; -global_Constant.TRANSFORM_X_DELTA = 40; -global_Constant.TRANSFORM_Y_DELTA = 40; -global_Constant.TRANSFORM_ZOOM_IN_RATE = 1.5; -global_Constant.TRANSFORM_ZOOM_OUT_RATE = 0.5; -Main.main(); -})(typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this); diff --git a/client/build.hxml b/client/build.hxml index d79e4f1..673bf2a 100644 --- a/client/build.hxml +++ b/client/build.hxml @@ -1,4 +1,4 @@ -cp src -main Main --js bin/example.js +-js bin/similitudeClient.js -D dce=no \ No newline at end of file diff --git a/client/bin/index.html b/client/index.html similarity index 96% rename from client/bin/index.html rename to client/index.html index a12cde4..8a57e59 100644 --- a/client/bin/index.html +++ b/client/index.html @@ -86,6 +86,6 @@ - + \ No newline at end of file diff --git a/client/src/model/component/CircuitDiagram.hx b/client/src/model/component/CircuitDiagram.hx index c2b46cb..7f62253 100644 --- a/client/src/model/component/CircuitDiagram.hx +++ b/client/src/model/component/CircuitDiagram.hx @@ -8,7 +8,7 @@ import type.HitObject; import model.enumeration.POINT_MODE; import model.enumeration.MODE; import model.drawingInterface.DrawingAdapterI; -import type.LinkAndComponentAndEndpointAndPortArray; +import model.selectionModel.SelectionModel ; import model.enumeration.ORIENTATION; import type.Coordinate; import type.WorldPoint; @@ -265,47 +265,18 @@ class CircuitDiagram extends Observer implements CircuitDiagramI{ * for all components, if want to draw it, must convert world coordinate to view coordinate first. * because draw() method only has the responsiblity to draw component itself. **/ - public function draw(drawingAdapter:DrawingAdapterI,?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray):Void{ - var drawFlag:Bool = false; + public function draw( drawingAdapter:DrawingAdapterI, + selection :SelectionModel) + : Void{ //update component array for(i in componentArray){ - if(linkAndComponentArray != null && linkAndComponentArray.getComponentIteratorLength() != 0){ - for(j in linkAndComponentArray.get_componentIterator()){ - if(j == i){ - i.drawComponent(drawingAdapter, true); - drawFlag = true; - } - } - } - - if(!drawFlag){ - if(i.getNameOfTheComponentKind() != "CC"){ - i.drawComponent(drawingAdapter, false); - }else{ - i.drawComponent(drawingAdapter, false, linkAndComponentArray); - } - } - - drawFlag = false; + var highlight = selection.containsComponent( i ) ; + i.drawComponent(drawingAdapter, highlight, selection); } - drawFlag = false; - //update link array for(i in linkArray){ - if(linkAndComponentArray != null && linkAndComponentArray.getLinkIteratorLength() != 0){ - for(j in linkAndComponentArray.get_linkIterator()){ - if(j == i){ - i.drawLink(drawingAdapter, true); - drawFlag = true; - } - } - } - - if(!drawFlag){ - i.drawLink(drawingAdapter, false); - } - - drawFlag = false; + var highlight = selection.containsLink( i ) ; + i.drawLink(drawingAdapter, highlight); } } diff --git a/client/src/model/component/CircuitDiagramI.hx b/client/src/model/component/CircuitDiagramI.hx index 118956f..dd055a0 100644 --- a/client/src/model/component/CircuitDiagramI.hx +++ b/client/src/model/component/CircuitDiagramI.hx @@ -3,10 +3,10 @@ package model.component; import haxe.ds.GenericStack; import type.HitObject; import model.enumeration.POINT_MODE; -import type.LinkAndComponentAndEndpointAndPortArray; import type.Coordinate; import type.WorldPoint; import model.enumeration.MODE; +import model.selectionModel.SelectionModel ; import model.drawingInterface.DrawingAdapterI; import model.enumeration.ORIENTATION; /** @@ -130,7 +130,8 @@ interface CircuitDiagramI { /** * draw the circuit diagram itself **/ - public function draw(drawingAdapter:DrawingAdapterI, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray):Void; + public function draw( drawingAdapter:DrawingAdapterI, + selected: SelectionModel ):Void; /** * find the hit list diff --git a/client/src/model/component/Component.hx b/client/src/model/component/Component.hx index 2e44fb4..d135be8 100644 --- a/client/src/model/component/Component.hx +++ b/client/src/model/component/Component.hx @@ -1,5 +1,6 @@ package model.component; +import model.selectionModel.SelectionModel; import model.attribute.Pair; import model.observe.Observable; //import js.html.CanvasRenderingContext2D; @@ -32,17 +33,23 @@ import model.attribute.OrientationValue; * @author wanhui * */ -class Component extends Observable{ +class Component extends Observable { + // TODO: Should xPosition, yPosition, height, width be attributes? var xPosition:Float;//the x position of the component var yPosition:Float;//the y position of the component var height:Float;//height var width:Float;//width - //var orientation:ORIENTATION;//the orientation of the component + // TODO: make sequenceNumber an attribute. + var sequenceNumber : Int ; // This should be -1 unless the component is an + // input or an output. In that case, it represents + // the component's position relative to other inputs + // and outputs. var componentKind:ComponentKind;//the actual gate in this component var inportArray:Array = new Array();//the inports for the component var outportArray:Array = new Array();//the outports for the component + // TODO Make inportsNum an attribute for the kinds where it makes sense. var inportsNum:Int;//init - //var nameOfTheComponentKind:String;//the actually name of this componentkind, like "AND", "OR" if the component is a compound component, this value would be "CC" + // TODO Make boxType an attribute for the kinds where it makes sense. var boxType:BOX; var list:Map=new Map(); var cd:CircuitDiagram; @@ -62,8 +69,8 @@ class Component extends Observable{ this.yPosition = yPosition; this.height = height; this.width = width; + this.sequenceNumber = -1 ; this.componentKind = componentKind; - this.componentKind.set_component(this); this.inportsNum = inportNum; this.boxType = BOX.WHITE_BOX; @@ -165,10 +172,6 @@ class Component extends Observable{ return componentKind; } - public function set_componentKind(value:ComponentKind) { - return this.componentKind = value; - } - public function get_boxType():BOX { return boxType; } @@ -235,82 +238,27 @@ class Component extends Observable{ return this; } - public function drawComponent(drawingAdpater:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray ){ - if(componentKind.checkInnerCircuitDiagramPortsChange()){ - - for(i in componentKind.getInnerCircuitDiagram().get_componentIterator()){ - var inputFlag:Bool = false; - var outputFlag:Bool = false; - for(j in inportArray){ - if(i.getNameOfTheComponentKind() == "Input"){ - if(i.get_componentKind().get_sequence() == j.get_sequence()){ - inputFlag = true; - } - } - } - - for(j in outportArray){ - if(i.getNameOfTheComponentKind() == "Output"){ - if(i.get_componentKind().get_sequence() == j.get_sequence()){ - outputFlag = true; - } - } - } - - if(!inputFlag && !outputFlag){ - if(i.getNameOfTheComponentKind() == "Input"){ - var port:Port = componentKind.addInPort(); - port.set_sequence(i.get_componentKind().get_sequence()); - inportArray.push(port); - }else{ - var port:Port = componentKind.addOutPort(); - port.set_sequence(i.get_componentKind().get_sequence()); - outportArray.push(port); - } - } - } + public function drawComponent(drawingAdpater:DrawingAdapterI, highLight:Bool, selection : SelectionModel ) { + componentKind.drawComponent(this, drawingAdpater, highLight, selection ); + } - for(i in inportArray){ - var flag_delete:Bool = true; - for(j in componentKind.getInnerCircuitDiagram().get_componentIterator()){ - if(i.get_sequence() == j.get_componentKind().get_sequence() && j.getNameOfTheComponentKind() == "Input"){ - flag_delete = false; - } - } - - if(flag_delete){ - inportArray.remove(i); - } - } + public function findHitList(coordinate:Coordinate, mode:MODE):Array{ + return componentKind.findHitList(this, coordinate, mode); + } - for(i in outportArray){ - var flag_delete:Bool = true; - for(j in componentKind.getInnerCircuitDiagram().get_componentIterator()){ - if(i.get_sequence() == j.get_componentKind().get_sequence() && j.getNameOfTheComponentKind() == "Output"){ - flag_delete = false; - } - } - - if(flag_delete){ - outportArray.remove(i); - } - } + public function findWorldPoint(coordinate:Coordinate, mode:POINT_MODE):Array{ + return componentKind.findWorldPoint(this, coordinate, mode); + } - componentKind.updateInPortPosition(inportArray, xPosition, yPosition, height, width, list.get("orientation").getAttrValue().getvalue()); - componentKind.updateOutPortPosition(outportArray, xPosition, yPosition, height, width, list.get("orientation").getAttrValue().getvalue()); - } - if(this.componentKind.getname()!= "CC"){ - componentKind.drawComponent(drawingAdpater, highLight); - }else{ - componentKind.drawComponent(drawingAdpater, highLight, linkAndComponentArray); - } + public function getInnerCircuitDiagram() { + return this.componentKind.getInnerCircuitDiagram() ; } - public function findHitList(coordinate:Coordinate, mode:MODE):Array{ - return componentKind.findHitList(coordinate, mode); + public function set_sequence(n:Int) : Void { + this.sequenceNumber = n ; } - public function findWorldPoint(coordinate:Coordinate, mode:POINT_MODE):Array{ - return componentKind.findWorldPoint(coordinate, mode); + public function get_sequence() : Int { + return this.sequenceNumber ; } } diff --git a/client/src/model/component/Inport.hx b/client/src/model/component/Inport.hx index 6ae0c6e..b994a73 100644 --- a/client/src/model/component/Inport.hx +++ b/client/src/model/component/Inport.hx @@ -1,13 +1,11 @@ package model.component; import model.enumeration.IOTYPE; -import model.enumeration.VALUE_LOGIC; class Inport implements Port { var xPosition:Float; var yPosition:Float; var portDescription:IOTYPE; - var value:VALUE_LOGIC; var sequence:Int = -1; public function get_xPosition():Float { @@ -26,14 +24,6 @@ class Inport implements Port { this.yPosition = yPosition; } - public function get_value():VALUE_LOGIC { - return value; - } - - public function set_value(value:VALUE_LOGIC):Void { - this.value = value; - } - public function get_portDescription():IOTYPE { return this.portDescription; } @@ -60,7 +50,6 @@ class Inport implements Port { var jsonString:String = "{ \"xPosition\": \"" + this.xPosition + "\","; jsonString += "\"yPosition\": \"" + this.yPosition + "\","; jsonString += "\"portDescription\": \"" + this.portDescription + "\","; - jsonString += "\"value\": \"" + this.value + "\","; jsonString += "\"sequence\": \"" + this.sequence + "\""; jsonString += "}"; return jsonString; diff --git a/client/src/model/component/Outport.hx b/client/src/model/component/Outport.hx index 2c815e5..d40f7ec 100644 --- a/client/src/model/component/Outport.hx +++ b/client/src/model/component/Outport.hx @@ -1,13 +1,11 @@ package model.component; import model.enumeration.IOTYPE; -import model.enumeration.VALUE_LOGIC; class Outport implements Port { var xPosition:Float; var yPosition:Float; var portDescription:IOTYPE; - var value:VALUE_LOGIC; var sequence:Int; public function get_xPosition():Float { @@ -26,14 +24,6 @@ class Outport implements Port { this.yPosition = yPosition; } - public function get_value():VALUE_LOGIC { - return value; - } - - public function set_value(value:VALUE_LOGIC):Void { - this.value = value; - } - public function get_portDescription():IOTYPE { return portDescription; } @@ -60,7 +50,6 @@ class Outport implements Port { var jsonString:String = "{ \"xPosition\": \"" + this.xPosition + "\","; jsonString += "\"yPosition\": \"" + this.yPosition + "\","; jsonString += "\"portDescription\": \"" + this.portDescription + "\","; - jsonString += "\"value\": \"" + this.value + "\","; jsonString += "\"sequence\": \"" + this.sequence + "\""; jsonString += "}"; return jsonString; diff --git a/client/src/model/component/Port.hx b/client/src/model/component/Port.hx index 63eeba6..5983c03 100644 --- a/client/src/model/component/Port.hx +++ b/client/src/model/component/Port.hx @@ -2,7 +2,6 @@ package model.component; import model.enumeration.IOTYPE; -import model.enumeration.VALUE_LOGIC; /** * Every gate should have port to access the logic value * @author wanhui @@ -29,16 +28,6 @@ interface Port { **/ public function set_yPosition(yPosition:Float):Void; - /** get the logic value of this port - * - **/ - public function get_value():VALUE_LOGIC; - - /** set the logic value - * - **/ - public function set_value(value:VALUE_LOGIC):Void; - /** get the port description, Inport or outport * **/ diff --git a/client/src/model/enumeration/VALUE_LOGIC.hx b/client/src/model/enumeration/VALUE_LOGIC.hx deleted file mode 100644 index 109fd99..0000000 --- a/client/src/model/enumeration/VALUE_LOGIC.hx +++ /dev/null @@ -1,19 +0,0 @@ -package model.enumeration; - -/** - * value logic for gates
- * TRUE : 1
- * FALSE : 0
- * UNDEFINED : N/A
- * RISING_EDGE: USED FOR CLOCK
- * DOWN_EDGE : USED FOR CLOCK
- * @author wanhui - * - */ -enum VALUE_LOGIC { - FALSE; - TRUE; - UNDEFINED; - RISING_EDGE; - DOWN_EDGE; -} \ No newline at end of file diff --git a/client/src/model/gates/AND.hx b/client/src/model/gates/AND.hx index 0100a16..f059b25 100644 --- a/client/src/model/gates/AND.hx +++ b/client/src/model/gates/AND.hx @@ -4,10 +4,11 @@ import model.attribute.Attribute; import model.attribute.OrientationAttr; import model.attribute.StringAttr; import model.attribute.IntAttr; -import type.LinkAndComponentAndEndpointAndPortArray; import view.drawComponents.DrawAND; import view.drawComponents.DrawComponent; import model.drawingInterface.DrawingAdapterI; +import model.selectionModel.SelectionModel ; +import model.component.Component ; import model.component.Inport; import model.component.Outport; import model.component.Port; @@ -44,10 +45,6 @@ class AND implements ComponentKind extends AbstractComponentKind { return nameOfTheComponentKind; } - public function setname(s:String):Void{ - nameOfTheComponentKind=s; - } - public function createPorts(xPosition:Float, yPosition:Float, height:Float, width:Float, orientation:ORIENTATION, ?inportNum:Int):Array { var portArray:Array = new Array(); switch (orientation){ @@ -55,7 +52,8 @@ class AND implements ComponentKind extends AbstractComponentKind { var counter:Int = 0; //inport while (counter < inportNum) { - var inport:Port = new Inport(xPosition - width / 2, height / (inportNum + 1) * (counter + 1) + (yPosition - height / 2)); + var inport:Port = new Inport(xPosition - width / 2, + height / (inportNum + 1) * (counter + 1) + (yPosition - height / 2)); inport.set_portDescription(IOTYPE.INPUT); portArray.push(inport); counter++; @@ -114,7 +112,7 @@ class AND implements ComponentKind extends AbstractComponentKind { return portArray; } - public function drawComponent(drawingAdapter:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray){ + public function drawComponent(component : Component, drawingAdapter:DrawingAdapterI, highLight:Bool, selection : SelectionModel ){ var drawComponent:DrawComponent = new DrawAND(component, drawingAdapter); if(highLight){ drawComponent.drawCorrespondingComponent("red"); diff --git a/client/src/model/gates/AbstractComponentKind.hx b/client/src/model/gates/AbstractComponentKind.hx index 9e77ac2..80d939f 100644 --- a/client/src/model/gates/AbstractComponentKind.hx +++ b/client/src/model/gates/AbstractComponentKind.hx @@ -21,14 +21,11 @@ import global.Constant.*; * @author wanhui **/ class AbstractComponentKind { - // TODO: Get rid of this. - private var sequence:Int;//use for input and output - private var component:Component; + private var attributes:Array=new Array(); private function new() { - sequence = -1; attributes.push(new OrientationAttr()); attributes.push(new StringAttr("name")); } @@ -37,14 +34,6 @@ class AbstractComponentKind { return attributes; } - public function get_component():Component { - return component; - } - - public function set_component(value:Component):Void { - this.component = value; - } - public function addInPort():Port { return new Inport(); } @@ -53,14 +42,6 @@ class AbstractComponentKind { return new Outport(); } - public function get_sequence():Int { - return sequence; - } - - public function set_sequence(value:Int) { - return this.sequence = value; - } - public function updateInPortPosition(portArray:Array, xPosition:Float, yPosition:Float, height:Float, width:Float, orientation:ORIENTATION):Array { switch (orientation){ case ORIENTATION.EAST : { @@ -93,7 +74,7 @@ class AbstractComponentKind { } return portArray; } - + public function updateOutPortPosition(portArray:Array, xPosition:Float, yPosition:Float, height:Float, width:Float, orientation:ORIENTATION):Array{ switch(orientation){ case ORIENTATION.EAST : { @@ -126,18 +107,19 @@ class AbstractComponentKind { } return portArray; } - - public function findHitList(coordinate:Coordinate, mode:MODE):Array{ + + public function findHitList(component : Component, coordinate:Coordinate, mode:MODE) + :Array { var hitObjectArray:Array = new Array(); - var component:Component = isInComponent(coordinate); + var component:Component = isInComponent(component, coordinate); if(component != null){ var hitObject:HitObject = new HitObject(); hitObject.set_component(component); hitObjectArray.push(hitObject); } - var port:Port = isOnPort(coordinate); + var port:Port = isOnPort(component, coordinate); if(port != null){ var hitObject:HitObject = new HitObject(); hitObject.set_port(port); @@ -153,8 +135,8 @@ class AbstractComponentKind { * @return if the coordinate in a component then return the component * or return null; **/ - function isInComponent(coordinate:Coordinate):Component{ - if(isInScope(component.get_xPosition(), component.get_yPosition(), coordinate.get_xPosition(), coordinate.get_yPosition(), component.get_height(), component.get_width()) == true){ + function isInComponent(component : Component, coordinate:Coordinate):Component { + if(isInScope(component.get_xPosition(), component.get_yPosition(), coordinate.get_xPosition(), coordinate.get_yPosition(), component.get_height(), component.get_width())){ return component; } return null; @@ -184,7 +166,7 @@ class AbstractComponentKind { * @return if the coordinate on the port then return the port * or return null; **/ - function isOnPort(cooridnate:Coordinate):Port{ + function isOnPort(component : Component, cooridnate:Coordinate):Port{ var port:Port; for(j in component.get_inportIterator()){ @@ -209,7 +191,7 @@ class AbstractComponentKind { /** - * verify a point is in a circuit or not + * verify a point is in a circle or not * @param coordinate the point need to be verified * @param orignalXPosition the circuit x position * @param orignalYPosition the circuit y position @@ -227,7 +209,7 @@ class AbstractComponentKind { /** * for all component kinds except compound component, find world point always return a empty list **/ - public function findWorldPoint(worldCoordinate:Coordinate, mode:POINT_MODE):Array{ + public function findWorldPoint(component : Component, worldCoordinate:Coordinate, mode:POINT_MODE):Array{ return new Array(); } @@ -235,11 +217,4 @@ class AbstractComponentKind { Assert.assert(false) ; return null;//for most of the componentkind it has no circuit diagram inside, except compound component } - - /** - * for all component kinds except compound component, this function always return false; False means their is no change - **/ - public function checkInnerCircuitDiagramPortsChange():Bool{ - return false; - } } diff --git a/client/src/model/gates/ComponentKind.hx b/client/src/model/gates/ComponentKind.hx index 23e2281..fe325e0 100644 --- a/client/src/model/gates/ComponentKind.hx +++ b/client/src/model/gates/ComponentKind.hx @@ -1,7 +1,6 @@ package model.gates; import model.attribute.Attribute; -import type.LinkAndComponentAndEndpointAndPortArray; import type.HitObject; import model.component.CircuitDiagramI; import model.enumeration.POINT_MODE; @@ -10,6 +9,7 @@ import type.Coordinate; import type.WorldPoint; import model.drawingInterface.DrawingAdapterI; import model.component.Component; +import model.selectionModel.SelectionModel ; import model.component.Port; import model.enumeration.ORIENTATION; /** @@ -35,8 +35,6 @@ interface ComponentKind { **/ public function createPorts(xPosition:Float, yPosition:Float, height:Float, width:Float, orientation:ORIENTATION, ?inportNum:Int):Array; - public function checkInnerCircuitDiagramPortsChange():Bool; - /** * add an inport * @return the created ports @@ -74,47 +72,21 @@ interface ComponentKind { * @param component * @param drawingAdapter **/ - public function drawComponent(drawingAdapter:DrawingAdapterI, hightLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray):Void; - - /** - * get component sequence - * TODO Get rid of this. - **/ - public function get_sequence():Int; - - /** - * set component sequence - * TODO Get rid of this. - **/ - public function set_sequence(value:Int):Int; - - /** - * get the component which belongs to this kind. - * TODO Get rid of this. - **/ - public function get_component():Component; - - /** - * set the componentKind belongs to which component - * TODO Get rid of this. - **/ - public function set_component(value:Component):Void; + public function drawComponent(component : Component, drawingAdapter:DrawingAdapterI, hightLight:Bool, selection : SelectionModel ):Void; /** * find the hit list **/ - public function findHitList(coordinate:Coordinate, mode:MODE):Array; + public function findHitList(component : Component, coordinate:Coordinate, mode:MODE):Array; /** * find world point **/ - public function findWorldPoint(worldCoordinate:Coordinate, mode:POINT_MODE):Array; + public function findWorldPoint(component : Component, worldCoordinate:Coordinate, mode:POINT_MODE):Array; /** * this function just use for compound component * TODO Get rid of this. **/ public function getInnerCircuitDiagram():CircuitDiagramI; - - public function setname(s:String):Void; } diff --git a/client/src/model/gates/CompoundComponent.hx b/client/src/model/gates/CompoundComponent.hx index ea2c367..3ae7f14 100644 --- a/client/src/model/gates/CompoundComponent.hx +++ b/client/src/model/gates/CompoundComponent.hx @@ -1,5 +1,6 @@ package model.gates; +import model.selectionModel.SelectionModel; import assertions.Assert ; import model.observe.Observable; import model.attribute.OrientationAttr; @@ -13,6 +14,7 @@ import type.WorldPoint; import view.drawComponents.DrawComponent; import view.drawComponents.DrawCompoundComponent; import model.component.CircuitDiagramI; +import model.component.Component ; import model.enumeration.POINT_MODE; import model.enumeration.BOX; import model.enumeration.MODE; @@ -33,10 +35,6 @@ class CompoundComponent implements ComponentKind extends AbstractComponentKind{ var circuitDiagram:CircuitDiagramI; var nameOfTheComponentKind:String="CC"; - public function setname(s:String):Void{ - nameOfTheComponentKind=s; - } - public function getname():String{ return nameOfTheComponentKind; } @@ -51,26 +49,6 @@ class CompoundComponent implements ComponentKind extends AbstractComponentKind{ return circuitDiagram; } - override public function checkInnerCircuitDiagramPortsChange():Bool{ - var inputNumberTemp:Int = 0; - var outputNumberTemp:Int = 0; - - for(i in circuitDiagram.get_componentIterator()){ - if(i.getNameOfTheComponentKind() == "Input"){ - inputNumberTemp++; - } - if(i.getNameOfTheComponentKind() == "Output"){ - outputNumberTemp++; - } - } - - if(inputNumberTemp == component.get_inportIteratorLength() && outputNumberTemp == component.get_outportIteratorLength()){ - return false; - }else{ - return true; - } - } - public function createPorts(xPosition:Float, yPosition:Float, height:Float, width:Float, orientation:ORIENTATION, ?inportNum:Int):Array { var inportCount = 0 ; var outportCount = 0 ; @@ -89,16 +67,16 @@ class CompoundComponent implements ComponentKind extends AbstractComponentKind{ if(i.getNameOfTheComponentKind() == "Input"){ //inport var inport_1:Port = new Inport(xPosition - width / 2, - height / (inportCount+1) * (i.get_componentKind().get_sequence()+1) + height / (inportCount+1) * (i.get_sequence()+1) + (yPosition - height / 2)); - inport_1.set_sequence(i.get_componentKind().get_sequence()); + inport_1.set_sequence(i.get_sequence()); portArray.push(inport_1); }else if(i.getNameOfTheComponentKind() == "Output"){ //outport var outport_:Port = new Outport(xPosition + width / 2, - height / (outportCount+1) * (i.get_componentKind().get_sequence()+1) + height / (outportCount+1) * (i.get_sequence()+1) + (yPosition - height / 2)); - outport_.set_sequence(i.get_componentKind().get_sequence()); + outport_.set_sequence(i.get_sequence()); portArray.push(outport_); } } @@ -107,13 +85,15 @@ class CompoundComponent implements ComponentKind extends AbstractComponentKind{ for(i in circuitDiagram.get_componentIterator()){ if(i.getNameOfTheComponentKind() == "Input"){ //inport - var inport_1:Port = new Inport(xPosition - width / 2 + width/ (inportCount+1) * (i.get_componentKind().get_sequence()+1), height + height/2); - inport_1.set_sequence(i.get_componentKind().get_sequence()); + var inport_1:Port = new Inport(xPosition - width / 2 + width/ (inportCount+1) * (i.get_sequence()+1), + height + height/2); + inport_1.set_sequence(i.get_sequence()); portArray.push(inport_1); }else if(i.getNameOfTheComponentKind() == "Output"){ //outport - var outport_:Port = new Outport(xPosition - width / 2 + width/ (outportCount+1) * (i.get_componentKind().get_sequence()+1), height - height/2); - outport_.set_sequence(i.get_componentKind().get_sequence()); + var outport_:Port = new Outport(xPosition - width / 2 + width/ (outportCount+1) * (i.get_sequence()+1), + height - height/2); + outport_.set_sequence(i.get_sequence()); portArray.push(outport_); } } @@ -122,13 +102,15 @@ class CompoundComponent implements ComponentKind extends AbstractComponentKind{ for(i in circuitDiagram.get_componentIterator()){ if(i.getNameOfTheComponentKind() == "Input"){ //inport - var inport_1:Port = new Inport(xPosition - width / 2 + width/ (inportCount+1) * (i.get_componentKind().get_sequence()+1), height - height/2); - inport_1.set_sequence(i.get_componentKind().get_sequence()); + var inport_1:Port = new Inport(xPosition - width / 2 + width/ (inportCount+1) * (i.get_sequence()+1), + height - height/2); + inport_1.set_sequence(i.get_sequence()); portArray.push(inport_1); }else if(i.getNameOfTheComponentKind() == "Output"){ //outport - var outport_:Port = new Outport(xPosition - width / 2 + width/ (outportCount+1) * (i.get_componentKind().get_sequence()+1), height + height/2); - outport_.set_sequence(i.get_componentKind().get_sequence()); + var outport_:Port = new Outport( xPosition - width / 2 + width/ (outportCount+1) * (i.get_sequence()+1), + height + height/2); + outport_.set_sequence(i.get_sequence()); portArray.push(outport_); } } @@ -137,13 +119,15 @@ class CompoundComponent implements ComponentKind extends AbstractComponentKind{ for(i in circuitDiagram.get_componentIterator()){ if(i.getNameOfTheComponentKind() == "Input"){ //inport - var inport_1:Port = new Inport(xPosition + width / 2, height / (inportCount+1) * (i.get_componentKind().get_sequence()+1) + (yPosition - height / 2)); - inport_1.set_sequence(i.get_componentKind().get_sequence()); + var inport_1:Port = new Inport( xPosition + width / 2, + height / (inportCount+1) * (i.get_sequence()+1) + (yPosition - height / 2)); + inport_1.set_sequence(i.get_sequence()); portArray.push(inport_1); }else if(i.getNameOfTheComponentKind() == "Output"){ //outport - var outport_:Port = new Outport(xPosition - width / 2, height / (outportCount+1) * (i.get_componentKind().get_sequence()+1) + (yPosition - height / 2)); - outport_.set_sequence(i.get_componentKind().get_sequence()); + var outport_:Port = new Outport( xPosition - width / 2, + height / (outportCount+1) * (i.get_sequence()+1) + (yPosition - height / 2)); + outport_.set_sequence(i.get_sequence()); portArray.push(outport_); } } @@ -155,8 +139,8 @@ class CompoundComponent implements ComponentKind extends AbstractComponentKind{ return portArray; } - public function drawComponent(drawingAdapter:DrawingAdapterI, hightLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray):Void { - var drawingAdapterTrans:DrawingAdapterI = drawingAdapter.transform(makeTransform()); + public function drawComponent(component : Component, drawingAdapter:DrawingAdapterI, hightLight:Bool, selection : SelectionModel ):Void { + var drawingAdapterTrans:DrawingAdapterI = drawingAdapter.transform(makeTransform(component)); var drawComponent:DrawComponent = new DrawCompoundComponent(component, drawingAdapter, drawingAdapterTrans); if(hightLight){ drawComponent.drawCorrespondingComponent("red"); @@ -165,14 +149,11 @@ class CompoundComponent implements ComponentKind extends AbstractComponentKind{ } if(component.get_boxType() == BOX.WHITE_BOX){ - //compound component need to draw all the components in ComponentArray, which should make a IntAttr transfrom - //drawingAdapterTrans = drawingAdapter.transform(makeTransform()); - circuitDiagram.draw(drawingAdapterTrans, linkAndComponentArray); + circuitDiagram.draw(drawingAdapterTrans, selection); } - //context.restore(); } - function makeTransform():Transform{ + function makeTransform(component : Component ):Transform{ var transform:Transform = Transform.identity(); transform = transform.translate(-circuitDiagram.getComponentAndLinkCenterCoordinate().get_xPosition(), -circuitDiagram.getComponentAndLinkCenterCoordinate().get_yPosition()) .scale(component.get_width()/circuitDiagram.get_diagramWidth(), component.get_height()/circuitDiagram.get_diagramHeight()) @@ -181,14 +162,14 @@ class CompoundComponent implements ComponentKind extends AbstractComponentKind{ return transform; } - override public function findHitList(outerWorldCoordinates:Coordinate, mode:MODE):Array{ + override public function findHitList(component : Component, outerWorldCoordinates:Coordinate, mode:MODE):Array{ var hitObjectArray:Array = new Array(); - var hitComponent:Component = isInComponent(outerWorldCoordinates); + var hitComponent:Component = isInComponent(component, outerWorldCoordinates); if(hitComponent == null){ return hitObjectArray; }else if(component.get_boxType() == BOX.WHITE_BOX){ - var transform:Transform = makeTransform(); + var transform:Transform = makeTransform(component); var innerWorldCoordinates:Coordinate = transform.pointInvert(outerWorldCoordinates); var result:Array = circuitDiagram.findHitList(innerWorldCoordinates, mode); @@ -206,13 +187,17 @@ class CompoundComponent implements ComponentKind extends AbstractComponentKind{ } } - override public function findWorldPoint(worldCoordinate:Coordinate, mode:POINT_MODE):Array{ - var worldPointArray:Array = new Array(); + override public function findWorldPoint(component : Component, + worldCoordinate:Coordinate, + mode:POINT_MODE) + : Array + { + var worldPointArray:Array = new Array() ; - if(isInComponent(worldCoordinate) == null){ + if(isInComponent(component, worldCoordinate) == null){ return worldPointArray; }else if(component.get_boxType() == BOX.WHITE_BOX){ - var transform:Transform = makeTransform(); + var transform:Transform = makeTransform(component); var wForDiagram:Coordinate = transform.pointInvert(worldCoordinate); return circuitDiagram.findWorldPoint(wForDiagram, mode); }else{ diff --git a/client/src/model/gates/FlipFlop.hx b/client/src/model/gates/FlipFlop.hx index 9967994..9b3db1f 100644 --- a/client/src/model/gates/FlipFlop.hx +++ b/client/src/model/gates/FlipFlop.hx @@ -5,10 +5,10 @@ import model.attribute.OrientationAttr; import model.attribute.StringAttr; import model.attribute.IntAttr; import model.attribute.Attribute; -import type.LinkAndComponentAndEndpointAndPortArray; import view.drawComponents.DrawComponent; import model.drawingInterface.DrawingAdapterI; import view.drawComponents.DrawFlipFlop; +import model.component.Component ; import model.component.Inport; import model.component.Outport; import model.component.Port; @@ -41,10 +41,6 @@ class FlipFlop implements ComponentKind extends AbstractComponentKind { attributes.push(new IntAttr("setup")); } - public function setname(s:String):Void{ - nameOfTheComponentKind=s; - } - public function getname():String { return nameOfTheComponentKind; } @@ -256,7 +252,7 @@ class FlipFlop implements ComponentKind extends AbstractComponentKind { return portArray; } - public function drawComponent(drawingAdapter:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray){ + public function drawComponent(component : Component, drawingAdapter:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray){ var drawComponent:DrawComponent = new DrawFlipFlop(component, drawingAdapter); if(highLight){ drawComponent.drawCorrespondingComponent("red"); diff --git a/client/src/model/gates/Input.hx b/client/src/model/gates/Input.hx index 3833c48..d59253e 100644 --- a/client/src/model/gates/Input.hx +++ b/client/src/model/gates/Input.hx @@ -6,6 +6,7 @@ import type.LinkAndComponentAndEndpointAndPortArray; import view.drawComponents.DrawComponent; import model.drawingInterface.DrawingAdapterI; import view.drawComponents.DrawInput; +import model.component.Component ; import model.component.Inport; import model.component.Outport; import model.component.Port; @@ -23,11 +24,6 @@ class Input implements ComponentKind extends AbstractComponentKind { public function new() { super() ; - attributes.push(new StringAttr("name")); - } - - public function setname(s:String):Void{ - nameOfTheComponentKind=s; } public function getname():String{ @@ -143,7 +139,7 @@ class Input implements ComponentKind extends AbstractComponentKind { return portArray; } - public function drawComponent(drawingAdapter:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray){ + public function drawComponent(component : Component, drawingAdapter:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray){ var drawComponent:DrawComponent = new DrawInput(component, drawingAdapter); if(highLight){ drawComponent.drawCorrespondingComponent("red"); diff --git a/client/src/model/gates/MUX.hx b/client/src/model/gates/MUX.hx index fe569c5..66d8c5e 100644 --- a/client/src/model/gates/MUX.hx +++ b/client/src/model/gates/MUX.hx @@ -8,6 +8,7 @@ import type.LinkAndComponentAndEndpointAndPortArray; import view.drawComponents.DrawComponent; import model.drawingInterface.DrawingAdapterI; import view.drawComponents.DrawMUX; +import model.component.Component ; import model.component.Inport; import model.component.Outport; import model.component.Port; @@ -45,10 +46,6 @@ class MUX implements ComponentKind extends AbstractComponentKind { attributes.push(new IntAttr("delay")); } - public function setname(s:String):Void{ - nameOfTheComponentKind=s; - } - public function getname():String{ return nameOfTheComponentKind; } @@ -183,7 +180,7 @@ class MUX implements ComponentKind extends AbstractComponentKind { return portArray; } - public function drawComponent(drawingAdapter:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray){ + public function drawComponent(component : Component, drawingAdapter:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray){ var drawComponent:DrawComponent = new DrawMUX(component, drawingAdapter); if(highLight){ drawComponent.drawCorrespondingComponent("red"); diff --git a/client/src/model/gates/NAND.hx b/client/src/model/gates/NAND.hx index bdf84c6..d6433cf 100644 --- a/client/src/model/gates/NAND.hx +++ b/client/src/model/gates/NAND.hx @@ -4,10 +4,11 @@ import model.attribute.OrientationAttr; import model.attribute.StringAttr; import model.attribute.IntAttr; import model.attribute.Attribute; -import type.LinkAndComponentAndEndpointAndPortArray; import view.drawComponents.DrawComponent; import model.drawingInterface.DrawingAdapterI; import view.drawComponents.DrawNAND; +import model.selectionModel.SelectionModel ; +import model.component.Component ; import model.component.Inport; import model.component.Outport; import model.component.Port; @@ -38,10 +39,6 @@ class NAND implements ComponentKind extends AbstractComponentKind { attributes.push(new IntAttr("delay")); } - public function setname(s:String):Void{ - nameOfTheComponentKind=s; - } - public function getname():String{ return nameOfTheComponentKind; } @@ -115,7 +112,7 @@ class NAND implements ComponentKind extends AbstractComponentKind { return portArray; } - public function drawComponent(drawingAdapter:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray){ + public function drawComponent(component : Component, drawingAdapter:DrawingAdapterI, highLight:Bool, selection : SelectionModel){ var drawComponent:DrawComponent = new DrawNAND(component, drawingAdapter); if(highLight){ drawComponent.drawCorrespondingComponent("red"); diff --git a/client/src/model/gates/NOR.hx b/client/src/model/gates/NOR.hx index b7fa6e8..2d83e39 100644 --- a/client/src/model/gates/NOR.hx +++ b/client/src/model/gates/NOR.hx @@ -4,10 +4,11 @@ import model.attribute.OrientationAttr; import model.attribute.StringAttr; import model.attribute.IntAttr; import model.attribute.Attribute; -import type.LinkAndComponentAndEndpointAndPortArray; import view.drawComponents.DrawComponent; import model.drawingInterface.DrawingAdapterI; import view.drawComponents.DrawNOR; +import model.selectionModel.SelectionModel ; +import model.component.Component ; import model.component.Inport; import model.component.Outport; import model.component.Port; @@ -38,10 +39,6 @@ class NOR implements ComponentKind extends AbstractComponentKind { attributes.push(new IntAttr("delay")); } - public function setname(s:String):Void{ - nameOfTheComponentKind=s; - } - public function getname():String{ return nameOfTheComponentKind; } @@ -115,7 +112,7 @@ class NOR implements ComponentKind extends AbstractComponentKind { return portArray; } - public function drawComponent(drawingAdapter:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray){ + public function drawComponent(component : Component, drawingAdapter:DrawingAdapterI, highLight:Bool, selection : SelectionModel){ var drawComponent:DrawComponent = new DrawNOR(component, drawingAdapter); if(highLight){ drawComponent.drawCorrespondingComponent("red"); diff --git a/client/src/model/gates/NOT.hx b/client/src/model/gates/NOT.hx index 257c982..ce1e68b 100644 --- a/client/src/model/gates/NOT.hx +++ b/client/src/model/gates/NOT.hx @@ -4,10 +4,11 @@ import model.attribute.OrientationAttr; import model.attribute.StringAttr; import model.attribute.IntAttr; import model.attribute.Attribute; -import type.LinkAndComponentAndEndpointAndPortArray; import view.drawComponents.DrawComponent; import model.drawingInterface.DrawingAdapterI; import view.drawComponents.DrawNOT; +import model.selectionModel.SelectionModel ; +import model.component.Component ; import model.component.Inport; import model.component.Outport; import model.component.Port; @@ -36,10 +37,6 @@ class NOT implements ComponentKind extends AbstractComponentKind { attributes.push(new IntAttr("delay")); } - public function setname(s:String):Void{ - nameOfTheComponentKind=s; - } - public function getname():String{ return nameOfTheComponentKind; } @@ -113,7 +110,7 @@ class NOT implements ComponentKind extends AbstractComponentKind { return portArray; } - public function drawComponent(drawingAdapter:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray){ + public function drawComponent(component : Component, drawingAdapter:DrawingAdapterI, highLight:Bool, selection : SelectionModel){ var drawComponent:DrawComponent = new DrawNOT(component, drawingAdapter); if(highLight){ drawComponent.drawCorrespondingComponent("red"); diff --git a/client/src/model/gates/OR.hx b/client/src/model/gates/OR.hx index 8a84352..22e73c0 100644 --- a/client/src/model/gates/OR.hx +++ b/client/src/model/gates/OR.hx @@ -4,10 +4,11 @@ import model.attribute.OrientationAttr; import model.attribute.StringAttr; import model.attribute.IntAttr; import model.attribute.Attribute; -import type.LinkAndComponentAndEndpointAndPortArray; import view.drawComponents.DrawComponent; import model.drawingInterface.DrawingAdapterI; import view.drawComponents.DrawOR; +import model.selectionModel.SelectionModel ; +import model.component.Component ; import model.component.Inport; import model.component.Outport; import model.component.Port; @@ -38,10 +39,6 @@ class OR implements ComponentKind extends AbstractComponentKind { attributes.push(new IntAttr("delay")); } - public function setname(s:String):Void{ - nameOfTheComponentKind=s; - } - public function getname():String{ return nameOfTheComponentKind; } @@ -56,7 +53,8 @@ class OR implements ComponentKind extends AbstractComponentKind { var counter:Int = 0; //inport while (counter < inportNum) { - var inport:Port = new Inport(xPosition - width / 2, height / (inportNum + 1) * (counter + 1) + (yPosition - height / 2)); + var inport:Port = new Inport(xPosition - width / 2, + height / (inportNum + 1) * (counter + 1) + (yPosition - height / 2)); inport.set_portDescription(IOTYPE.INPUT); portArray.push(inport); counter++; @@ -115,7 +113,7 @@ class OR implements ComponentKind extends AbstractComponentKind { return portArray; } - public function drawComponent(drawingAdapter:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray){ + public function drawComponent(component : Component, drawingAdapter:DrawingAdapterI, highLight:Bool, selection : SelectionModel){ var drawComponent:DrawComponent = new DrawOR(component, drawingAdapter); if(highLight){ drawComponent.drawCorrespondingComponent("red"); diff --git a/client/src/model/gates/Output.hx b/client/src/model/gates/Output.hx index cdeda68..233e903 100644 --- a/client/src/model/gates/Output.hx +++ b/client/src/model/gates/Output.hx @@ -6,6 +6,7 @@ import type.LinkAndComponentAndEndpointAndPortArray; import view.drawComponents.DrawComponent; import model.drawingInterface.DrawingAdapterI; import view.drawComponents.DrawOutput; +import model.component.Component ; import model.component.Inport; import model.component.Outport; import model.component.Port; @@ -25,10 +26,6 @@ class Output implements ComponentKind extends AbstractComponentKind { super() ; } - public function setname(s:String):Void{ - nameOfTheComponentKind=s; - } - public function getname():String{ return nameOfTheComponentKind; } @@ -137,7 +134,7 @@ class Output implements ComponentKind extends AbstractComponentKind { return portArray; } - public function drawComponent(drawingAdapter:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray){ + public function drawComponent(component : Component, drawingAdapter:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray){ var drawComponent:DrawComponent = new DrawOutput(component, drawingAdapter); if(highLight){ drawComponent.drawCorrespondingComponent("red"); diff --git a/client/src/model/gates/XOR.hx b/client/src/model/gates/XOR.hx index 308677a..1fbd39a 100644 --- a/client/src/model/gates/XOR.hx +++ b/client/src/model/gates/XOR.hx @@ -1,13 +1,15 @@ package model.gates; +import model.component.Component; import model.attribute.OrientationAttr; import model.attribute.StringAttr; import model.attribute.IntAttr; import model.attribute.Attribute; -import type.LinkAndComponentAndEndpointAndPortArray; import view.drawComponents.DrawComponent; import model.drawingInterface.DrawingAdapterI; import view.drawComponents.DrawXOR; +import model.selectionModel.SelectionModel ; +import model.component.Component ; import model.component.Inport; import model.component.Outport; import model.component.Port; @@ -38,10 +40,6 @@ class XOR implements ComponentKind extends AbstractComponentKind { attributes.push(new IntAttr("delay")); } - public function setname(s:String):Void{ - nameOfTheComponentKind=s; - } - public function getname():String{ return nameOfTheComponentKind; } @@ -115,7 +113,7 @@ class XOR implements ComponentKind extends AbstractComponentKind { return portArray; } - public function drawComponent(drawingAdapter:DrawingAdapterI, highLight:Bool, ?linkAndComponentArray:LinkAndComponentAndEndpointAndPortArray){ + public function drawComponent(component : Component, drawingAdapter:DrawingAdapterI, highLight:Bool, selection : SelectionModel){ var drawComponent:DrawComponent = new DrawXOR(component, drawingAdapter); if(highLight){ drawComponent.drawCorrespondingComponent("red"); diff --git a/client/src/model/selectionModel/SelectionModel.hx b/client/src/model/selectionModel/SelectionModel.hx index edb8102..adc08cf 100644 --- a/client/src/model/selectionModel/SelectionModel.hx +++ b/client/src/model/selectionModel/SelectionModel.hx @@ -21,10 +21,18 @@ class SelectionModel return this.selectedComponents; } + public function containsComponent( c : Component ) : Bool { + return this.selectedComponents.indexOf(c) != -1 ; + } + public function getSelectedLinks() : Array { return this.selectedLinks; } + public function containsLink( lnk : Link ) : Bool { + return this.selectedLinks.indexOf( lnk ) != -1 ; + } + public function addLinkToSelection(link: Link) : Void { this.selectedLinks.push(link); } diff --git a/client/src/model/tabModel/TabModel.hx b/client/src/model/tabModel/TabModel.hx index 69e5d97..523cd77 100644 --- a/client/src/model/tabModel/TabModel.hx +++ b/client/src/model/tabModel/TabModel.hx @@ -1,12 +1,13 @@ package model.tabModel; +import model.drawingInterface.DrawingAdapterI; import js.html.CanvasElement; import js.html.CanvasRenderingContext2D; import model.component.CircuitDiagramI; import model.component.Component; import model.component.Link; import model.selectionModel.SelectionModel; -import js.Browser.document; -import js.html.Console; +import js.Browser.document; // No dependence from the Model package to Browser or HTML, please. TSN +import js.html.Console; // No dependence from the Model package to Browser or HTML, please. TSN import haxe.Json; /** @@ -17,6 +18,7 @@ import haxe.Json; * @author AdvaitTrivedi */ class TabModel +// This should be Observable. TSN { var view: view.View; var selectionModel: SelectionModel; @@ -67,20 +69,28 @@ class TabModel this.canvasElement = innerCanvas; } + + public function draw( drawingAdaptor : DrawingAdapterI ) : Void { + this.circuitDiagram.draw( drawingAdaptor, this.selectionModel ) ; + } public function getCircuitDiagram() : CircuitDiagramI { + // Could we do without this method? return this.circuitDiagram; } public function getSelectionModel() : SelectionModel { + // Could we do without this method? return this.selectionModel; } public function addLinksToSelection(links : Array) : Void { + // This violates the abstraction. TSN this.selectionModel.getSelectedLinks().concat(links); } public function addComponentsToSelection(components: Array) : Void { + // This violates the abstraction. TSN this.selectionModel.getSelectedComponents().concat(components); } diff --git a/client/src/view/View.hx b/client/src/view/View.hx index 9b9beea..ac75949 100644 --- a/client/src/view/View.hx +++ b/client/src/view/View.hx @@ -99,7 +99,7 @@ class View public function updateCanvas() : Void { Console.log('view.updateCanvas'); var drawingAdapter = new DrawingAdapter(Transform.identity(), this.activeTab.getCanvasContext().getContext2d()); - this.activeTab.getCircuitDiagram().draw(drawingAdapter); + this.activeTab.draw(drawingAdapter); } public function setActiveTab(){ diff --git a/client/src/view/drawComponents/DrawAND.hx b/client/src/view/drawComponents/DrawAND.hx index 1b383bb..e7037c8 100644 --- a/client/src/view/drawComponents/DrawAND.hx +++ b/client/src/view/drawComponents/DrawAND.hx @@ -22,7 +22,6 @@ class DrawAND implements DrawComponent{ strokeColor = "black"; } drawingAdapter.setStrokeColor(strokeColor); - drawingAdapter.drawAndShape(component.get_xPosition(), component.get_yPosition(), component.get_width(), component.get_height(), component.get_orientation()); //draw inport for (i in component.get_inportIterator()) { diff --git a/client/src/view/drawComponents/DrawCompoundComponent.hx b/client/src/view/drawComponents/DrawCompoundComponent.hx index 19673c5..b44a23f 100644 --- a/client/src/view/drawComponents/DrawCompoundComponent.hx +++ b/client/src/view/drawComponents/DrawCompoundComponent.hx @@ -70,7 +70,7 @@ class DrawCompoundComponent implements DrawComponent{ if(component.get_boxType() == BOX.WHITE_BOX ){ for(j in component.get_componentKind().getInnerCircuitDiagram().get_componentIterator()){ if(j.getNameOfTheComponentKind() == "Input"){ - if(i.get_sequence() == j.get_componentKind().get_sequence()){ + if(i.get_sequence() == j.get_sequence()){ for(k in j.get_inportIterator()){ //draw a line var coordinate:Coordinate = drawingAdapterTrans.getTransform().pointConvert(new Coordinate(k.get_xPosition(), k.get_yPosition())); @@ -92,9 +92,9 @@ class DrawCompoundComponent implements DrawComponent{ drawingAdapter.drawCricle(port.get_xPosition(), port.get_yPosition(), portRadius); if(component.get_boxType() == BOX.WHITE_BOX){ - for(j in component.get_componentKind().getInnerCircuitDiagram().get_componentIterator()){ + for(j in component.getInnerCircuitDiagram().get_componentIterator()){ if(j.getNameOfTheComponentKind() == "Output"){ - if(i.get_sequence() == j.get_componentKind().get_sequence()){ + if(i.get_sequence() == j.get_sequence()){ for(k in j.get_outportIterator()){ //draw a line var coordinate:Coordinate = drawingAdapterTrans.getTransform().pointConvert(new Coordinate(k.get_xPosition(), k.get_yPosition()));