dvt.AdfDiagramLink=function(a,b,c){this.Init(a,b,c)};dvt.Obj.createSubclass(dvt.AdfDiagramLink,dvt.BaseDiagramLink,"dvt.AdfDiagramLink");dvt.AdfDiagramLink._DEFAULT_LINK_WIDTH=1;dvt.AdfDiagramLink._DEFAULT_LINK_LENGTH=28;dvt.AdfDiagramLink._START_CONNECTOR=0;dvt.AdfDiagramLink._END_CONNECTOR=1;dvt.AdfDiagramLink._HIT_DETECTION_WIDTH_OFFSET=4;dvt.AdfDiagramLink.COLOR="linkColor";dvt.AdfDiagramLink.SELECTED_COLOR="linkSelectColor";dvt.AdfDiagramLink.HOVER_INNER_COLOR="linkHoverInnerColor";
dvt.AdfDiagramLink.HOVER_OUTER_COLOR="linkHoverOuterColor";dvt.AdfDiagramLink.PROMOTED_COLOR="linkPromotedColor";dvt.AdfDiagramLink.PROMOTED_STYLE="linkPromotedStyle";dvt.AdfDiagramLink.PROMOTED_WIDTH="linkPromotedWidth";dvt.AdfDiagramLink.LABEL_STYLE="linkLabelStyle";
dvt.AdfDiagramLink.prototype.Init=function(a,b,c){dvt.AdfDiagramLink.superclass.Init.call(this,a,b.getId(),c);this._data=b;this._linkDef;this._linkColor;this._linkWidth;this._linkType;this._linkStyle;this._shortDesc;this._endConnectorType;this._startConnectorType;this._label;this._bRendered=!0;this._categories;this._initialPoints;this._deleteEnabled=this._updateEnabled=this._hover=!1;this._dragItems={};this._linkParent;this._bCrossContainerLink=!1;this._maxAlpha=1;this._linkUnderlay;this._savedStroke;
this._hitDetectionUnderlay;this._bFocusEffect=this._bFocused=!1;this._showPopupBehaviors;this._bDirty=this._bPromoted=!1;this.GetDiagram().getEventManager().associate(this,this);this._keyboardNavNode;this._tabStopsConnectorArray=[];this._bFirefox=dvt.Agent.isPlatformGecko();this._bIE=dvt.Agent.isPlatformIE();a=this._diagram.getLinkStyles();this._defaultColor=a[dvt.AdfDiagramLink.COLOR];this._selectColor=a[dvt.AdfDiagramLink.SELECTED_COLOR];this._hoverInnerColor=a[dvt.AdfDiagramLink.HOVER_INNER_COLOR];
this._hoverOuterColor=a[dvt.AdfDiagramLink.HOVER_OUTER_COLOR];this._linkLabelStyles=a[dvt.AdfDiagramLink.LABEL_STYLE];this._promotedColor=a[dvt.AdfDiagramLink.PROMOTED_COLOR];this._promotedStyle=a[dvt.AdfDiagramLink.PROMOTED_STYLE];this._promotedWidth=a[dvt.AdfDiagramLink.PROMOTED_WIDTH]?a[dvt.AdfDiagramLink.PROMOTED_WIDTH]:dvt.AdfDiagramLink._DEFAULT_LINK_WIDTH};
dvt.AdfDiagramLink.prototype.GetDiagram=function(){if(this._diagram)return this._diagram;if(this._cachedDiagram)return this._cachedDiagram;for(var a=this.getParent();a;){if(a instanceof dvt.AdfDiagram)return a;a=a.getParent()}};
dvt.AdfDiagramLink.prototype.getDimensionsWithStroke=function(a){a=a?a.getDestVal(this,this.getPoints):this.getPoints();a=dvt.PathUtils.getDimensions(a);var b=this._hitDetectionUnderlay.getStroke().getWidth();a.x-=b/2;a.y-=b/2;a.h+=b;a.w+=b;this.getStartConnector()&&(a=this.getStartConnector().getDimensions(this).getUnion(a));this.getEndConnector()&&(a=this.getEndConnector().getDimensions(this).getUnion(a));return a};dvt.AdfDiagramLink.prototype.showHoverEffect=function(){this._showFeedback(!0,this._selected)};
dvt.AdfDiagramLink.prototype.hideHoverEffect=function(){this._bFocusEffect||this._selected?this._showFeedback(this._bFocusEffect,this._selected):this._bHighlight&&this._hideFeedback()};dvt.AdfDiagramLink.prototype.showRollOverEffect=function(a){this.GetDiagram().ShowLinkHoverEffect(this,a instanceof dvt.KeyboardEvent)};dvt.AdfDiagramLink.prototype.hideRollOverEffect=function(){this.GetDiagram().HideLinkHoverEffect(this)};
dvt.AdfDiagramLink.prototype.ApplyStrokeToUnderlay=function(a,b){var c=b?this._selectColor:this._hoverOuterColor;if(this._linkUnderlay){var d=this._linkUnderlay.getStroke().clone();d.setColor(c);d.setWidth(2+this.GetAppliedLinkWidth());this.ApplyLinkStyle(d,!0);this._linkUnderlay.setStroke(d,2)}};dvt.AdfDiagramLink.prototype.HandleClick=function(a){this.GetDiagram().HandleLinkClick(this)};
dvt.AdfDiagramLink.prototype._showFeedback=function(a,b){this._bHighlight=!0;this._preserveKeyboardFocusEffect=!1;if(a){this._savedStroke||(this._savedStroke=this.getShape().getStroke());var c=this.getShape().getStroke().clone();c.setColor&&c.setColor(this._hoverInnerColor);this.getShape().setStroke(c);this.getStartConnector()&&this.IsStandardConnector(dvt.AdfDiagramLink._START_CONNECTOR)&&this.ReplaceConnectorColor(this.getStartConnector(),c);this.getEndConnector()&&this.IsStandardConnector(dvt.AdfDiagramLink._END_CONNECTOR)&&
this.ReplaceConnectorColor(this.getEndConnector(),c)}else this._savedStroke&&(this.getShape().setStroke(this._savedStroke),this.getStartConnector()&&this.IsStandardConnector(dvt.AdfDiagramLink._START_CONNECTOR)&&this.ReplaceConnectorColor(this.getStartConnector(),this._savedStroke),this.getEndConnector()&&this.IsStandardConnector(dvt.AdfDiagramLink._END_CONNECTOR)&&this.ReplaceConnectorColor(this.getEndConnector(),this._savedStroke),this._savedStroke=null);this._linkUnderlay||(this._linkUnderlay=
this.CreateFeedbackUnderlay(),this.addChildAt(this._linkUnderlay,0));this.ApplyStrokeToUnderlay(a,b)};
dvt.AdfDiagramLink.prototype._hideFeedback=function(){this._bHighlight=!1;this._savedStroke&&(this.getShape().setStroke(this._savedStroke),this.getStartConnector()&&this.IsStandardConnector(dvt.AdfDiagramLink._START_CONNECTOR)&&this.ReplaceConnectorColor(this.getStartConnector(),this._savedStroke),this.getEndConnector()&&this.IsStandardConnector(dvt.AdfDiagramLink._END_CONNECTOR)&&this.ReplaceConnectorColor(this.getEndConnector(),this._savedStroke),this._savedStroke=null);this._linkUnderlay&&(this.removeChild(this._linkUnderlay),
this._linkUnderlay.destroy&&this._linkUnderlay.destroy(),this._linkUnderlay=null);this._preserveKeyboardFocusEffect||this._updateKeyboardFocusEffect(null)};dvt.AdfDiagramLink.prototype.getDatatip=function(){return this.getShortDesc()};dvt.AdfDiagramLink.prototype.setShortDesc=function(a){this._shortDesc=a};
dvt.AdfDiagramLink.prototype.getShortDesc=function(){if(this._bPromoted){var a=null;1<this._promotionCount?a=this._diagram.getResourcesMap().promotedLinksTip:this._shortDesc||(a=this._diagram.getResourcesMap().promotedLinkTip);if(a)return dvt.Bundle.format(a,[this._promotionCount])}return this._shortDesc};dvt.AdfDiagramLink.prototype.getLayoutAttributes=function(a){var b=this.getData().getLayoutAttributes();return b&&a?b[a]:{}};
dvt.AdfDiagramLink.prototype.setEndConnectorType=function(a){this._endConnectorType=a};dvt.AdfDiagramLink.prototype.getEndConnectorType=function(){return this._endConnectorType};dvt.AdfDiagramLink.prototype.setStartConnectorType=function(a){this._startConnectorType=a};dvt.AdfDiagramLink.prototype.getStartConnectorType=function(){return this._startConnectorType};dvt.AdfDiagramLink.prototype.getData=function(){return this._data};
dvt.AdfDiagramLink.prototype.setLinkDef=function(a){if(this._linkDef=a)a.stamp(this.getData().getElAttributes(),this),this._refreshCursor();this._bDirty=!0};dvt.AdfDiagramLink.prototype.getLinkDef=function(){return this._linkDef};dvt.AdfDiagramLink.prototype.setLinkColor=function(a){this._linkColor=a};dvt.AdfDiagramLink.prototype.getLinkColor=function(){return this._linkColor?this._linkColor:this._defaultColor};dvt.AdfDiagramLink.prototype.setLinkWidth=function(a){this._linkWidth=a};
dvt.AdfDiagramLink.prototype.getLinkWidth=function(){return this._linkWidth?this._linkWidth:dvt.AdfDiagramLink._DEFAULT_LINK_WIDTH};dvt.AdfDiagramLink.prototype.setLinkLength=function(a){this._linkLength=a};dvt.AdfDiagramLink.prototype.getLinkLength=function(){return this._linkLength?this._linkLength:dvt.AdfDiagramLink._DEFAULT_LINK_LENGTH};dvt.AdfDiagramLink.prototype.setLinkType=function(a){this._linkType=a};
dvt.AdfDiagramLink.prototype.getLinkType=function(){return this._linkType?this._linkType:this.GetDefaultLinkType()};dvt.AdfDiagramLink.prototype.GetDefaultLinkType=function(){return dvt.AdfDiagramLinkDef.LINK_TYPE_DIRECT};dvt.AdfDiagramLink.prototype.setLinkStyle=function(a){this._linkStyle=a};dvt.AdfDiagramLink.prototype.getLinkStyle=function(){return this._linkStyle?this._linkStyle:dvt.AdfDiagramLinkDef.LINK_STYLE_SOLID};dvt.AdfDiagramLink.prototype.setLabel=function(a){this._label=a};
dvt.AdfDiagramLink.prototype.getLabel=function(){return this._label};dvt.AdfDiagramLink.prototype.setRendered=function(a){this._bRendered=a};dvt.AdfDiagramLink.prototype.isRendered=function(){return this._bRendered};dvt.AdfDiagramLink.prototype.setUpdateEnabled=function(a){this._updateEnabled=a};dvt.AdfDiagramLink.prototype.isUpdateEnabled=function(){return this._updateEnabled};dvt.AdfDiagramLink.prototype.setDeleteEnabled=function(a){this._deleteEnabled=a};
dvt.AdfDiagramLink.prototype.isDeleteEnabled=function(){return this._deleteEnabled};
dvt.AdfDiagramLink.prototype.DestroyContent=function(){if(this.getEndConnector()){var a=this.getEndConnector().getParent();a&&a.removeChild(this.getEndConnector());this.getEndConnector().destroy&&this.getEndConnector().destroy();this.setEndConnector(null)}this.getStartConnector()&&((a=this.getStartConnector().getParent())&&a.removeChild(this.getStartConnector()),this.getStartConnector().destroy&&this.getStartConnector().destroy(),this.setStartConnector(null));this.getShape()&&(this.removeChild(this.getShape()),
this.getShape().destroy&&this.getShape().destroy(),this.setShape(null));this._linkUnderlay&&(this.removeChild(this._linkUnderlay),this._linkUnderlay.destroy&&this._linkUnderlay.destroy(),this._linkUnderlay=null);this._hitDetectionUnderlay&&(this.removeChild(this._hitDetectionUnderlay),this._hitDetectionUnderlay.destroy&&this._hitDetectionUnderlay.destroy(),this._hitDetectionUnderlay=null);this._hover=!1;this._savedStroke=null};
dvt.AdfDiagramLink.prototype.renderLink=function(){if(!this.getShape()||this._bDirty){this.DestroyContent();var a=null,b=null,c=null,d=null,e=null;this._labelObj&&(a=this.getLabelBounds(),b=this.getLabelPosition(),c=this.getLabelRotationAngle(),d=this.getLabelRotationPoint(),e=this._labelObj.getAlpha(),this.removeChild(this._labelObj),this._labelObj.destroy&&this._labelObj.destroy(),this._labelObj=null);var f=this._pathCmds;f||(f=["M",0,0,"L",0,0]);var g=this.getData().getId();this.setShape(new dvt.Path(this.getCtx(),
f,g));this.getShape().setFill(null);this.addChildAt(this.getShape(),0);f=this.GetAppliedLinkColor();g=this.GetAppliedLinkWidth();f=new dvt.SolidStroke(f,1,g);dvt.Agent.isTouchDevice()&&dvt.Agent.isBrowserSafari()&&1==dvt.Agent.getDevicePixelRatio()&&f.setFixedWidth(!0);this.ApplyLinkStyle(f);this.getShape().setStroke(f);f=this.getEndConnectorType();g=this.getConnectorTemplate(dvt.DiagramLinkConnectorUtils.END_CONNECTOR);this.setEndConnector(this.CreateConnector(this._points,f,1,g));f=this.getStartConnectorType();
g=this.getConnectorTemplate(dvt.DiagramLinkConnectorUtils.START_CONNECTOR);this.setStartConnector(this.CreateConnector(this._points,f,0,g));this._refreshSelectionEffect();!this._bPromoted&&this.HasLabel()&&(this._labelObj=this.CreateLabel(),this.addChild(this._labelObj),a&&this.setLabelBounds(a),b&&this.setLabelPosition(b),null!=c&&this.setLabelRotationAngle(c),d&&this.setLabelRotationPoint(d),null!=e&&this._labelObj.setAlpha(e));this._hitDetectionUnderlay||(this._hitDetectionUnderlay=this.CreateUnderlay("#000000",
0,dvt.AdfDiagramLink._HIT_DETECTION_WIDTH_OFFSET),this.addChildAt(this._hitDetectionUnderlay,0));this.addAccessibilityAttributes();this._bDirty=!1}};dvt.AdfDiagramLink.prototype.GetAppliedLinkColor=function(){return this._bPromoted?this._promotedColor:this.getLinkColor()};dvt.AdfDiagramLink.prototype.GetAppliedLinkStyle=function(){return this._bPromoted?this._promotedStyle:this.getLinkStyle()};dvt.AdfDiagramLink.prototype.GetAppliedLinkWidth=function(){return this._bPromoted?this._promotedWidth:this.getLinkWidth()};
dvt.AdfDiagramLink.prototype.getStartConnectorOffset=function(){if(this.getStartConnector()){var a,b=this.getConnectorTemplate(dvt.DiagramLinkConnectorUtils.START_CONNECTOR);b||(a=this.getShape().getStroke().clone(),a.setType(dvt.Stroke.SOLID));return dvt.DiagramLinkConnectorUtils.GetConnectorOffset(this.getStartConnector(),this.getStartConnectorType(),b,a,this)}return 0};
dvt.AdfDiagramLink.prototype.getEndConnectorOffset=function(){if(this.getEndConnector()){var a,b=this.getConnectorTemplate(dvt.DiagramLinkConnectorUtils.END_CONNECTOR);b||(a=this.getShape().getStroke().clone(),a.setType(dvt.Stroke.SOLID));return dvt.DiagramLinkConnectorUtils.GetConnectorOffset(this.getEndConnector(),this.getEndConnectorType(),b,a,this)}return 0};
dvt.AdfDiagramLink.prototype.setSelected=function(a){dvt.AdfDiagramLink.superclass.setSelected.call(this,a);this._refreshSelectionEffect();this.UpdateAccessibilityAttributes();!this.GetDiagram().isReadOnly()&&this.isUpdateEnabled()&&(a?(this.hideConnectors(),this.showUpdateHandles()):(this.hideUpdateHandles(),this.showConnectors()))};
dvt.AdfDiagramLink.prototype._refreshSelectionEffect=function(){var a=this.isSelectable()&&this._hover;a||this._bFocusEffect||this._selected?this._showFeedback(a||this._bFocusEffect,this._selected):this._bHighlight&&this._hideFeedback()};
dvt.AdfDiagramLink.prototype.getCategories=function(){if(!this._categories){this._categories=[];var a=this.getData().getStartId(),b=this.getData().getEndId(),a=this.GetDiagram().getNodeById(a),c=this.GetDiagram().getNodeById(b),b=a.getCategories(),a=c.getCategories();if(b&&a)for(c=0;c<b.length;c++)0<=dvt.ArrayUtils.getIndex(a,b[c])&&this._categories.push(b[c])}return this._categories};dvt.AdfDiagramLink.prototype.getDisplayables=function(){return[this]};
dvt.AdfDiagramLink.prototype.InsertLinkIntoParent=function(a){a&&(this._bCrossContainerLink?a.addChild(this):a.addChildAt(this,0))};dvt.AdfDiagramLink.prototype.GetParentContainer=function(){var a=null,b=this.GetDiagram();b&&(a=this._linkParent,a||(a=b._linksPane));return a};
dvt.AdfDiagramLink.prototype.setVisible=function(a){this._bVisible!=a&&this.GetDiagram().setAutomationState(this.getData().getId(),"visible",this._bVisible);dvt.AdfDiagramLink.superclass.setVisible.call(this,a);var b=this.GetDiagram();if(b){var c=this.GetParentContainer(),d=c.contains(this);a&&!d?(this.InsertLinkIntoParent(c),this._cachedDiagram=null):!a&&d&&(c.removeChild(this),this._cachedDiagram=b)}};
dvt.AdfDiagramLink.prototype.CreateLabel=function(){var a=null,b=this.GetLabelTemplate();b?(a=this.GetDiagram().createAfContext(),a.setELContext(this.getData().getElAttributes()),a=dvt.AfComponentFactory.parseAndLayout(a,b,this)):this._label&&(a=new dvt.OutputText(this.getCtx(),this._label,0,0),this._linkLabelStyles&&a.setCSSStyle(this._linkLabelStyles));return a};dvt.AdfDiagramLink.prototype.getLabelBounds=function(){var a=null;this._labelObj&&(a=this._labelObj.getDimensions());return a};
dvt.AdfDiagramLink.prototype.getConnectorTemplate=function(a){var b=this.getLinkDef();return b?b.getConnectorTemplate(a):null};dvt.AdfDiagramLink.prototype.GetLabelTemplate=function(){var a=this.getLinkDef();return a?a.getLabelTemplate():null};dvt.AdfDiagramLink.prototype.HasLabel=function(){return this._label||this.GetLabelTemplate()};
dvt.AdfDiagramLink.prototype.getAfComponent=function(a){var b,c=dvt.AfComponentFactory.getAfComponent(this.getEndConnector());c&&c.getId()==a?b=c:(c=dvt.AfComponentFactory.getAfComponent(this.getStartConnector()))&&c.getId()==a?b=c:this.GetLabelTemplate()&&this._labelObj&&(c=dvt.AfComponentFactory.getAfComponent(this._labelObj))&&c.getId()==a&&(b=c);return b};dvt.AdfDiagramLink.prototype.setPromoted=function(a){this._bPromoted!=a&&(this._bDirty=!0);this._bPromoted=a};
dvt.AdfDiagramLink.prototype.setPromotionCount=function(a){this._promotionCount=a};dvt.AdfDiagramLink.prototype.getPromotionCount=function(){return this._promotionCount};
dvt.AdfDiagramLink.prototype.showUpdateHandles=function(){if(!this._startHandle){var a=new DvtAdfDiagramLinkEndpoint(this.getCtx(),this,DvtAdfDiagramLinkEndpoint.START_TYPE,this.getLinkStart(),this.getId(),this._diagram.getEditorStyles());this._startHandle=a;this.addChild(a)}this._endHandle||(this._endHandle=a=new DvtAdfDiagramLinkEndpoint(this.getCtx(),this,DvtAdfDiagramLinkEndpoint.END_TYPE,this.getLinkEnd(),this.getId(),this._diagram.getEditorStyles()),this.addChild(a));this.GetDiagram().moveToDiagramFront(this)};
dvt.AdfDiagramLink.prototype.hideUpdateHandles=function(){this._startHandle&&this.removeChild(this._startHandle);this._endHandle&&this.removeChild(this._endHandle);this._endHandle=this._startHandle=null;this.GetDiagram().moveToLinks(this)};
dvt.AdfDiagramLink.prototype.hideConnectors=function(){this.getStartConnector()&&(this.getShape().removeChild(this.getStartConnector()),this._linkUnderlay&&this._linkUnderlay.hideUnderlayStart());this.getEndConnector()&&(this.getShape().removeChild(this.getEndConnector()),this._linkUnderlay&&this._linkUnderlay.hideUnderlayEnd())};
dvt.AdfDiagramLink.prototype.showConnectors=function(){this.getStartConnector()&&(this.getShape().addChild(this.getStartConnector()),this._linkUnderlay&&this._linkUnderlay.showUnderlayStart());this.getEndConnector()&&(this.getShape().addChild(this.getEndConnector()),this._linkUnderlay&&this._linkUnderlay.showUnderlayEnd())};dvt.AdfDiagramLink.prototype.startLinkChange=function(a,b){this._initialPoints=this.getPoints();this._dragItems[a]=!0;this.setMouseEnabled(!1)};
dvt.AdfDiagramLink.prototype.updateLinkChange=function(a,b){var c,d;a==DvtAdfDiagramLinkEndpoint.START_TYPE?(c=b,d=this.getLinkEnd()):(c=this.getLinkStart(),d=b);this.setPoints([c.x,c.y,d.x,d.y]);this.renderLink()};dvt.AdfDiagramLink.prototype.endLinkChange=function(a){this._dragItems[a]=!1};dvt.AdfDiagramLink.prototype.endLinkChangeNewNode=function(a,b){this.endLinkChange(a);this.updateLinkChange(a,b);this.setMouseEnabled(!0)};
dvt.AdfDiagramLink.prototype.endLinkChangeRestore=function(a){this.endLinkChange(a);var b=!1;for(a in this._dragItems)this._dragItems[a]&&(b=!0);b||(this.restoreLinkPosition(),this._initialPoints=null);this.setMouseEnabled(!0)};dvt.AdfDiagramLink.prototype.restoreLinkPosition=function(){this.setPoints(this._initialPoints);this.renderLink()};
dvt.AdfDiagramLink.prototype.GetRelativeLabelBounds=function(a,b,c,d){var e=dvt.BaseDiagramLink.CalcLabelMatrix(a,b,c,d);a=e.transformPoint(new dvt.Point(b.x,b.y));c=e.transformPoint(new dvt.Point(b.x+b.w,b.y));d=e.transformPoint(new dvt.Point(b.x,b.y+b.h));b=e.transformPoint(new dvt.Point(b.x+b.w,b.y+b.h));var e=Math.min(Math.min(a.x,c.x),Math.min(d.x,b.x)),f=Math.min(Math.min(a.y,c.y),Math.min(d.y,b.y));return new dvt.Rectangle(e,f,Math.max(Math.max(a.x,c.x),Math.max(d.x,b.x))-e,Math.max(Math.max(a.y,
c.y),Math.max(d.y,b.y))-f)};dvt.AdfDiagramLink.prototype.SetMaxAlpha=function(a){this._maxAlpha=a};dvt.AdfDiagramLink.prototype.GetMaxAlpha=function(){return this._maxAlpha};
dvt.AdfDiagramLink.prototype.getNextNavigable=function(a){var b=[];if(a.type==dvt.MouseEvent.CLICK||a.keyCode==dvt.KeyboardEvent.SPACE&&a.ctrlKey)return this;if(a.keyCode==dvt.KeyboardEvent.UP_ARROW||a.keyCode==dvt.KeyboardEvent.DOWN_ARROW){this._updateKeyboardFocusEffect(null);(b=this.getKeyboardFocusNode())||(b=this._diagram.getNodeById(this._diagram.getLinkStartId(this)));var c=this,d=this._diagram.getNavigableLinksForNodeId(b.getData().getId()),e=this._diagram.getEventManager().getKeyboardHandler();
e&&e.getNextNavigableLink&&(c=e.getNextNavigableLink(b,this,a,d));c.setKeyboardFocusNode(b);return c}if(a.keyCode==dvt.KeyboardEvent.RIGHT_ARROW||a.keyCode==dvt.KeyboardEvent.LEFT_ARROW){if(b=this._findConnectorByDirection(a.keyCode))return this._updateKeyboardFocusEffect(b),this._preserveKeyboardFocusEffect=!0,this;this._updateKeyboardFocusEffect(null);a=this._movingToStart(a.keyCode)?this._diagram.getLinkStartId(this):this._diagram.getLinkEndId(this);return this._diagram.getNodeById(a)}b=this._diagram.getSortedVisibleNodesByGroupDepth()[0];
return dvt.KeyboardHandler.getNextAdjacentNavigable(this,a,b)};dvt.AdfDiagramLink.prototype.showKeyboardFocusEffect=function(){this.showHoverEffect();this._bFocusEffect=!0;this.setFocused(!0)};dvt.AdfDiagramLink.prototype.hideKeyboardFocusEffect=function(){this._bFocusEffect=!1;this._hover||this.hideHoverEffect();this.setFocused(!1)};dvt.AdfDiagramLink.prototype.setFocused=function(a){this._bFocused=a};dvt.AdfDiagramLink.prototype.isFocused=function(){return this._bFocused};
dvt.AdfDiagramLink.prototype.isShowingKeyboardFocusEffect=function(){return this._bFocusEffect};dvt.AdfDiagramLink.prototype.eventContextCallback=function(a){a&&(a[dvt.BaseComponentEvent.CLIENT_ROW_KEY]=this.getData().getId());this.GetDiagram().HideNodeTransientToolbar()};
dvt.AdfDiagramLink.prototype.getShowPopupBehaviors=function(){if(!this._showPopupBehaviors&&this._linkDef&&this._linkDef.getShowPopupBehaviors()){var a=this._linkDef.getShowPopupBehaviors(),b=this.GetDiagram().createAfContext();b.setELContext(this.getData().getElAttributes());this._showPopupBehaviors=[];for(var c=0;c<a.length;c++)this._showPopupBehaviors[c]=dvt.AfComponentFactory.parseAndStamp(b,a[c],null)}return this._showPopupBehaviors};
dvt.AdfDiagramLink.prototype.getAriaLabel=function(){return dvt.Displayable.generateAriaLabel(this.getShortDesc(),this.getAccessibilityStates())};
dvt.AdfDiagramLink.prototype.getAccessibilityStates=function(){var a=[];this.isSelectable()&&a.push(this.isSelected()?dvt.Bundle.getTranslatedString(dvt.Bundle.UTIL_PREFIX,"STATE_SELECTED"):dvt.Bundle.getTranslatedString(dvt.Bundle.UTIL_PREFIX,"STATE_UNSELECTED"));this.isPromoted()&&a.push(dvt.Bundle.getTranslatedString(dvt.Bundle.ADF_DIAGRAM_PREFIX,"PROMOTED_LINK_ARIA_DESC"));return a};
dvt.AdfDiagramLink.prototype.UpdateAccessibilityAttributes=function(){if(!dvt.Agent.deferAriaCreation()){var a=this.getAriaLabel();a&&this.setAriaProperty("label",a)}};dvt.AdfDiagramLink.prototype.addAccessibilityAttributes=function(){var a=this.getAriaLabel();a&&(this.setAriaRole("img"),this.setAriaProperty("label",a))};
dvt.AdfDiagramLink.prototype.CopyState=function(a){this._categories=dvt.ArrayUtils.copy(a._categories);this._selected=a._selected;this._hover=a._hover;this._bFocused=a._bFocused;this._bFocusEffect=a._bFocusEffect;this._bVisible=a._bVisible;this._arPoints=dvt.ArrayUtils.copy(a._arPoints);this._points=dvt.ArrayUtils.copy(a._points);this._pathCmds=dvt.ArrayUtils.copy(a._pathCmds)};dvt.AdfDiagramLink.prototype.destroy=function(){this.DestroyContent();dvt.AdfDiagramLink.superclass.destroy.call(this)};
dvt.AdfDiagramLink.prototype.CreateCustomAnimPlayable=function(){return new dvt.CustomAnimation(this.getCtx(),null,this.GetDiagram().getAnimationDuration())};
dvt.AdfDiagramLink.prototype.AnimateUpdate=function(a,b){var c=null,d=b.getVisible(),e=b.getPoints(),f=this.getVisible();d==f&&e?(e=b.getPoints(),d=this.getPoints(),dvt.ArrayUtils.equals(e,d)||(c||(c=this.CreateCustomAnimPlayable()),this.setPoints(e),e=dvt.Animator.TYPE_POLYLINE,0<d.length&&isNaN(d[0])&&(e=dvt.Animator.TYPE_PATH),c.getAnimator().addProp(e,this,this.getPoints,this.setPoints,d)),b._labelObj&&this._labelObj&&(e=b._labelObj.getMatrix(),d=this._labelObj.getMatrix(),e.equals(d)||(c||(c=
this.CreateCustomAnimPlayable()),this._labelObj.setMatrix(e),c.getAnimator().addProp(dvt.Animator.TYPE_MATRIX,this._labelObj,this._labelObj.getMatrix,this._labelObj.setMatrix,d))),b.getShape()&&this.getShape()&&(e=b.getShape().getStroke(),d=this.getShape().getStroke(),e&&d&&e instanceof dvt.SolidStroke&&d instanceof dvt.SolidStroke&&(e.getColor()!=d.getColor()||e.getWidth()!=d.getWidth())&&(c||(c=this.CreateCustomAnimPlayable()),this.getShape().setStroke(e),c.getAnimator().addProp(dvt.Animator.TYPE_STROKE,
this.getShape(),this.getShape().getStroke,this.getShape().setStroke,d))),c&&a.add(c,DvtAdfDiagramDataAnimationHandler.PHASE_UPDATE)):(c||(c=this.CreateCustomAnimPlayable()),d&&e?(e=this.GetParentContainer(),b.InsertLinkIntoParent(e),c.getAnimator().addProp(dvt.Animator.TYPE_NUMBER,b,b.getAlpha,b.setAlpha,0),dvt.Playable.appendOnEnd(c,function(){b.getParent().removeChild(b);b.destroy()}),a.add(c,DvtAdfDiagramDataAnimationHandler.PHASE_DELETE)):f&&(this.setAlpha(0),c.getAnimator().addProp(dvt.Animator.TYPE_NUMBER,
this,this.getAlpha,this.setAlpha,this.GetMaxAlpha()),a.add(c,DvtAdfDiagramDataAnimationHandler.PHASE_INSERT)))};dvt.AdfDiagramLink.prototype.AnimateInsert=function(a){var b=!0,c=this.getData().getGroupId();c&&(this.GetDiagram()._oldNodes[c]||(b=!1));b&&(b=new dvt.CustomAnimation(this.getCtx(),this.GetDiagram().getAnimationDuration()),c=b.getAnimator(),this.setAlpha(0),c.addProp(dvt.Animator.TYPE_NUMBER,this,this.getAlpha,this.setAlpha,this._maxAlpha),a.add(b,DvtAdfDiagramDataAnimationHandler.PHASE_INSERT))};
dvt.AdfDiagramLink.prototype.AnimateDelete=function(a,b){var c=!0,d=this.getData().getGroupId();d?(d=b.getNodeById(d))&&d.GetChildNodePane()?this.InsertLinkIntoParent(d.GetChildNodePane()):c=!1:this.InsertLinkIntoParent(b._linksPane);if(c){c=new dvt.CustomAnimation(this.getCtx(),b.getAnimationDuration());c.getAnimator().addProp(dvt.Animator.TYPE_NUMBER,this,this.getAlpha,this.setAlpha,0);var e=this;dvt.Playable.appendOnEnd(c,function(){e.getParent().removeChild(e);e.destroy()});a.add(c,DvtAdfDiagramDataAnimationHandler.PHASE_DELETE)}};
dvt.AdfDiagramLink.prototype.setKeyboardFocusConnector=function(a){this._keyboardNavConnector=a};dvt.AdfDiagramLink.prototype.getKeyboardFocusConnector=function(){return this._keyboardNavConnector};dvt.AdfDiagramLink.prototype._updateKeyboardFocusEffect=function(a){var b=this.getKeyboardFocusConnector();b&&b.hideKeyboardFocusEffect&&b.hideKeyboardFocusEffect();a&&a.showKeyboardFocusEffect&&a.showKeyboardFocusEffect();this.setKeyboardFocusConnector(a)};
dvt.AdfDiagramLink.prototype._movingToStart=function(a){var b=this.getLinkStart(),c=this.getLinkEnd(),b=b.x<c.x?!0:!1;return a==dvt.KeyboardEvent.RIGHT_ARROW&&b||a==dvt.KeyboardEvent.LEFT_ARROW&&!b?!1:!0};dvt.AdfDiagramLink.prototype._findConnectorByDirection=function(a){var b=null,b=this._movingToStart(a)?this.getStartConnector():this.getEndConnector();a=this.findFocusableObject(b);this.getKeyboardFocusConnector()==a&&(a=null);return a};
dvt.AdfDiagramLink.prototype.HandleKeyboardEvent=function(a){if(a.keyCode==dvt.KeyboardEvent.ENTER){var b=this.GetDiagram().getEventManager(),c=this.getShape(),d=c.localToStage(this.CalPointForMouseEvent());a=dvt.DomEventFactory.generateMouseEventFromKeyboardEvent(a,this.getCtx(),dvt.MouseEvent.CLICK,this.getCtx().getStage(),d.x,d.y);a.target=c;b.PreOnClick(a)}};
dvt.AdfDiagramLink.prototype.CalPointForMouseEvent=function(){var a=this._points,b=0,c=0;4<a.length?(c=a.length/2,0==c%2?(b=a[c],c=a[c+1]):(b=a[c-1],c=a[c])):4==a.length&&(b=(a[0]+a[2])/2,c=(a[1]+a[3])/2);return new dvt.Point(b,c)};dvt.AdfDiagramLink.prototype.IsStandardConnector=function(a){return(0==a?this.getStartConnectorType():this.getEndConnectorType())?!0:!1};
dvt.AdfDiagramLink.prototype.findFocusableObject=function(a){for(var b=0;b<this._tabStopsConnectorArray.length;b++){var c=this._tabStopsConnectorArray[b];if(c instanceof dvt.AfComponent&&c.getDisplayObj()==a)return c}return null};dvt.AdfDiagramLink.prototype.getTabStopsArray=function(){this._tabStopsConnectorArray||(this._tabStopsConnectorArray=[]);return this._tabStopsConnectorArray};dvt.AdfDiagramLink.prototype.getCurrentTabStop=function(){return this.getKeyboardFocusConnector()};
dvt.AdfDiagramLink.prototype.resetTabStops=function(){this.setKeyboardFocusConnector(null)};dvt.AdfDiagramLink.prototype._refreshCursor=function(){var a=dvt.SelectionEffectUtils.getSelectingCursor();if(this.isSelectable())this.setCursor(a);else{var b=this.getShowPopupBehaviors();if(dvt.ArrayUtils.isArray(b))for(var c=0;c<b.length;c++)if(b[c]&&"click"==b[c].getTriggerType()){this.setCursor(a);return}this.setCursor(null)}};
dvt.AdfDiagramLink.prototype.getAutomationState=function(a){var b=this.GetDiagram().getAutomationState(this.getData().getId(),a);return null==b&&"visible"==a?this.getVisible():b};dvt.AdfDiagramLink.prototype.getGroupId=function(){return this.getData().getGroupId()};