ht-live.js 24 KB

1
  1. !function(S,e,g){"use strict";var w=ht.LiveNode=function(){w.superClass.constructor.apply(this)};ht.Default.def("ht.LiveNode",ht.Node,{_width:100,_height:35,_image:null,_enabled:!0,_editable:!0,_hover:!1,_pressed:!1,isEnabled:function(){return this._enabled},setEnabled:function(w){var K=this._enabled;this._enabled=w,this.fp("enabled",K,w)},isEditable:function(){return this._enabled},setEditable:function(u){var g=this._editable;this._editable=u,this.fp("editable",g,u)},isHover:function(){return this._hover},setHover:function(l){var R=this._hover;this._hover=l,this.fp("hover",R,l)},isPressed:function(){return this._pressed},setPressed:function(k){var b=this._pressed;this._pressed=k,this.fp("pressed",b,k)},getBackground:function(){var V,O,k=this;return V=k._enabled?k._pressed?"live.background.active":k._hover?"live.background.hover":"live.background":"live.background.disabled",O=k.s(V),O?O:k.s("live.background")},getForeground:function(){var M,g,u=this;return M=u._enabled?u._pressed?"live.label.active":u._hover?"live.label.hover":"live.label.color":"live.label.disabled",g=u.s(M),g?g:u.s("live.label.color")},setRotation:null,getUIClass:function(){return ht.graph.LiveNodeUI}});var i=ht.graph.LiveNodeUI=function(){i.superClass.constructor.apply(this,arguments)};ht.Default.def("ht.graph.LiveNodeUI",ht.Default.getInternal().ui().NodeUI,{freeDraw:function(k,O){var f=this,u=f._data,F=ht.Default.getImage(u._image);ht.Default.drawImage(k,F,O.x,O.y,O.width,O.height,u,f.gv)},onKeyDown:function(r){var J=this,g=J._data;return 32===r.keyCode||13===r.keyCode?(g.setPressed(!0),!0):void 0},onKeyUp:function(w){var U=this._data;(32===w.keyCode||13===w.keyCode)&&(U.setPressed(!1),U.onClicked&&U.onClicked(w))},onMouseOver:function(){this._data.setHover(!0)},onMouseOut:function(){this._data.setHover(!1)},onMouseDown:function(){this._data.setPressed(!0)},onMouseMove:function(){},onMouseUp:function(p){var H=this._data;H.setPressed(!1),H.onClicked&&H.onClicked(p)}});var W=ht.ButtonNode=function(){W.superClass.constructor.apply(this)};ht.Default.def("ht.ButtonNode",ht.LiveNode,{_image:"button_image"}),ht.Default.setImage("button_image",{width:{func:"getWidth"},height:{func:"getHeight"},comps:[{type:{func:"style@live.shape"},borderWidth:{func:"style@live.border.width"},borderColor:{func:"style@live.border.color"},gradient:{func:"style@live.gradient"},gradientColor:{func:"style@live.gradient.color"},background:{func:"getBackground"},rect:[0,0,1,1],relative:!0},{type:"text",text:{func:"style@live.label"},align:{func:"style@live.label.align"},color:{func:"getForeground"},font:{func:"style@live.label.font"},rect:[0,0,1,1],relative:!0,offsetX:{func:"style@live.label.offset.x"},offsetY:{func:"style@live.label.offset.y"}}]});var N=ht.ToggleButtonNode=function(){N.superClass.constructor.apply(this)};ht.Default.def("ht.ToggleButtonNode",ht.ButtonNode,{_selected:!1,getUIClass:function(){return ht.graph.ToggleButtonNodeUI},getBackground:function(){var R,B,U=this;return U._enabled?(U._hover&&(R="live.background.hover"),U.s(R)||(R=U._selected?"live.background.active":"live.background")):R="live.background.disabled",B=U.s(R),B?B:U.s("live.background")},getForeground:function(){var P,r,s=this;return s._enabled?(s._hover&&(P="live.label.hover"),s.s(P)||(P=s._selected?"live.label.active":"live.label.color")):P="live.label.disabled",r=s.s(P),r?r:s.s("live.label.color")},isSelected:function(){return this._selected},setSelected:function(u){var S=this,m=S._selected,h=S._buttonGroup;S._selected=u,S.fp("selected",m,u)&&(h&&u&&h._selected!==S&&(h._selected&&h._selected.setSelected(!1),h._selected=S,h.onChanged(S)),S.onChanged(u))},onChanged:function(){}});var n=ht.graph.ToggleButtonNodeUI=function(){n.superClass.constructor.apply(this,arguments)};ht.Default.def("ht.graph.ToggleButtonNodeUI",ht.graph.LiveNodeUI,{rectIntersects:function(){return!0},onKeyDown:function(X){var h=this;return n.superClass.onKeyDown.call(h,X)?(h.toggleSelect(),!0):void 0},onMouseDown:function(q){var Q=this;n.superClass.onMouseDown.call(Q,q),Q.toggleSelect()},toggleSelect:function(){var n=this,U=n._data;U._buttonGroup?U._selected||U.setSelected(!0):U.setSelected(!U._selected),U.setHover(!1)}});var z=ht.CheckboxNode=function(){var E=this;z.superClass.constructor.apply(E),E.s("live.label.align","left"),E.s("live.background",ht.Color.widgetIconBackground),E.s("live.background.active",ht.Color.widgetIconHighlight)};ht.Default.def("ht.CheckboxNode",ht.ToggleButtonNode,{_image:"checkbox_image",getBackground:function(){var z,o=this;return z=o._enabled?o._selected?"live.background.active":"live.background":"live.background.disabled",o.s(z)},getForeground:function(){var o,R=this;return o=R._enabled?R._selected?"live.background.active":"live.background":"live.background.disabled",R.s(o)}}),ht.Default.setImage("checkbox_image",{width:{func:"getWidth"},height:{func:"getHeight"},comps:[{type:{func:"style@live.shape"},background:{func:"getBackground"},rect:{func:function(v){var C=(v._width,v._height);return{x:.1*C,y:.2*C,width:.6*C,height:.6*C}}}},{type:"shape",points:{func:function(I){var j=(I._width,I._height);return[.3*j,.5*j,.4*j,.6*j,.55*j,.35*j]}},borderWidth:{func:function(V){return.05*V._height}},borderColor:"#FFFFFF",visible:{func:function(o){return o._selected||o._hover}}},{type:"text",text:{func:"style@live.label"},align:{func:"style@live.label.align"},color:{func:"getForeground"},font:{func:"style@live.label.font"},rect:{func:function(i){var W=i._width,Z=i._height;return{x:.8*Z,y:0,width:W-.8*Z,height:Z}}},offsetX:{func:"style@live.label.offset.x"},offsetY:{func:"style@live.label.offset.y"}}]});var C=ht.RadioButtonNode=function(){var v=this;C.superClass.constructor.apply(v),v.s("live.label.align","left"),v.s("live.background",ht.Color.widgetIconBackground),v.s("live.background.active",ht.Color.widgetIconHighlight)};ht.Default.def("ht.RadioButtonNode",ht.ToggleButtonNode,{_image:"radioButton_image",getUIClass:function(){return ht.graph.RadioButtonNodeUI},getBackground:function(){var P,a=this;return P=a._enabled?a._selected?"live.background.active":"live.background":"live.background.disabled",a.s(P)},getForeground:function(){var Y,D=this;return Y=D._enabled?D._selected?"live.background.active":"live.background":"live.background.disabled",D.s(Y)}}),ht.Default.setImage("radioButton_image",{width:{func:"getWidth"},height:{func:"getHeight"},comps:[{type:"circle",borderWidth:{func:function(e){return.1*e._height}},borderColor:{func:"getBackground"},rect:{func:function(s){var u=(s._width,s._height);return{x:.1*u,y:.2*u,width:.6*u,height:.6*u}}}},{type:"circle",background:{func:"getBackground"},rect:{func:function(x){var c=(x._width,x._height);return{x:.3*c,y:.4*c,width:.2*c,height:.2*c}}},visible:{func:function(i){return i._selected||i._hover}}},{type:"text",text:{func:"style@live.label"},align:{func:"style@live.label.align"},color:{func:"getBackground"},font:{func:"style@live.label.font"},rect:{func:function(M){var J=M._width,U=M._height;return{x:.8*U,y:0,width:J-.8*U,height:U}}},offsetX:{func:"style@live.label.offset.x"},offsetY:{func:"style@live.label.offset.y"}}]});var Q=ht.graph.RadioButtonNodeUI=function(){Q.superClass.constructor.apply(this,arguments)};ht.Default.def("ht.graph.RadioButtonNodeUI",ht.graph.ToggleButtonNodeUI,{toggleSelect:function(){this._data._selected||this._data.setSelected(!0)}});var u=ht.SwitchNode=function(){var y=this;u.superClass.constructor.apply(y),y.s("live.background",ht.Color.widgetIconBackground),y.s("live.background.active",ht.Color.widgetIconHighlight),y.s("live.label.color",ht.Color.widgetIconBackground),y.s("live.label.active",ht.Color.widgetIconHighlight)};ht.Default.def("ht.SwitchNode",ht.ToggleButtonNode,{_image:"switch_image",getBackground:function(){return this.s(this._selected?"live.background.active":"live.background")},getForeground:function(){return this.s(this._selected?"live.label.active":"live.label.color")}}),ht.Default.setImage("switch_image",{width:{func:"getWidth"},height:{func:"getHeight"},comps:[{type:{func:"style@live.shape"},borderWidth:{func:"style@live.border.width"},borderColor:{func:"style@live.border.color"},background:{func:"style@switch.background"},opacity:{func:function(y){return y._enabled?1:.5}},rect:[0,0,1,1],relative:!0},{type:"circle",background:{func:"getBackground"},opacity:{func:function(k){return k._enabled?1:.5}},rect:{func:function(e){var g=30,h=10,r=e._selected;return{x:r?e._width-h-g:h,y:(e._height-g)/2,width:g,height:g}}}},{type:"text",text:{func:function(K){return K.s(K._selected?"switch.text.on":"switch.text.off")}},rect:[17,1,1],relative:!0,offsetX:{func:function(s){return s._selected?-10:10}},color:{func:"getForeground"},font:{func:"style@live.label.font"},align:{func:"style@live.label.align"}}]});var a=ht.ComboboxNode=function(){var W=this;a.superClass.constructor.apply(W),W.s("live.label.align","left")};ht.Default.def("ht.ComboboxNode",ht.LiveNode,{_image:"combobox_image",_buttonWidth:20,_maxHeight:200,_selectedIndex:-1,getUIClass:function(){return ht.graph.ComboboxNodeUI},getItems:function(){return this._items},setItems:function(c){var b=this._items;this._items=c,this.fp("items",b,c)},getSelectedItem:function(){return this._selectedItem},setSelectedItem:function(t){var k,z=this,m=z._items,W=z._selectedItem;!m||(k=m.indexOf(t))<0||(z._selectedItem=t,z._selectedIndex=k,z.s("live.label",t?z.getItemName(t):""),z.fp("selectedItem",W,t)&&z.onChanged(t))},getSelectedIndex:function(){return this._selectedIndex},setSelectedIndex:function(A){var E=this,z=E._items;!z||0>A||A>=z.length||(E._selectedIndex=A,E.setSelectedItem(z[A]))},getItemName:function(m){return m.label||m},onChanged:function(){}}),ht.Default.setImage("combobox_image",{width:{func:"getWidth"},height:{func:"getHeight"},comps:[{type:{func:"style@live.shape"},borderWidth:{func:"style@live.border.width"},borderColor:{func:"style@live.border.color"},gradient:{func:"style@live.gradient"},gradientColor:{func:"style@live.gradient.color"},background:{func:"getBackground"},rect:[0,0,1,1],relative:!0},{type:"shape",points:{func:function(x){var h=x._buttonWidth,D=x._width,L=x._height;return[D-h+.5*h,.6*L,D-h+.75*h,.4*L,D-h+.25*h,.4*L]}},background:{func:function(S){return S._pressed?"#000000":"#FFFFFF"}}},{type:"text",text:{func:"style@live.label"},align:{func:"style@live.label.align"},color:{func:"getForeground"},font:{func:"style@live.label.font"},rect:[0,0,1,1],relative:!0,offsetX:{func:"style@live.label.offset.x"},offsetY:{func:"style@live.label.offset.y"}}]});var $=ht.graph.ComboboxNodeUI=function(){$.superClass.constructor.apply(this,arguments)};ht.Default.def("ht.graph.ComboboxNodeUI",ht.graph.LiveNodeUI,{rectIntersects:function(){return!0},onKeyDown:function(k){var F,K=this._data,o=0;return(37===k.keyCode||38===k.keyCode)&&(o=-1),(39===k.keyCode||40===k.keyCode)&&(o=1),o?(K._selectedIndex>=0?F=K._selectedIndex+o:K._items&&K._items.length>0&&(F=1===o?0:K.items.length-1),K.setSelectedIndex(F),this._ignore=!0,!0):27===k.keyCode||13===k.keyCode?(this._hidePopup(),!0):void 0},onMouseMove:function(){this._data._pressed&&(this._moved=!0)},onMouseUp:function(x){var J=this;$.superClass.onMouseUp.call(J,x),J._moved||(J._list?J._hidePopup():J._showPopup()),delete J._moved},_42:function(y){if($.superClass._42.call(this,y),this._list&&this._data._selectedIndex>=0){var k=this._list.getDataModel().getDatas().get(this._data._selectedIndex);this._list.sm().ld()!==k&&this._list.sm().setSelection(k)}},_showPopup:function(){var F,l,e,S,r,z,U,X,s,Y,V=this,b=V._data,o=b._items,j=V.gv._view.getBoundingClientRect(),D=(b._position.x-b._width/2)*V.gv._zoom+V.gv.tx()+j.left-V.gv._view.scrollLeft,q=(b._position.y+b._height/2)*V.gv._zoom+V.gv.ty()+j.top-V.gv._view.scrollTop;if(o&&0!==o.length){for(F=new ht.DataModel,l=this._list=new ht.widget.ListView(F),l.getIcon=function(){return null},l.drawRow=function(p,$,R,t,b,C,B){l._focusData===$&&(p.fillStyle=ht.Default.darker($.s("live.background")),p.beginPath(),p.rect(t,b,C,B),p.fill()),ht.widget.ListView.prototype.drawRow.apply(l,arguments)},e=0;e<o.length;e++)S=new ht.Data,S.setName(b.getItemName(o[e])),S._index=e,F.add(S),b._selectedIndex===e&&l.sm().setSelection(S);l.onSelectionChanged=function(){var i=l.sm().ld();i&&!V._ignore&&(b.setSelectedIndex(i._index),V._hidePopup(),delete V._ignore)},l.getSelectBackground=function(F){var t=F.s("live.background");return F===l._focusData?ht.Default.darker(t):t},l.getView().addEventListener("mousemove",function(k){l.setFocusData(l.getDataAt(k)),l.invalidateModel()}),X=ht.Default.getWindowInfo(),z=b._width,U=Math.min(l.getRowHeight()*o.length,b._maxHeight,X.height),s=X.width-z-10,Y=X.height-U-10,D=D>s?s:D,q=q>Y?Y:q,D=0>D?0:D,q=0>q?0:q,r=l.getView().style,r.left=D+X.left+"px",r.top=q+X.top+"px",r.width=z+"px",r.height=U+"px",r.zIndex=1e4,r.background="white",r.borderWidth="1px",r.borderColor="#DDDDE0",r.borderStyle="solid",r.borderRadius="5px",document.body.appendChild(l.getView()),O(function(){V._hidePopup()})}},_hidePopup:function(){this._list&&(document.body.removeChild(this._list.getView()),delete this._list)}});var I=ht.ProgressBarNode=function(){var Z=this;I.superClass.constructor.apply(Z),Z.s("label.position",17),Z.s("live.background",ht.Color.widgetIconBackground),Z.s("live.background.active",ht.Color.widgetIconHighlight)};ht.Default.def("ht.ProgressBarNode",ht.LiveNode,{_image:"progressBar_image",_value:0,getValue:function(){return this._value},setValue:function(z){var P=this._value;this._value=z,this.fp("value",P,z)},getName:function(){return this._value+"%"}}),ht.Default.setImage("progressBar_image",{width:{func:"getWidth"},height:{func:"getHeight"},comps:[{type:"rect",background:{func:"style@live.background"},rect:[0,0,1,1],relative:!0},{type:"rect",background:{func:"style@live.background.active"},rect:{func:function(O){return[0,0,O._value/100,.5]}},relative:!0},{type:"rect",background:{func:function(k){return ht.Default.darker(k.s("live.background.active"))}},rect:{func:function(g){return[0,.5,g._value/100,.5]}},relative:!0}]});var B=ht.SliderNode=function(){var d=this;B.superClass.constructor.apply(d),d.s("label.position",17),d.s("live.background",ht.Color.widgetIconBackground),d.s("live.background.active",ht.Color.widgetIconHighlight)};ht.Default.def("ht.SliderNode",ht.LiveNode,{_image:"slider_image",_orientation:"horizontal",_value:0,_min:0,_max:100,_step:1,getUIClass:function(){return ht.graph.SliderNodeUI},getOrientation:function(){return this._orientation},setOrientation:function(D){var u=this._orientation;this._orientation=D,this.fp("orientation",u,D)},isHorizontal:function(){var B=this._orientation;return"h"===B||"horizontal"===B},getValue:function(){return this._value},setValue:function(c){var o=this,F=o._min,U=o._max,J=o._step;F>c&&(c=F),c>U&&(c=U),c=Math.floor(c/J)*J;var V=o._value;o._value=c,o.fp("value",V,c)&&o.onChanged(c)},getMin:function(){return this._min},setMin:function(G){var P=this._min;this._min=G,this.fp("min",P,G),this.setValue(this._value)},getMax:function(){return this._max},setMax:function(e){var f=this._max;this._max=e,this.fp("max",f,e),this.setValue(this._value)},getStep:function(){return this._step},setStep:function(s){var p=this._step;this._step=s,this.fp("step",p,s),this.setValue(this._value)},getName:function(){return this._value+""},onChanged:function(){}}),ht.Default.setImage("slider_image",{width:{func:"getWidth"},height:{func:"getHeight"},comps:[{type:"rect",background:{func:"style@live.background.active"},rect:{func:function(n){var Q=n.s("slider.bar.size"),I=n.s("slider.thumb.size")+n.s("live.border.width"),o=n._value/(n._max-n._min),H=n.isHorizontal(),m=n._width,h=n._height;return{x:H?I:(m-Q)/2,y:H?(h-Q)/2:h-I-(h-2*I)*o,width:H?(m-2*I)*o:Q,height:H?Q:(h-2*I)*o}}}},{type:"rect",background:{func:"style@live.background"},rect:{func:function(k){var l=k.s("slider.bar.size"),s=k.s("slider.thumb.size")+k.s("live.border.width"),h=k._value/(k._max-k._min),i=k.isHorizontal(),v=k._width,z=k._height;return{x:i?s+(v-2*s)*h:(v-l)/2,y:i?(z-l)/2:s,width:i?(v-2*s)*(1-h):l,height:i?l:(z-2*s)*(1-h)}}}},{type:"circle",borderWidth:{func:"style@live.border.width"},borderColor:{func:"style@live.border.color"},background:{func:"style@slider.thumb.background"},rect:{func:function(P){var g=P.s("slider.thumb.size"),S=P._value/(P._max-P._min),U=P.isHorizontal(),e=P._width,W=P._height;return{x:U?S*(e-2*g):e/2-g,y:U?W/2-g:(1-S)*(W-2*g),width:2*g,height:2*g}}}}]});var y=ht.graph.SliderNodeUI=function(){y.superClass.constructor.apply(this,arguments)};ht.Default.def("ht.graph.SliderNodeUI",ht.graph.LiveNodeUI,{rectIntersects:function(){return!0},onKeyDown:function(I){var U=this._data,i=U.isHorizontal(),j=0;return(i&&37===I.keyCode||!i&&40===I.keyCode)&&(j=-1),(i&&39===I.keyCode||!i&&38===I.keyCode)&&(j=1),j?(U.setValue(U._value+U._step*j),!0):void 0},onMouseDown:function(Z){var W=this,w=W._data,u=ht.Default.getClientPoint(Z);W._start=w.isHorizontal()?u.x:u.y,W._startValue=w._value},onDrag:function(T){var x=this;if(x._start===g)return!1;var s=x._data,L=s.isHorizontal(),y=s._step,H=ht.Default.getClientPoint(T),E=L?H.x:H.y,K=s.s("slider.thumb.size")+s.s("live.border.width"),O=L?s._width:s._height-2*K,e=(E-x._start)*(L?1:-1),B=(s._max-s._min)*e/O/x.gv._zoom;return s.setValue(x._startValue+Math.floor(B/y)*y),!0},onMouseUp:function(){delete this._start,delete this._startValue}});var l=ht.SpinnerNode=function(){l.superClass.constructor.apply(this),this._styleMap={},this._styleMap["label.position"]=16};ht.Default.def("ht.SpinnerNode",ht.LiveNode,{_image:"spinner_image",_value:0,_min:0,_max:100,_step:1,getUIClass:function(){return ht.graph.SpinnerNodeUI},getValue:function(){return this._value},setValue:function(Z){Z<this._min&&(Z=this._min),Z>this._max&&(Z=this._max),Z=Math.floor(Z/this._step)*this._step;var i=this._value;this._value=Z,this.fp("value",i,Z)&&this.onChanged(Z)},getMin:function(){return this._min},setMin:function(o){var W=this._min;this._min=o,this.fp("min",W,o),this.setValue(this._value)},getMax:function(){return this._max},setMax:function(N){var l=this._max;this._max=N,this.fp("max",l,N),this.setValue(this._value)},getStep:function(){return this._step},setStep:function(I){var y=this._step;this._step=I,this.fp("step",y,I),this.setValue(this._value)},getName:function(){return this._value+""},onChanged:function(){},getForeground:function(){return this.s(this._enabled?"live.label.active":"live.label.color")}}),ht.Default.setImage("spinner_image",{width:{func:"getWidth"},height:{func:"getHeight"},comps:[{type:{func:"style@live.shape"},borderWidth:{func:"style@live.border.width"},borderColor:{func:"style@live.border.color"},gradient:{func:"style@live.gradient"},gradientColor:{func:"style@live.gradient.color"},background:{func:function(t){return t.s(t._enabled?"spinner.background":"live.background.disabled")}},rect:[0,0,1,1],relative:!0},{type:"rect",background:{func:function(w){var k;return k=w._topPressed?"live.background.active":w._topHover?"live.background.hover":"live.background",w.s(k)}},rect:{func:function(o){var f=o.s("spinner.button.width"),Y=o.s("live.border.width");return{x:o._width-f,y:Y,width:f-Y,height:o._height/2-Y}}}},{type:"shape",points:{func:function(f){var h=f.s("spinner.button.width"),t=f._width,y=f._height;return[t-h+.5*h,.15*y,t-h+.75*h,.4*y,t-h+.25*h,.4*y]}},background:{func:function(H){return H._topHover?"#000000":"#FFFFFF"}}},{type:"rect",background:{func:function(E){var $;return $=E._bottomPressed?"live.background.active":E._bottomHover?"live.background.hover":"live.background",E.s($)}},rect:{func:function(D){var u=D.s("spinner.button.width"),l=D.s("live.border.width"),L=D._width,W=D._height;return{x:L-u,y:W/2,width:u-l,height:W/2-l}}}},{type:"shape",points:{func:function(T){var e=T.s("spinner.button.width"),H=T._width,q=T._height;return[H-e+.5*e,.9*q,H-e+.75*e,.65*q,H-e+.25*e,.65*q]}},background:{func:function(j){return j._bottomHover?"#000000":"#FFFFFF"}}}]});var r=ht.graph.SpinnerNodeUI=function(){r.superClass.constructor.apply(this,arguments)};ht.Default.def("ht.graph.SpinnerNodeUI",ht.graph.LiveNodeUI,{_refresh:function(h){var i=this._data,A=i.s("spinner.button.width"),r=this.gv.getLogicalPoint(h),l={x:i._position.x+i._width/2-A,y:i._position.y-i._height/2,width:A,height:i._height/2},b={x:i._position.x+i._width/2-A,y:i._position.y,width:A,height:i._height/2};i._topHover=ht.Default.containsPoint(l,r),i._bottomHover=ht.Default.containsPoint(b,r)},onKeyDown:function(Y){var A=this._data,c=0;return 38===Y.keyCode&&(c=1),40===Y.keyCode&&(c=-1),c?(A.setValue(A._value+A._step*c),!0):void 0},onMouseOut:function(){var y=this._data;y._topHover=!1,y._bottomHover=!1,this.gv.invalidateData(y)},onMouseDown:function(U){var n=this,I=n._data,t=0;n._refresh(U),I._topPressed=I._topHover,I._bottomPressed=I._bottomHover,I._topPressed&&(t=1),I._bottomPressed&&(t=-1),t&&(I.setValue(I._value+I._step*t),n._timer&&clearTimeout(n._timer),n._interval&&clearInterval(n._interval),n._timer=setTimeout(function(){n._interval=setInterval(function(){I.setValue(I._value+I._step*t)},100)},1e3))},onMouseMove:function(N){this._refresh(N),this.gv.invalidateData(this._data)},onMouseUp:function(){var C=this,y=C._data;y._topHover=!1,y._bottomHover=!1,y._topPressed=!1,y._bottomPressed=!1,C.gv.invalidateData(y),C._timer&&(clearTimeout(C._timer),delete C._timer),C._interval&&(clearInterval(C._interval),delete C._interval)}}),ht.ButtonGroup=function(r){var Y=this;Y._items=new ht.List,Y.addAll(r)},ht.Default.def("ht.ButtonGroup",e,{add:function(p){var l=this;l._items.contains(p)||(l._items.add(p),p._buttonGroup=l,l._selected&&p._selected&&l._selected.setSelected(!1),p._selected&&(l._selected=p))},addAll:function(A){A&&new ht.List(A).each(self.add,self)},remove:function(F){var n=this;n._items.contains(F)&&(n._items.remove(F),delete F._buttonGroup,n._selected===F&&delete n._selected)},getItems:function(){return this._items},clear:function(){var T=this;T._items.each(T.remove,T)},getSelected:function(){return this._selected},onChanged:function(){}});var U=ht.Style,X=ht.Color,D=X.widgetBackground,x=X.widgetIconHighlight,T=ht.Default.labelSelectColor;U["live.shape"]="rect",U["live.border.width"]=1,U["live.border.color"]=X.widgetBorder,U["live.gradient"]="",U["live.gradient.color"]="#FFF",U["live.background"]=x,U["live.background.disabled"]=D,U["live.background.hover"]=ht.Default.brighter(x),U["live.background.active"]=ht.Default.darker(x),U["live.label"]="",U["live.label.offset.x"]=0,U["live.label.offset.y"]=0,U["live.label.align"]="center",U["live.label.font"]=g,U["live.label.color"]=T,U["live.label.disabled"]=X.widgetIconBackground,U["live.label.hover"]=T,U["live.label.active"]=T,U["switch.background"]=D,U["switch.text.on"]="ON",U["switch.text.off"]="OFF",U["slider.bar.size"]=6,U["slider.thumb.size"]=8,U["slider.thumb.background"]=x,U["spinner.background"]="#FFFFFF",U["spinner.button.width"]=20;var d=ht.graph.GraphView.prototype;d.getFocusData=function(){return this._focusData},d.handleKeyUp=function(x){var w=this._focusData,B=w&&this._25I[w._id];w&&w._enabled&&w._editable&&B&&B.onKeyUp&&B.onKeyUp(x)},d.handleMouseDown=function(v,b){this._focusData=b;var A=b&&this._25I[b._id];b&&b._enabled&&b._editable&&A&&A.onMouseDown&&A.onMouseDown(v)},d.handleMouseUp=function(N,F){var J=F&&this._25I[F._id];F&&F._enabled&&F._editable&&J&&J.onMouseUp&&J.onMouseUp(N)},d.handleMouseMove=function(M){var l=this._lastHoverData,u=l&&this._25I[l._id],A=this.getDataAt(M),s=A&&this._25I[A._id];l&&u&&l._enabled&&l._editable&&(l===A?u.onMouseMove&&u.onMouseMove(M):u.onMouseOut&&u.onMouseOut(M)),A&&l!==A&&A._enabled&&A._editable&&s&&s.onMouseOver&&s.onMouseOver(M),this._lastHoverData=A},d._93O=function(K,y){var L=y&&this._25I[y._id];return y&&y._enabled&&y._editable&&L&&L.onDrag&&L.onDrag(K)},d=ht.graph.DefaultInteractor.prototype,d.handle_keyup=function(E){this.gv.handleKeyUp&&this.gv.handleKeyUp(E)},d.handle_mousemove=function(p){this.gv.handleMouseMove&&this.gv.handleMouseMove(p)};var s=new ht.List,O=function(J){setTimeout(function(){s.add(J)},0)};S.addEventListener(ht.Default.isTouchable?"touchend":"mouseup",function(){s.size()>0&&setTimeout(function(){s.each(function(j){j()}),s.clear()},0)})}("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:this,Object);