Clazz.declarePackage("J.modelset");
Clazz.load(null,"J.modelset.Object2d",["java.lang.Float","J.util.C","J.viewer.JC"],function(){c$=Clazz.decorateAsClass(function(){this.isLabelOrHover=!1;this.script=this.target=this.xyz=this.gdata=null;this.atomY=this.atomX=this.valign=this.align=this.pointer=this.bgcolix=this.colix=0;this.atomZ=2147483647;this.movableZ=this.movableY=this.movableX=0;this.movableZPercent=this.movableYPercent=this.movableXPercent=2147483647;this.offsetY=this.offsetX=0;this.z=1;this.zSlab=-2147483648;this.pymolOffset=
null;this.windowHeight=this.windowWidth=0;this.adjustForWindow=!1;this.boxY=this.boxX=this.boxHeight=this.boxWidth=0;this.modelIndex=-1;this.visible=!0;this.hidden=!1;this.boxXY=null;this.scalePixelsPerMicron=0;Clazz.instantialize(this,arguments)},J.modelset,"Object2d");Clazz.prepareFields(c$,function(){this.boxXY=Clazz.newFloatArray(5,0)});$_M(c$,"getScalePixelsPerMicron",function(){return this.scalePixelsPerMicron});$_M(c$,"setScalePixelsPerMicron",function(a){this.scalePixelsPerMicron=a},"~N");
$_M(c$,"setModel",function(a){this.modelIndex=a},"~N");$_M(c$,"setVisibility",function(a){this.visible=a},"~B");$_M(c$,"setXYZ",function(a,b){this.xyz=a;null==a&&(this.zSlab=-2147483648);b&&(this.valign=null==a?0:4,this.setAdjustForWindow(null==a))},"JU.P3,~B");$_M(c$,"setAdjustForWindow",function(a){this.adjustForWindow=a},"~B");$_M(c$,"setColix",function(a){this.colix=a},"~N");$_M(c$,"setColixO",function(a){this.colix=J.util.C.getColixO(a)},"~O");$_M(c$,"setTranslucent",function(a,b){b?0!=this.bgcolix&&
(this.bgcolix=J.util.C.getColixTranslucent3(this.bgcolix,!Float.isNaN(a),a)):this.colix=J.util.C.getColixTranslucent3(this.colix,!Float.isNaN(a),a)},"~N,~B");$_M(c$,"setBgColix",function(a){this.bgcolix=a},"~N");$_M(c$,"setBgColixO",function(a){this.bgcolix=null==a?0:J.util.C.getColixO(a)},"~O");$_M(c$,"setMovableX",($fz=function(a){this.valign=4==this.valign?4:0;this.movableX=a;this.movableXPercent=2147483647},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"setMovableY",($fz=function(a){this.valign=4==this.valign?
4:0;this.movableY=a;this.movableYPercent=2147483647},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"setMovableXPercent",function(a){this.valign=4==this.valign?4:0;this.movableX=2147483647;this.movableXPercent=a},"~N");$_M(c$,"setMovableYPercent",function(a){this.valign=4==this.valign?4:0;this.movableY=2147483647;this.movableYPercent=a},"~N");$_M(c$,"setMovableZPercent",function(a){4!=this.valign&&(this.valign=0);this.movableZ=2147483647;this.movableZPercent=a},"~N");$_M(c$,"setZs",function(a,b){this.z=a;this.zSlab=
b},"~N,~N");$_M(c$,"setXYZs",function(a,b,c,d){this.setMovableX(a);this.setMovableY(b);this.setZs(c,d)},"~N,~N,~N,~N");$_M(c$,"setScript",function(a){this.script=null==a||0==a.length?null:a},"~S");$_M(c$,"getScript",function(){return this.script});$_M(c$,"setOffset",function(a){this.offsetX=J.viewer.JC.getXOffset(a);this.offsetY=J.viewer.JC.getYOffset(a);this.pymolOffset=null;this.valign=0},"~N");$_M(c$,"setAlignmentLCR",function(a){return"left".equals(a)?this.setAlignment(1):"center".equals(a)?this.setAlignment(2):
"right".equals(a)?this.setAlignment(3):!1},"~S");$_M(c$,"setAlignment",function(a){this.align!=a&&(this.align=a,this.recalc());return!0},"~N");$_M(c$,"setPointer",function(a){this.pointer=a},"~N");$_M(c$,"setBoxOffsetsInWindow",function(a,b,c){var d=this.boxWidth+a,e=this.boxX;e+d>this.windowWidth&&(e=this.windowWidth-d);e<a&&(e=a);this.boxX=e;a=this.boxHeight;c+a>this.windowHeight&&(c=this.windowHeight-a);c<b&&(c=b);this.boxY=c},"~N,~N,~N");$_M(c$,"setWindow",function(a,b,c){this.windowWidth=a;this.windowHeight=
b;null==this.pymolOffset&&(0>this.scalePixelsPerMicron&&0!=c)&&(this.scalePixelsPerMicron=c)},"~N,~N,~N");$_M(c$,"checkObjectClicked",function(a,b,c,d){if(this.hidden||null==this.script||0<=this.modelIndex&&!d.get(this.modelIndex))return!1;a&&(b<<=1,c<<=1);return b>=this.boxX&&b<=this.boxX+this.boxWidth&&c>=this.boxY&&c<=this.boxY+this.boxHeight},"~B,~N,~N,JU.BS");c$.setProperty=$_M(c$,"setProperty",function(a,b,c){if("script"===a)return null!=c&&c.setScript(b),!0;if("xpos"===a)return null!=c&&c.setMovableX(b.intValue()),
!0;if("ypos"===a)return null!=c&&c.setMovableY(b.intValue()),!0;if("%xpos"===a)return null!=c&&c.setMovableXPercent(b.intValue()),!0;if("%ypos"===a)return null!=c&&c.setMovableYPercent(b.intValue()),!0;if("%zpos"===a)return null!=c&&c.setMovableZPercent(b.intValue()),!0;if("xypos"===a){if(null==c)return!0;c.setXYZ(null,!0);3.4028235E38==b.z?(c.setMovableX(Clazz.floatToInt(b.x)),c.setMovableY(Clazz.floatToInt(b.y))):(c.setMovableXPercent(Clazz.floatToInt(b.x)),c.setMovableYPercent(Clazz.floatToInt(b.y)));
return!0}return"xyz"===a?(null!=c&&c.setXYZ(b,!0),!0):!1},"~S,~O,J.modelset.Object2d")});Clazz.declarePackage("J.modelset");
Clazz.load(["J.modelset.Object2d"],"J.modelset.Text",["J.util.JmolFont","$.Txt"],function(){c$=Clazz.decorateAsClass(function(){this.fontScale=0;this.textUnformatted=null;this.doFormatText=!1;this.font=this.lines=null;this.textHeight=this.textWidth=this.lineHeight=this.descent=this.ascent=this.fid=0;this.image=this.viewer=this.widths=this.text=null;this.imageScale=1;this.y0=this.yAdj=this.xAdj=this.boxYoff2=0;this.pointerPt=null;Clazz.instantialize(this,arguments)},J.modelset,"Text",J.modelset.Object2d);
Clazz.overrideMethod(c$,"setScalePixelsPerMicron",function(a){this.fontScale=0;this.scalePixelsPerMicron=a},"~N");$_M(c$,"getText",function(){return this.text});Clazz.makeConstructor(c$,function(){Clazz.superConstructor(this,J.modelset.Text,[])});c$.newLabel=$_M(c$,"newLabel",function(a,b,c,d,e,f,g,h){var k=new J.modelset.Text;k.set(a,b,d,f,!0,g,h);k.setText(c);k.bgcolix=e;return k},"J.util.GData,J.util.JmolFont,~S,~N,~N,~N,~N,~A");c$.newEcho=$_M(c$,"newEcho",function(a,b,c,d,e,f,g,h){var k=new J.modelset.Text;
k.set(b,c,e,g,!1,h,null);k.viewer=a;k.target=d;d.equals("error")&&(f=1);k.valign=f;k.z=2;k.zSlab=-2147483648;return k},"J.viewer.Viewer,J.util.GData,J.util.JmolFont,~S,~N,~N,~N,~N");$_M(c$,"set",($fz=function(a,b,c,d,e,f,g){this.scalePixelsPerMicron=f;this.gdata=a;this.isLabelOrHover=e;this.colix=c;this.align=d;this.pymolOffset=g;this.setFont(b,e)},$fz.isPrivate=!0,$fz),"J.util.GData,J.util.JmolFont,~N,~N,~B,~N,~A");$_M(c$,"getFontMetrics",($fz=function(){this.descent=this.font.getDescent();this.ascent=
this.font.getAscent();this.lineHeight=this.ascent+this.descent},$fz.isPrivate=!0,$fz));$_M(c$,"setFontFromFid",function(a){this.fid!=a&&(this.fontScale=0,this.setFont(J.util.JmolFont.getFont3D(a),!0))},"~N");$_M(c$,"setText",function(a){null!=this.image&&this.getFontMetrics();this.image=null;a=this.fixText(a);null!=this.text&&this.text.equals(a)||(this.textUnformatted=this.text=a,(this.doFormatText=null!=this.viewer&&null!=a&&(0<=a.indexOf("%{")||0<=a.indexOf("@{")))||this.recalc())},"~S");$_M(c$,
"setImage",function(a){this.image=a;this.recalc()},"~O");$_M(c$,"setScale",function(a){this.imageScale=a;this.recalc()},"~N");$_M(c$,"setFont",function(a,b){this.font=a;null!=this.font&&(this.getFontMetrics(),b&&(this.fid=this.font.fid,this.recalc()))},"J.util.JmolFont,~B");$_M(c$,"setFontScale",function(a){this.fontScale!=a&&(this.fontScale=a,0!=this.fontScale&&this.setFont(this.gdata.getFont3DScaled(this.font,a),!0))},"~N");$_M(c$,"fixText",function(a){if(null==a||0==a.length)return null;for(var b;0<=
(b=a.indexOf("\n"));)a=a.substring(0,b)+"|"+a.substring(b+1);return a},"~S");Clazz.overrideMethod(c$,"recalc",function(){if(null!=this.image)this.textWidth=this.textHeight=0,this.boxWidth=this.viewer.apiPlatform.getImageWidth(this.image)*this.fontScale*this.imageScale,this.boxHeight=this.viewer.apiPlatform.getImageHeight(this.image)*this.fontScale*this.imageScale,this.ascent=0;else if(null==this.text)this.widths=this.lines=this.text=null;else if(null!=this.font){this.lines=J.util.Txt.split(this.text,
"|");this.textWidth=0;this.widths=Clazz.newIntArray(this.lines.length,0);for(var a=this.lines.length;0<=--a;)this.textWidth=Math.max(this.textWidth,this.widths[a]=this.stringWidth(this.lines[a]));this.textHeight=this.lines.length*this.lineHeight;this.boxWidth=this.textWidth+(2<=this.fontScale?16:8);this.boxHeight=this.textHeight+(2<=this.fontScale?16:8)}});$_M(c$,"formatText",function(){this.text=null==this.viewer?this.textUnformatted:this.viewer.formatText(this.textUnformatted);this.recalc()});$_M(c$,
"setPosition",function(a,b,c,d,e,f,g){null==g?g=this.boxXY:this.boxXY=g;this.setWindow(b,c,d);0!=d&&0!=this.scalePixelsPerMicron?this.setFontScale(d/this.scalePixelsPerMicron):this.fontScale!=e&&this.setFontScale(e);this.doFormatText&&this.formatText();b=this.offsetX*e;e*=this.offsetY;this.xAdj=2<=this.fontScale?8:4;this.yAdj=this.ascent-this.lineHeight+this.xAdj;this.isLabelOrHover?(g[0]=this.movableX,g[1]=this.movableY,null!=this.pymolOffset?(f=a.scaleToScreen(this.z,1E3),e=this.pymolOffset[3],
f*=(0>e?-1:1)*Math.max(0,Math.abs(e)-1),this.z-=Clazz.floatToInt(f),f=a.scaleToScreen(this.z,1E3),b=this.getPymolXYOffset(this.pymolOffset[1],this.textWidth,f),e=-this.getPymolXYOffset(-this.pymolOffset[2],this.ascent-this.descent,f),this.xAdj=2<=this.fontScale?8:4,this.yAdj=0,e+=this.descent,g[0]=this.movableX-this.xAdj,g[1]=this.movableY-this.yAdj,this.y0=this.movableY-e-this.descent,f=!0,this.boxYoff2=-2):this.boxYoff2=0,J.modelset.Text.setBoxXY(this.boxWidth,this.boxHeight,b,e,g,f)):this.setPos(this.fontScale);
this.boxX=g[0];this.boxY=g[1];this.adjustForWindow&&this.setBoxOffsetsInWindow(0,this.isLabelOrHover?16*this.fontScale+this.lineHeight:0,this.boxY-this.textHeight);f||(this.y0=this.boxY+this.yAdj)},"J.viewer.Viewer,~N,~N,~N,~N,~B,~A");$_M(c$,"getPymolXYOffset",($fz=function(a,b,c){var d=-1>a?-1:1<a?0:(a-1)/2;return d*b+(-1>a||1<a?a+(0>a?1:-1):0)*c},$fz.isPrivate=!0,$fz),"~N,~N,~N");$_M(c$,"setPos",($fz=function(a){var b,c,d,e=null!=this.xyz;0==this.valign||4==this.valign?b=d=c=(2147483647!=this.movableXPercent?
Clazz.doubleToInt(this.movableXPercent*this.windowWidth/100):e?this.movableX:this.movableX*a)+this.offsetX*a:(b=5*a,c=Clazz.doubleToInt(this.windowWidth/2),d=this.windowWidth-b);this.boxXY[0]=b;switch(this.align){case 2:this.boxXY[0]=c-this.boxWidth/2;break;case 3:this.boxXY[0]=d-this.boxWidth}this.boxXY[1]=0;switch(this.valign){case 1:break;case 3:this.boxXY[1]=Clazz.doubleToInt(this.windowHeight/2);break;case 2:this.boxXY[1]=this.windowHeight;break;default:b=2147483647!=this.movableYPercent?Clazz.doubleToInt(this.movableYPercent*
this.windowHeight/100):e?this.movableY:this.movableY*a,this.boxXY[1]=(e?b:this.windowHeight-b)+this.offsetY*a}2==this.align?this.boxXY[1]-=(null!=this.image?this.boxHeight:null!=this.xyz?this.boxHeight:this.ascent-this.boxHeight)/2:null!=this.image?this.boxXY[1]-=0:null!=this.xyz&&(this.boxXY[1]-=Clazz.doubleToInt(this.ascent/2))},$fz.isPrivate=!0,$fz),"~N");c$.setBoxXY=$_M(c$,"setBoxXY",function(a,b,c,d,e,f){var g;0<c||f?g=c:(g=-a,g=0==c?g/2:g+c);e[0]+=g;e[1]+=f?-d:0>d?-b+d:0==d?-b/2:d;e[2]=a;e[3]=
b},"~N,~N,~N,~N,~A,~B");$_M(c$,"stringWidth",($fz=function(a){var b=0,c=1;if(null==a)return 0;if(0>a.indexOf("<su"))return this.font.stringWidth(a);for(var d=a.length,e,f=0;f<d;f++){if("<"==a.charAt(f)){if(f+4<d&&((e=a.substring(f,f+5)).equals("<sub>")||e.equals("<sup>"))){f+=4;c=1;continue}if(f+5<d&&((e=a.substring(f,f+6)).equals("</sub>")||e.equals("</sup>"))){f+=5;c=1;continue}}b+=this.font.stringWidth(a.substring(f,f+1))*c}return b},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"setXYA",function(a,b){if(0==
b){a[2]=this.boxX;switch(this.align){case 2:a[2]+=this.boxWidth/2;break;case 3:a[2]+=this.boxWidth-this.xAdj;break;default:a[2]+=this.xAdj}a[0]=a[2];a[1]=this.y0}switch(this.align){case 2:a[0]=a[2]-Clazz.doubleToInt(this.widths[b]/2);break;case 3:a[0]=a[2]-this.widths[b]}a[1]+=this.lineHeight},"~A,~N")});Clazz.declarePackage("J.shape");
Clazz.load(["J.shape.Shape","java.util.Hashtable"],"J.shape.Object2dShape",["JU.P3","J.util.Logger","$.Txt"],function(){c$=Clazz.decorateAsClass(function(){this.currentBgColor=this.currentColor=this.currentFont=this.currentObject=this.objects=null;this.currentBgTranslucentLevel=this.currentTranslucentLevel=0;this.thisID=null;this.isAll=this.isHover=!1;Clazz.instantialize(this,arguments)},J.shape,"Object2dShape",J.shape.Shape);Clazz.prepareFields(c$,function(){this.objects=new java.util.Hashtable});
$_M(c$,"setPropOS",function(a,b,c){if("allOff"===a)this.currentObject=null,this.isAll=!0,this.objects=new java.util.Hashtable;else if("delete"===a)if(null==this.currentObject){if(this.isAll||null!=this.thisID)for(a=this.objects.values().iterator();a.hasNext();){var d=a.next();(this.isAll||J.util.Txt.isMatch(d.target.toUpperCase(),this.thisID,!0,!0))&&a.remove()}}else this.objects.remove(this.currentObject.target),this.currentObject=null;else if("off"===a)this.isAll&&(this.objects=new java.util.Hashtable,
this.isAll=!1,this.currentObject=null),null!=this.currentObject&&(this.objects.remove(this.currentObject.target),this.currentObject=null);else if("model"===a)if(b=b.intValue(),null==this.currentObject){if(this.isAll)for(a=this.objects.values().iterator();a.hasNext()&&((d=a.next())||1);)d.setModel(b)}else this.currentObject.setModel(b);else if("align"===a)if(null==this.currentObject){if(this.isAll)for(var e,d=this.objects.values().iterator();d.hasNext()&&((e=d.next())||1);)e.setAlignmentLCR(b)}else this.currentObject.setAlignmentLCR(b)||
J.util.Logger.error("unrecognized align:"+b);else if("bgcolor"===a)if(this.currentBgColor=b,null==this.currentObject){if(this.isAll)for(a=this.objects.values().iterator();a.hasNext();)a.next().setBgColixO(b)}else this.currentObject.setBgColixO(b);else if("color"===a)if(this.currentColor=b,null==this.currentObject){if(this.isAll||null!=this.thisID)for(a=this.objects.values().iterator();a.hasNext();)d=a.next(),(this.isAll||J.util.Txt.isMatch(d.target.toUpperCase(),this.thisID,!0,!0))&&d.setColixO(b)}else this.currentObject.setColixO(b);
else if("target"===a){if((this.isAll=b.equals("all"))||b.equals("none"))this.currentObject=null}else if((d="bgtranslucency"===a)||"translucency"===a)if(b="translucent"===b,d?this.currentBgTranslucentLevel=b?this.translucentLevel:0:this.currentTranslucentLevel=b?this.translucentLevel:0,null==this.currentObject){if(this.isAll)for(a=this.objects.values().iterator();a.hasNext();)a.next().setTranslucent(this.translucentLevel,d)}else this.currentObject.setTranslucent(this.translucentLevel,d);else if("deleteModelAtoms"===
a){b=b[2][0];for(a=this.objects.values().iterator();a.hasNext();)d=a.next(),d.modelIndex==b?a.remove():d.modelIndex>b&&d.modelIndex--}else this.setPropS(a,b,c)},"~S,~O,JU.BS");Clazz.overrideMethod(c$,"initModelSet",function(){this.currentObject=null;this.isAll=!1});Clazz.overrideMethod(c$,"setVisibilityFlags",function(a){if(!this.isHover)for(var b,c=this.objects.values().iterator();c.hasNext()&&((b=c.next())||1);)b.setVisibility(0>b.modelIndex||a.get(b.modelIndex))},"JU.BS");Clazz.overrideMethod(c$,
"checkObjectClicked",function(a,b,c,d){if(this.isHover||0==c)return null;c=this.viewer.isAntialiased();for(var e,f=this.objects.values().iterator();f.hasNext()&&((e=f.next())||1);)if(e.checkObjectClicked(c,a,b,d))return a=e.getScript(),null!=a&&this.viewer.evalStringQuiet(a),a=new java.util.Hashtable,a.put("pt",null==e.xyz?new JU.P3:e.xyz),b=e.modelIndex,0>b&&(b=0),a.put("modelIndex",Integer.$valueOf(b)),a.put("model",this.viewer.getModelNumberDotted(b)),a.put("id",e.target),a.put("type","echo"),
a;return null},"~N,~N,~N,JU.BS,~B");Clazz.overrideMethod(c$,"checkObjectHovered",function(a,b,c){if(this.isHover)return!1;for(var d=!1,e=this.viewer.isAntialiased(),f,g=this.objects.values().iterator();g.hasNext()&&((f=g.next())||1);)if(null!=f.getScript()&&(d=!0,f.checkObjectClicked(e,a,b,c)))return this.viewer.setCursor(12),!0;d&&this.viewer.setCursor(0);return!1},"~N,~N,JU.BS")});Clazz.declarePackage("J.shape");
Clazz.load(["J.shape.Object2dShape"],"J.shape.TextShape",null,function(){c$=Clazz.declareType(J.shape,"TextShape",J.shape.Object2dShape);Clazz.overrideMethod(c$,"setProperty",function(a,b,c){this.setPropTS(a,b,c)},"~S,~O,JU.BS");$_M(c$,"setPropTS",function(a,b,c){if("text"===a)if(null==this.currentObject){if(this.isAll){var d;for(a=this.objects.values().iterator();a.hasNext()&&((d=a.next())||1);)d.setText(b)}}else this.currentObject.setText(b);else if("font"===a)if(this.currentFont=b,null==this.currentObject){if(this.isAll)for(a=
this.objects.values().iterator();a.hasNext()&&((d=a.next())||1);)d.setFont(this.currentFont,!0)}else this.currentObject.setFont(this.currentFont,!0),this.currentObject.setFontScale(0);else this.setPropOS(a,b,c)},"~S,~O,JU.BS")});Clazz.declarePackage("J.shape");
Clazz.load(["J.shape.AtomShape","java.util.Hashtable"],"J.shape.Labels","JU.ArrayUtil $.BS J.constant.EnumPalette J.modelset.LabelToken $.Text J.util.BSUtil $.C $.JmolFont J.viewer.JC".split(" "),function(){c$=Clazz.decorateAsClass(function(){this.bsBgColixSet=this.bsFontSet=this.labelBoxes=this.text=this.atomLabels=this.offsets=this.fids=this.bgcolixes=this.formats=this.strings=null;this.zeroFontId=this.defaultPointer=this.defaultPaletteID=this.defaultBgcolix=this.defaultColix=this.defaultFontId=
this.defaultZPos=this.defaultAlignment=this.defaultOffset=0;this.defaultsOnlyForNone=!0;this.isScaled=this.setDefaults=!1;this.scalePixelsPerMicron=0;this.pickedAtom=-1;this.pickedY=this.pickedX=this.pickedOffset=0;Clazz.instantialize(this,arguments)},J.shape,"Labels",J.shape.AtomShape);Clazz.prepareFields(c$,function(){this.atomLabels=new java.util.Hashtable});$_M(c$,"initShape",function(){Clazz.superCall(this,J.shape.Labels,"initShape",[]);this.defaultFontId=this.zeroFontId=this.gdata.getFont3DFSS("SansSerif",
"Plain",13).fid;this.defaultBgcolix=this.defaultColix=0;this.defaultOffset=J.shape.Labels.zeroOffset;this.defaultZPos=0;this.translucentAllowed=!1});Clazz.overrideMethod(c$,"setProperty",function(a,b,c){this.isActive=!0;if("setDefaults"===a)this.setDefaults=b.booleanValue();else if("color"===a){var d=J.constant.EnumPalette.pidOf(b);b=J.util.C.getColixO(b);if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<this.atomCount;a=c.nextSetBit(a+1))this.setLabelColix(a,b,d);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultColix=
b,this.defaultPaletteID=d}else if("scalereference"===a){if(null!=this.strings){a=b.floatValue();b=0==a?0:1E4/a;for(a=c.nextSetBit(0);0<=a&&a<this.atomCount;a=c.nextSetBit(a+1))this.strings.length<=a||(this.text=this.getLabel(a),null==this.text?(this.text=J.modelset.Text.newLabel(this.gdata,null,this.strings[a],0,0,0,b,null),this.putLabel(a,this.text)):this.text.setScalePixelsPerMicron(b))}}else if("label"===a){this.setScaling();d=null==b||0==b.length?J.shape.Labels.nullToken:[null];for(a=c.nextSetBit(0);0<=
a&&a<this.atomCount;a=c.nextSetBit(a+1))this.setLabel(d,b,a)}else if("labels"===a){this.setScaling();var e=b;a=c.nextSetBit(0);for(var f=0;0<=a&&a<this.atomCount;a=c.nextSetBit(a+1))b=e.get(f++),d=null==b||0==b.length?J.shape.Labels.nullToken:[null],this.setLabel(d,b,a)}else if("clearBoxes"===a)this.labelBoxes=null;else if(!("translucency"===a||"bgtranslucency"===a))if("bgcolor"===a){this.isActive=!0;null==this.bsBgColixSet&&(this.bsBgColixSet=new JU.BS);b=J.util.C.getColixO(b);if(!this.setDefaults)for(a=
c.nextSetBit(0);0<=a&&a<this.atomCount;a=c.nextSetBit(a+1))this.setBgcolix(a,b);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultBgcolix=b}else if(null==this.bsFontSet&&(this.bsFontSet=new JU.BS),"textLabels"===a){this.setScaling();e=b;for(a=c.nextSetBit(0);0<=a&&a<this.atomCount;a=c.nextSetBit(a+1))this.setTextLabel(a,e.get(Integer.$valueOf(a)))}else if("fontsize"===a)if(a=b.intValue(),0>a)this.fids=null;else{b=this.gdata.getFontFid(a);if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<
this.atomCount;a=c.nextSetBit(a+1))this.setFont(a,b);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultFontId=b}else if("font"===a){b=b.fid;if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<this.atomCount;a=c.nextSetBit(a+1))this.setFont(a,b);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultFontId=b}else if("offset"===a||"offsetexact"===a)if(Clazz.instanceOf(b,Integer)){b=b.intValue();d="offsetexact"===a;0==b?b=32767:b==J.shape.Labels.zeroOffset&&(b=0);if(!this.setDefaults)for(a=
c.nextSetBit(0);0<=a&&a<this.atomCount;a=c.nextSetBit(a+1))this.setOffsets(a,b,d);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultOffset=b}else{if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<this.atomCount;a=c.nextSetBit(a+1))this.setPymolOffset(a,b)}else if("align"===a){d=1;b.equalsIgnoreCase("right")?d=3:b.equalsIgnoreCase("center")&&(d=2);for(a=c.nextSetBit(0);0<=a&&a<this.atomCount;a=c.nextSetBit(a+1))this.setAlignment(a,d);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultAlignment=
d}else if("pointer"===a){b=b.intValue();if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<this.atomCount;a=c.nextSetBit(a+1))this.setPointer(a,b);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultPointer=b}else if("front"===a){b=b.booleanValue();if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<this.atomCount;a=c.nextSetBit(a+1))this.setFront(a,b);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultZPos=b?32:0}else if("group"===a){b=b.booleanValue();if(!this.setDefaults)for(a=c.nextSetBit(0);0<=
a&&a<this.atomCount;a=c.nextSetBit(a+1))this.setGroup(a,b);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultZPos=b?16:0}else if("display"===a||"toggleLabel"===a){e="toggleLabel"===a?0:b.booleanValue()?1:-1;null==this.mads&&(this.mads=Clazz.newShortArray(this.atomCount,0));var g=f=null,h=null,k=null;for(a=c.nextSetBit(0);0<=a&&a<this.atomCount;a=c.nextSetBit(a+1)){var j=this.atoms[a];if(null==this.formats||a>=this.formats.length)this.formats=JU.ArrayUtil.ensureLengthS(this.formats,a+1);null!=
this.strings&&this.strings.length>a&&null!=this.strings[a]?this.mads[a]=0==e&&0>this.mads[a]||1==e?1:-1:(null==this.bsSizeSet&&(this.bsSizeSet=new JU.BS),this.strings=JU.ArrayUtil.ensureLengthS(this.strings,a+1),j.getGroup3(!1).equals("UNK")?(null==h&&(h=this.viewer.getStandardLabelFormat(1),k=J.modelset.LabelToken.compile(this.viewer,h,"\x00",null)),b=h,d=k):(null==f&&(f=this.viewer.getStandardLabelFormat(2),g=J.modelset.LabelToken.compile(this.viewer,f,"\x00",null)),b=f,d=g),this.strings[a]=J.modelset.LabelToken.formatLabelAtomArray(this.viewer,
j,d,"\x00",null),this.formats[a]=b,this.bsSizeSet.set(a),(null==this.bsBgColixSet||!this.bsBgColixSet.get(a))&&0!=this.defaultBgcolix&&this.setBgcolix(a,this.defaultBgcolix),this.mads[a]=0<=e?1:-1);j.setShapeVisibility(this.myVisibilityFlag,null!=this.strings&&a<this.strings.length&&null!=this.strings[a]&&0<=this.mads[a])}}else a.startsWith("label:")?(this.setScaling(),this.setLabel(Array(1),a.substring(6),b.intValue())):("deleteModelAtoms"===a&&(this.labelBoxes=null,d=b[2][1],e=b[2][2],this.fids=
JU.ArrayUtil.deleteElements(this.fids,d,e),this.bgcolixes=JU.ArrayUtil.deleteElements(this.bgcolixes,d,e),this.offsets=JU.ArrayUtil.deleteElements(this.offsets,d,e),this.formats=JU.ArrayUtil.deleteElements(this.formats,d,e),this.strings=JU.ArrayUtil.deleteElements(this.strings,d,e),J.util.BSUtil.deleteBits(this.bsFontSet,c),J.util.BSUtil.deleteBits(this.bsBgColixSet,c)),this.setPropAS(a,b,c))},"~S,~O,JU.BS");$_M(c$,"setPymolOffset",($fz=function(a,b){var c=this.getLabel(a);if(null==c){c=null!=this.bsFontSet&&
this.bsFontSet.get(a)?this.fids[a]:-1;0>c&&this.setFont(a,c=this.defaultFontId);var c=J.util.JmolFont.getFont3D(c),d=this.getColix2(a,this.atoms[a],!1),c=J.modelset.Text.newLabel(this.gdata,c,this.strings[a],d,this.getColix2(a,this.atoms[a],!0),0,this.scalePixelsPerMicron,b);this.setTextLabel(a,c)}else c.pymolOffset=b},$fz.isPrivate=!0,$fz),"~N,~A");$_M(c$,"setScaling",($fz=function(){this.isActive=!0;null==this.bsSizeSet&&(this.bsSizeSet=new JU.BS);this.scalePixelsPerMicron=(this.isScaled=this.viewer.getBoolean(603979845))?
1E4*this.viewer.getScalePixelsPerAngstrom(!1):0},$fz.isPrivate=!0,$fz));$_M(c$,"setTextLabel",($fz=function(a,b){if(null!=b){var c=b.getText(),d=this.atoms[a];this.addString(d,a,c,c);d.setShapeVisibility(this.myVisibilityFlag,!0);0<=b.colix&&this.setLabelColix(a,b.colix,J.constant.EnumPalette.UNKNOWN.id);this.setFont(a,b.font.fid);this.putLabel(a,b)}},$fz.isPrivate=!0,$fz),"~N,J.modelset.Text");$_M(c$,"setLabel",($fz=function(a,b,c){var d=this.atoms[c],e=a[0];null==e&&(e=a[0]=J.modelset.LabelToken.compile(this.viewer,
b,"\x00",null));a=null==e?null:J.modelset.LabelToken.formatLabelAtomArray(this.viewer,d,e,"\x00",null);this.addString(d,c,a,b);this.text=this.getLabel(c);this.isScaled?(this.text=J.modelset.Text.newLabel(this.gdata,null,a,0,0,0,this.scalePixelsPerMicron,null),this.putLabel(c,this.text)):null!=this.text&&null!=a&&this.text.setText(a);this.defaultOffset!=J.shape.Labels.zeroOffset&&this.setOffsets(c,this.defaultOffset,!1);1!=this.defaultAlignment&&this.setAlignment(c,this.defaultAlignment);0!=(this.defaultZPos&
32)?this.setFront(c,!0):0!=(this.defaultZPos&16)&&this.setGroup(c,!0);0!=this.defaultPointer&&this.setPointer(c,this.defaultPointer);(0!=this.defaultColix||0!=this.defaultPaletteID)&&this.setLabelColix(c,this.defaultColix,this.defaultPaletteID);0!=this.defaultBgcolix&&this.setBgcolix(c,this.defaultBgcolix);this.defaultFontId!=this.zeroFontId&&this.setFont(c,this.defaultFontId)},$fz.isPrivate=!0,$fz),"~A,~S,~N");$_M(c$,"addString",($fz=function(a,b,c,d){a.setShapeVisibility(this.myVisibilityFlag,null!=
c);if(null==this.strings||b>=this.strings.length)this.strings=JU.ArrayUtil.ensureLengthS(this.strings,b+1);if(null==this.formats||b>=this.formats.length)this.formats=JU.ArrayUtil.ensureLengthS(this.formats,b+1);this.strings[b]=c;this.formats[b]=null!=d&&0<=d.indexOf("%{")?c:d;this.bsSizeSet.setBitTo(b,null!=d)},$fz.isPrivate=!0,$fz),"J.modelset.Atom,~N,~S,~S");Clazz.overrideMethod(c$,"getProperty",function(a,b){return a.equals("offsets")?this.offsets:a.equals("label")?null!=this.strings&&b<this.strings.length&&
null!=this.strings[b]?this.strings[b]:"":null},"~S,~N");$_M(c$,"putLabel",function(a,b){null==b?this.atomLabels.remove(Integer.$valueOf(a)):this.atomLabels.put(Integer.$valueOf(a),b)},"~N,J.modelset.Text");$_M(c$,"getLabel",function(a){return this.atomLabels.get(Integer.$valueOf(a))},"~N");$_M(c$,"putBox",function(a,b){null==this.labelBoxes&&(this.labelBoxes=new java.util.Hashtable);this.labelBoxes.put(Integer.$valueOf(a),b)},"~N,~A");$_M(c$,"getBox",function(a){return null==this.labelBoxes?null:
this.labelBoxes.get(Integer.$valueOf(a))},"~N");$_M(c$,"setLabelColix",($fz=function(a,b,c){this.setColixAndPalette(b,c,a);null!=this.colixes&&null!=(this.text=this.getLabel(a))&&this.text.setColix(this.colixes[a])},$fz.isPrivate=!0,$fz),"~N,~N,~N");$_M(c$,"setBgcolix",($fz=function(a,b){if(null==this.bgcolixes||a>=this.bgcolixes.length){if(0==b)return;this.bgcolixes=JU.ArrayUtil.ensureLengthShort(this.bgcolixes,a+1)}this.bgcolixes[a]=b;this.bsBgColixSet.setBitTo(a,0!=b);this.text=this.getLabel(a);
null!=this.text&&this.text.setBgColix(b)},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"setOffsets",($fz=function(a,b,c){if(null==this.offsets||a>=this.offsets.length){if(0==b)return;this.offsets=JU.ArrayUtil.ensureLengthI(this.offsets,a+1)}this.offsets[a]=this.offsets[a]&255|b<<8;c&&(this.offsets[a]|=128);this.text=this.getLabel(a);null!=this.text&&this.text.setOffset(b)},$fz.isPrivate=!0,$fz),"~N,~N,~B");$_M(c$,"setAlignment",($fz=function(a,b){if(null==this.offsets||a>=this.offsets.length){if(1==b)return;
this.offsets=JU.ArrayUtil.ensureLengthI(this.offsets,a+1)}this.offsets[a]=this.offsets[a]&-13|b<<2;this.text=this.getLabel(a);null!=this.text&&this.text.setAlignment(b)},$fz.isPrivate=!0,$fz),"~N,~N");c$.getAlignment=$_M(c$,"getAlignment",function(a){return(a&12)>>2},"~N");$_M(c$,"setPointer",($fz=function(a,b){if(null==this.offsets||a>=this.offsets.length){if(0==b)return;this.offsets=JU.ArrayUtil.ensureLengthI(this.offsets,a+1)}this.offsets[a]=(this.offsets[a]&-4)+b;this.text=this.getLabel(a);null!=
this.text&&this.text.setPointer(b)},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"setFront",($fz=function(a,b){if(null==this.offsets||a>=this.offsets.length){if(!b)return;this.offsets=JU.ArrayUtil.ensureLengthI(this.offsets,a+1)}this.offsets[a]=(this.offsets[a]&-49)+(b?32:0)},$fz.isPrivate=!0,$fz),"~N,~B");$_M(c$,"setGroup",($fz=function(a,b){if(null==this.offsets||a>=this.offsets.length){if(!b)return;this.offsets=JU.ArrayUtil.ensureLengthI(this.offsets,a+1)}this.offsets[a]=(this.offsets[a]&-49)+(b?16:0)},
$fz.isPrivate=!0,$fz),"~N,~B");$_M(c$,"setFont",($fz=function(a,b){if(null==this.fids||a>=this.fids.length){if(b==this.zeroFontId)return;this.fids=JU.ArrayUtil.ensureLengthByte(this.fids,a+1)}this.fids[a]=b;this.bsFontSet.set(a);this.text=this.getLabel(a);null!=this.text&&this.text.setFontFromFid(b)},$fz.isPrivate=!0,$fz),"~N,~N");Clazz.overrideMethod(c$,"setModelClickability",function(){if(null!=this.strings)for(var a=this.strings.length;0<=--a;)null!=this.strings[a]&&(this.modelSet.atoms.length>
a&&!this.modelSet.isAtomHidden(a))&&this.modelSet.atoms[a].setClickable(this.myVisibilityFlag)});Clazz.overrideMethod(c$,"getShapeState",function(){return!this.isActive||null==this.bsSizeSet?"":this.viewer.getShapeState(this)});Clazz.overrideMethod(c$,"checkObjectDragged",function(a,b,c,d){if(2!=this.viewer.getPickingMode()||null==this.labelBoxes)return!1;if(-2147483648==a)return a=this.findNearestLabel(c,d),0<=a?(this.pickedAtom=a,this.pickedX=c,this.pickedY=d,this.pickedOffset=(null==this.offsets||
this.pickedAtom>=this.offsets.length?0:this.offsets[this.pickedAtom])>>8,!0):!1;if(2147483647==a)return this.pickedAtom=-1,!1;if(0>this.pickedAtom)return!1;this.move2D(this.pickedAtom,c,d);return!0},"~N,~N,~N,~N,~N,JU.BS");$_M(c$,"findNearestLabel",($fz=function(a,b){if(null==this.labelBoxes)return-1;for(var c=3.4028235E38,d=-1,e=3.4028235E38,f,g=this.labelBoxes.entrySet().iterator();g.hasNext()&&((f=g.next())||1);)if(this.atoms[f.getKey().intValue()].isVisible(this.myVisibilityFlag)){var h=f.getValue(),
k=a-h[0],j=b-h[1];0>=k||(0>=j||k>=h[2]||j>=h[3]||h[4]>e)||(e=h[4],h=Math.min(Math.abs(k-h[2]/2),Math.abs(j-h[3]/2)),h<=c&&(c=h,d=f.getKey().intValue()))}return d},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"move2D",($fz=function(a,b,c){var d=J.viewer.JC.getXOffset(this.pickedOffset),e=-J.viewer.JC.getYOffset(this.pickedOffset),d=d+(b-this.pickedX),e=e+(this.pickedY-c);b=J.viewer.JC.getOffset(d,e);0==b?b=32767:b==J.shape.Labels.zeroOffset&&(b=0);this.setOffsets(a,b,!0)},$fz.isPrivate=!0,$fz),"~N,~N,~N");
$_M(c$,"getColix2",function(a,b,c){c?a=null==this.bgcolixes||a>=this.bgcolixes.length?0:this.bgcolixes[a]:(a=null==this.colixes||a>=this.colixes.length?0:this.colixes[a],a=J.util.C.getColixInherited(a,b.getColix()),J.util.C.isColixTranslucent(a)&&(a=J.util.C.getColixTranslucent3(a,!1,0)));return a},"~N,J.modelset.Atom,~B");Clazz.defineStatics(c$,"zeroOffset",1028);c$.nullToken=c$.prototype.nullToken=[null]});Clazz.declarePackage("J.shape");
Clazz.load(["J.shape.TextShape"],"J.shape.Echo",["J.modelset.Object2d","$.Text","J.util.Txt"],function(){c$=Clazz.declareType(J.shape,"Echo",J.shape.TextShape);$_M(c$,"initShape",function(){Clazz.superCall(this,J.shape.Echo,"initShape",[]);this.setProperty("target","top",null)});Clazz.overrideMethod(c$,"setProperty",function(a,b){if("scalereference"===a){if(null!=this.currentObject){var c=b.floatValue();this.currentObject.setScalePixelsPerMicron(0==c?0:1E4/c)}}else if("point"===a)null!=this.currentObject&&
(c=this.currentObject,c.pointerPt=null==b?null:b,c.pointer=null==b?0:1);else if("xyz"===a&&null!=this.currentObject&&this.viewer.getBoolean(603979845)&&this.currentObject.setScalePixelsPerMicron(1E4*this.viewer.getScalePixelsPerAngstrom(!1)),"scale"===a)if(null==this.currentObject){if(this.isAll)for(var d=this.objects.values().iterator();d.hasNext()&&((c=d.next())||1);)c.setScale(b.floatValue())}else this.currentObject.setScale(b.floatValue());else if("image"===a)if(null==this.currentObject){if(this.isAll)for(d=
this.objects.values().iterator();d.hasNext()&&((c=d.next())||1);)c.setImage(b)}else this.currentObject.setImage(b);else if("thisID"===a)c=b,this.currentObject=this.objects.get(c),null==this.currentObject&&J.util.Txt.isWild(c)&&(this.thisID=c.toUpperCase());else if("hidden"===a){var e=b.booleanValue();if(null==this.currentObject){if(this.isAll||null!=this.thisID)for(d=this.objects.values().iterator();d.hasNext()&&((c=d.next())||1);)if(this.isAll||J.util.Txt.isMatch(c.target.toUpperCase(),this.thisID,
!0,!0))c.hidden=e}else this.currentObject.hidden=e}else if(!J.modelset.Object2d.setProperty(a,b,this.currentObject)){if("target"===a&&(this.thisID=null,c=b.intern().toLowerCase(),!("none"===c||"all"===c))){this.isAll=!1;d=this.objects.get(c);null==d&&(d=0,e=1,"top"===c?(d=1,e=2):"middle"===c?(d=3,e=2):"bottom"===c&&(d=2),d=J.modelset.Text.newEcho(this.viewer,this.gdata,this.gdata.getFont3DFS("Serif",20),c,10,d,e,0),d.setAdjustForWindow(!0),this.objects.put(c,d),null!=this.currentFont&&d.setFont(this.currentFont,
!0),null!=this.currentColor&&d.setColixO(this.currentColor),null!=this.currentBgColor&&d.setBgColixO(this.currentBgColor),0!=this.currentTranslucentLevel&&d.setTranslucent(this.currentTranslucentLevel,!1),0!=this.currentBgTranslucentLevel&&d.setTranslucent(this.currentBgTranslucentLevel,!0));this.currentObject=d;return}this.setPropTS(a,b,null)}},"~S,~O,JU.BS");Clazz.overrideMethod(c$,"getPropertyData",function(a,b){if("currentTarget"===a)return null!=this.currentObject&&null!=(b[0]=this.currentObject.target);
if("checkID"===a)for(var c=b[0].toUpperCase(),d=J.util.Txt.isWild(c),e,f=this.objects.values().iterator();f.hasNext()&&((e=f.next())||1);){var g=e.target;if(g.equalsIgnoreCase(c)||d&&J.util.Txt.isMatch(g.toUpperCase(),c,!0,!0))return b[1]=g,!0}return!1},"~S,~A");Clazz.overrideMethod(c$,"getShapeState",function(){return this.viewer.getShapeState(this)});Clazz.defineStatics(c$,"FONTFACE","Serif","FONTSIZE",20,"COLOR",10)});Clazz.declarePackage("J.shape");
Clazz.load(["J.shape.TextShape"],"J.shape.Hover",["JU.ArrayUtil","J.modelset.Text","J.util.C"],function(){c$=Clazz.decorateAsClass(function(){this.hoverText=null;this.atomIndex=-1;this.text=this.xy=null;this.labelFormat="%U";this.specialLabel=this.atomFormats=null;Clazz.instantialize(this,arguments)},J.shape,"Hover",J.shape.TextShape);$_M(c$,"initShape",function(){Clazz.superCall(this,J.shape.Hover,"initShape",[]);this.isHover=!0;var a=this.gdata.getFont3DFSS("SansSerif","Plain",12),b=J.util.C.getColixS("#FFFFC3");
this.currentObject=this.hoverText=J.modelset.Text.newLabel(this.gdata,a,null,4,b,1,0,null);this.hoverText.setAdjustForWindow(!0)});Clazz.overrideMethod(c$,"setProperty",function(a,b,c){if("target"===a)this.atomIndex=null==b?-1:b.intValue();else if("text"===a)this.text=b,null!=this.text&&0==this.text.length&&(this.text=null);else if("specialLabel"===a)this.specialLabel=b;else if("atomLabel"===a){a=b;null!=a&&0==a.length&&(a=null);b=this.viewer.getAtomCount();if(null==this.atomFormats||this.atomFormats.length<
b)this.atomFormats=Array(b);for(b=c.nextSetBit(0);0<=b;b=c.nextSetBit(b+1))this.atomFormats[b]=a}else"xy"===a?this.xy=b:"label"===a?(this.labelFormat=b,null!=this.labelFormat&&0==this.labelFormat.length&&(this.labelFormat=null)):"deleteModelAtoms"===a?(null!=this.atomFormats&&(this.atomFormats=JU.ArrayUtil.deleteElements(this.atomFormats,b[2][1],b[2][2])),this.atomIndex=-1):this.setPropTS(a,b,null)},"~S,~O,JU.BS");Clazz.overrideMethod(c$,"getShapeState",function(){return this.viewer.getShapeState(this)});
Clazz.defineStatics(c$,"FONTFACE","SansSerif","FONTSTYLE","Plain","FONTSIZE",12)});Clazz.declarePackage("J.render");
Clazz.load(null,"J.render.TextRenderer",["java.lang.Float","J.modelset.Text"],function(){c$=Clazz.declareType(J.render,"TextRenderer");c$.render=$_M(c$,"render",function(a,b,c,d,e,f,g,h){if(!(null==a||null==a.image&&null==a.lines)){var k=c.setColix(a.colix);if(k||!(null==a.image&&(0==a.bgcolix||!c.setColix(a.bgcolix)))){a.setPosition(b,c.getRenderWidth(),c.getRenderHeight(),d,e,f,g);if(null==a.image&&0!=a.bgcolix&&(k&&c.setColix(a.bgcolix),J.render.TextRenderer.showBox(c,a.colix,Clazz.floatToInt(a.boxX),
Clazz.floatToInt(a.boxY)+2*a.boxYoff2,a.z+2,a.zSlab,Clazz.floatToInt(a.boxWidth),Clazz.floatToInt(a.boxHeight),a.fontScale,a.isLabelOrHover),!k))return;if(null==a.image)for(b=0;b<a.lines.length;b++)a.setXYA(h,b),c.drawString(a.lines[b],a.font,Clazz.floatToInt(h[0]),Clazz.floatToInt(h[1]),a.z,a.zSlab,a.bgcolix);else c.drawImage(a.image,Clazz.floatToInt(a.boxX),Clazz.floatToInt(a.boxY),a.z,a.zSlab,a.bgcolix,Clazz.floatToInt(a.boxWidth),Clazz.floatToInt(a.boxHeight));J.render.TextRenderer.drawPointer(a,
c)}}},"J.modelset.Text,J.viewer.Viewer,J.api.JmolRendererInterface,~N,~N,~B,~A,~A");c$.drawPointer=$_M(c$,"drawPointer",function(a,b){if(0!=(a.pointer&1)&&b.setColix(0!=(a.pointer&2)&&0!=a.bgcolix?a.bgcolix:a.colix)){var c=a.boxWidth,d=a.boxHeight,e=NaN,c=a.boxX+(a.boxX>a.atomX+c?0:a.boxX+c<a.atomX-c?c:e=c/2),e=!Float.isNaN(e),d=a.boxY+(e&&a.boxY>a.atomY?0:e&&a.boxY+d<a.atomY?d:d/2);b.drawLineXYZ(a.atomX,a.atomY,a.atomZ,Clazz.floatToInt(c),Clazz.floatToInt(d),a.zSlab)}},"J.modelset.Text,J.api.JmolRendererInterface");
c$.renderSimpleLabel=$_M(c$,"renderSimpleLabel",function(a,b,c,d,e,f,g,h,k,j,m,l,n,p,t){var q=b.stringWidth(c)+8;l=m+l+8;var r=Clazz.floatToInt(f[0]),s=Clazz.floatToInt(f[1]);J.modelset.Text.setBoxXY(q,l,k,j,f,t);j=f[0];f=f[1];0!=e&&a.setColix(e)?J.render.TextRenderer.showBox(a,d,Clazz.floatToInt(j),Clazz.floatToInt(f),g,h,Clazz.floatToInt(q),Clazz.floatToInt(l),1,!0):a.setColix(d);a.drawString(c,b,Clazz.floatToInt(j+4),Clazz.floatToInt(f+4+m),g-1,h,e);n&&(a.setColix(p),0<k?a.drawLineXYZ(r,s,h,Clazz.floatToInt(j),
Clazz.floatToInt(f+l/2),h):0>k&&a.drawLineXYZ(r,s,h,Clazz.floatToInt(j+q),Clazz.floatToInt(f+l/2),h))},"J.api.JmolRendererInterface,J.util.JmolFont,~S,~N,~N,~A,~N,~N,~N,~N,~N,~N,~B,~N,~B");c$.showBox=$_M(c$,"showBox",($fz=function(a,b,c,d,e,f,g,h,k,j){a.fillRect(c,d,e,f,g,h);a.setColix(b);j&&(2<=k?a.drawRect(c+3,d+3,e-1,f,g-6,h-6):a.drawRect(c+1,d+1,e-1,f,g-2,h-2))},$fz.isPrivate=!0,$fz),"J.api.JmolRendererInterface,~N,~N,~N,~N,~N,~N,~N,~N,~B")});Clazz.declarePackage("J.render");
Clazz.load(["J.render.FontLineShapeRenderer","JU.P3","$.P3i"],"J.render.LabelsRenderer",["J.modelset.Text","J.render.TextRenderer","J.shape.Labels","J.viewer.JC"],function(){c$=Clazz.decorateAsClass(function(){this.minZ=null;this.sppm=this.descent=this.ascent=0;this.screen=this.xy=null;this.zCutoff=this.fidPrevious=0;this.pTemp=null;this.fid=this.labelColix=this.bgcolix=0;this.atomPt=this.atom=null;this.isExact=!1;this.pointer=this.textAlign=this.offset=0;this.zSlab=-2147483648;this.zBox=0;this.boxXY=
null;this.scalePixelsPerMicron=0;Clazz.instantialize(this,arguments)},J.render,"LabelsRenderer",J.render.FontLineShapeRenderer);Clazz.prepareFields(c$,function(){this.minZ=Clazz.newIntArray(1,0);this.xy=Clazz.newFloatArray(3,0);this.screen=new JU.P3i;this.pTemp=new JU.P3});Clazz.overrideMethod(c$,"render",function(){this.fidPrevious=0;this.zCutoff=this.viewer.getZShadeStart();var a=this.shape,b=a.strings,c=a.bgcolixes;this.isExport&&this.g3d.getBgColixes(c);var c=a.fids,d=a.offsets;if(null==b)return!1;
var e=this.modelSet.atoms,f=this.viewer.getColixBackgroundContrast(),g=this.viewer.getBackgroundArgb();this.sppm=this.viewer.getScalePixelsPerAngstrom(!0);this.scalePixelsPerMicron=this.viewer.getBoolean(603979845)?1E4*this.sppm:0;this.imageFontScaling=this.viewer.getImageFontScaling();var h=-1;this.minZ[0]=2147483647;for(var k=this.g3d.isAntialiased(),j=b.length;0<=--j;)if(this.atomPt=this.atom=e[j],this.atom.isVisible(this.myVisibilityFlag)){var m=b[j];if(!(null==m||0==m.length||null!=a.mads&&0>
a.mads[j])){this.labelColix=a.getColix2(j,this.atom,!1);this.bgcolix=a.getColix2(j,this.atom,!0);0==this.bgcolix&&this.g3d.getColorArgbOrGray(this.labelColix)==g&&(this.labelColix=f);this.fid=null==c||j>=c.length||0==c[j]?a.zeroFontId:c[j];var l=null==d||j>=d.length?0:d[j],n=0!=(l&32),p=0!=(l&16);this.isExact=0!=(l&128);this.offset=l>>8;this.textAlign=J.shape.Labels.getAlignment(l);this.pointer=l&3;this.zSlab=this.atom.screenZ-Clazz.doubleToInt(this.atom.screenDiameter/2)-3;0<this.zCutoff&&this.zSlab>
this.zCutoff||(1>this.zSlab&&(this.zSlab=1),this.zBox=this.zSlab,p?(l=this.atom.getGroup(),n=l.getGroupIndex(),n!=h&&(l.getMinZ(e,this.minZ),h=n),this.zBox=this.minZ[0]):n&&(this.zBox=1),1>this.zBox&&(this.zBox=1),l=a.getLabel(j),this.boxXY=!this.isExport||this.viewer.creatingImage?a.getBox(j):Clazz.newFloatArray(5,0),null==this.boxXY&&a.putBox(j,this.boxXY=Clazz.newFloatArray(5,0)),l=this.renderLabelOrMeasure(l,m),null!=l&&a.putLabel(j,l),k&&(this.boxXY[0]/=2,this.boxXY[1]/=2),this.boxXY[4]=this.zBox)}}return!1});
$_M(c$,"renderLabelOrMeasure",function(a,b){var c=!1;if(null!=a)null==a.font&&a.setFontFromFid(this.fid),a.atomX=this.atomPt.screenX,a.atomY=this.atomPt.screenY,a.atomZ=this.zSlab,null==a.pymolOffset?(a.setXYZs(this.atomPt.screenX,this.atomPt.screenY,this.zBox,this.zSlab),a.setColix(this.labelColix),a.setBgColix(this.bgcolix)):(1==a.pymolOffset[0]?this.pTemp.setT(this.atomPt):this.pTemp.set(0,0,0),this.pTemp.x+=a.pymolOffset[4],this.pTemp.y+=a.pymolOffset[5],this.pTemp.z+=a.pymolOffset[6],this.viewer.transformPtScr(this.pTemp,
this.screen),a.setXYZs(this.screen.x,this.screen.y,this.screen.z,this.zSlab),a.setScalePixelsPerMicron(this.sppm));else{var d=1==this.textAlign||0==this.textAlign;if(this.fid!=this.fidPrevious||0==this.ascent)this.g3d.setFontFid(this.fid),this.fidPrevious=this.fid,this.font3d=this.g3d.getFont3DCurrent(),d&&(this.ascent=this.font3d.getAscent(),this.descent=this.font3d.getDescent());if(d&&1==this.imageFontScaling&&0==this.scalePixelsPerMicron&&0>b.indexOf("|")&&0>b.indexOf("<su")){var d=0!=(this.pointer&
1),e=0!=(this.pointer&2)&&0!=this.bgcolix?this.bgcolix:this.labelColix;this.boxXY[0]=this.atomPt.screenX;this.boxXY[1]=this.atomPt.screenY;J.render.TextRenderer.renderSimpleLabel(this.g3d,this.font3d,b,this.labelColix,this.bgcolix,this.boxXY,this.zBox,this.zSlab,J.viewer.JC.getXOffset(this.offset),J.viewer.JC.getYOffset(this.offset),this.ascent,this.descent,d,e,this.isExact);this.atomPt=null}else a=J.modelset.Text.newLabel(this.g3d.getGData(),this.font3d,b,this.labelColix,this.bgcolix,this.textAlign,
0,null),a.atomX=this.atomPt.screenX,a.atomY=this.atomPt.screenY,a.atomZ=this.zSlab,a.setXYZs(this.atomPt.screenX,this.atomPt.screenY,this.zBox,this.zSlab),c=!0}null!=this.atomPt&&(null==a.pymolOffset&&(a.setOffset(this.offset),0!=this.textAlign&&a.setAlignment(this.textAlign)),a.setPointer(this.pointer),J.render.TextRenderer.render(a,this.viewer,this.g3d,this.scalePixelsPerMicron,this.imageFontScaling,this.isExact,this.boxXY,this.xy));return c?a:null},"J.modelset.Text,~S")});Clazz.declarePackage("J.render");
Clazz.load(["J.render.LabelsRenderer"],"J.render.EchoRenderer",["J.render.TextRenderer","J.util.C"],function(){c$=Clazz.declareType(J.render,"EchoRenderer",J.render.LabelsRenderer);Clazz.overrideMethod(c$,"render",function(){if(this.viewer.isPreviewOnly())return!1;var a=this.shape,b=this.viewer.getBoolean(603979845)?1E4*this.viewer.getScalePixelsPerAngstrom(!0):0;this.imageFontScaling=this.viewer.getImageFontScaling();for(var c=!1,d,a=a.objects.values().iterator();a.hasNext()&&((d=a.next())||1);)if(d.visible&&
!d.hidden&&(!Clazz.instanceOf(d.pointerPt,J.modelset.Atom)||d.pointerPt.isVisible(-1))){if(4==d.valign)this.viewer.transformPtScr(d.xyz,this.pt0i),d.setXYZs(this.pt0i.x,this.pt0i.y,this.pt0i.z,this.pt0i.z);else if(2147483647!=d.movableZPercent){var e=this.viewer.zValueFromPercent(d.movableZPercent);d.setZs(e,e)}null==d.pointerPt?d.pointer=0:(d.pointer=1,this.viewer.transformPtScr(d.pointerPt,this.pt0i),d.atomX=this.pt0i.x,d.atomY=this.pt0i.y,d.atomZ=this.pt0i.z,-2147483648==d.zSlab&&(d.zSlab=1));
J.render.TextRenderer.render(d,this.viewer,this.g3d,b,this.imageFontScaling,!1,null,this.xy);if(J.util.C.isColixTranslucent(d.bgcolix)||J.util.C.isColixTranslucent(d.colix))c=!0}if(!this.isExport&&(b=this.viewer.getFrameTitle(),null!=b&&0<b.length&&this.g3d.setColix(this.viewer.getColixBackgroundContrast()))){if(0<=b.indexOf("%{")||0<=b.indexOf("@{"))b=this.viewer.formatText(b);this.renderFrameTitle(b)}return c});$_M(c$,"renderFrameTitle",($fz=function(a){var b=this.g3d.getFontFidFS("Serif",14*this.imageFontScaling);
this.g3d.setFontFid(b);var b=Clazz.doubleToInt(Math.floor(this.viewer.getScreenHeight()*(this.g3d.isAntialiased()?2:1)-10*this.imageFontScaling)),c=Clazz.doubleToInt(Math.floor(5*this.imageFontScaling));this.g3d.drawStringNoSlab(a,null,c,b,0,0)},$fz.isPrivate=!0,$fz),"~S")});Clazz.declarePackage("J.render");
Clazz.load(["J.render.ShapeRenderer"],"J.render.HoverRenderer",["J.render.TextRenderer"],function(){c$=Clazz.decorateAsClass(function(){this.tempXY=null;Clazz.instantialize(this,arguments)},J.render,"HoverRenderer",J.render.ShapeRenderer);Clazz.prepareFields(c$,function(){this.tempXY=Clazz.newFloatArray(3,0)});Clazz.overrideMethod(c$,"render",function(){if(this.viewer.isNavigating())return!1;var a=this.shape,b=this.g3d.isAntialiased(),c=a.hoverText;if(0<=a.atomIndex){var d=this.modelSet.atoms[a.atomIndex],
a=null!=a.specialLabel?a.specialLabel:null!=a.atomFormats&&null!=a.atomFormats[a.atomIndex]?this.viewer.modelSet.getLabeler().formatLabel(this.viewer,d,a.atomFormats[a.atomIndex]):null!=a.labelFormat?this.viewer.modelSet.getLabeler().formatLabel(this.viewer,d,this.fixLabel(d,a.labelFormat)):null;if(null==a)return!1;c.setText(a);c.setXYZs(d.screenX,d.screenY,1,-2147483648)}else if(null!=a.text)c.setText(a.text),c.setXYZs(a.xy.x,a.xy.y,1,-2147483648);else return!0;J.render.TextRenderer.render(c,this.viewer,
this.g3d,0,b?2:1,!1,null,this.tempXY);return!0});$_M(c$,"fixLabel",function(a,b){return null==b?null:this.viewer.isJmolDataFrameForModel(a.getModelIndex())&&b.equals("%U")?"%W":b},"J.modelset.Atom,~S")});
