Skip to content

Commit

Permalink
Merge branch 'develop' into bug/ACET-639
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrwins committed Aug 10, 2023
2 parents d6d6edd + 94ed169 commit dc90abe
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2506,9 +2506,9 @@ Sidebar.prototype.createItem=function(a,b,d,c,f,e,h,l,k,m,g,n,p,r){l=null!=l?l:!
this.editorUi.editor.graph.defaultEdgeStyle,!0,!0);null!=n?(q.style.backgroundImage="url("+n+")",q.style.backgroundRepeat="no-repeat",q.style.backgroundPosition="center",q.style.backgroundSize="24px 24px"):this.createThumb(v,m,g,q,b,d,c,f,e);var u=new mxRectangle(0,0,f,e);1<a.length||a[0].vertex?(c=this.createDragSource(q,this.createDropHandler(a,!0,h,u,p,r),this.createDragPreview(f,e),a,u,p),this.addClickHandler(q,c,a,k,p),c.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})):
null!=a[0]&&a[0].edge&&(c=this.createDragSource(q,this.createDropHandler(a,!1,h,u,p,r),this.createDragPreview(f,e),a,u,p),this.addClickHandler(q,c,a,k));!mxClient.IS_IOS&&l&&mxEvent.addGestureListeners(q,null,mxUtils.bind(this,function(c){mxEvent.isMouseEvent(c)&&this.showTooltip(q,a,u.width,u.height,b,d)}));return q};
Sidebar.prototype.createDropHandler=function(a,b,d,c,f,e){d=null!=d?d:!0;return mxUtils.bind(this,function(h,l,k,m,g,n){for(n=n?null:mxEvent.isTouchEvent(l)||mxEvent.isPenEvent(l)?document.elementFromPoint(mxEvent.getClientX(l),mxEvent.getClientY(l)):mxEvent.getSource(l);null!=n&&n!=this.container;)n=n.parentNode;if(null==n&&h.isEnabled()){a=h.getImportableCells(a);if(0<a.length){h.stopEditing();n=null==k||mxEvent.isAltDown(l)?!1:h.isValidDropTarget(k,a,l);var p=null;null==k||n||(k=null);if(!h.isCellLocked(k||
h.getDefaultParent())){h.model.beginUpdate();try{m=Math.round(m);g=Math.round(g);if(b&&h.isSplitTarget(k,a,l)){var r=h.view.scale,q=h.view.translate,v=(m+q.x)*r,u=(g+q.y)*r,w=h.cloneCells(a);h.splitEdge(k,w,null,m-c.width/2,g-c.height/2,v,u);p=w}else if(0<a.length&&(console.log("importing cells?"),p=h.importCells(a,m,g,k),h.model.isVertex(e)&&1==p.length&&h.model.isVertex(p[0]))){var x=h.insertEdge(h.model.getParent(e),null,"",e,p[0],h.createCurrentEdgeStyle());h.applyNewEdgeStyle(e,[x]);p.push(x);
h.connectionHandler.insertBeforeSource&&h.insertEdgeBeforeCell(x,e)}if(null!=h.layoutManager){var z=h.layoutManager.getLayout(k);if(null!=z)for(var r=h.view.scale,q=h.view.translate,v=(m+q.x)*r,u=(g+q.y)*r,y=0;y<p.length;y++)z.moveCell(p[y],v,u)}!d||null!=l&&mxEvent.isShiftDown(l)||h.fireEvent(new mxEventObject("cellsInserted","cells",p));for(y=0;y<p.length;y++)h.model.isVertex(p[y])&&h.isAutoSizeCell(p[y])&&h.updateCellSize(p[y])}catch(H){this.editorUi.handleError(H)}finally{h.model.endUpdate()}null!=
p&&0<p.length&&(h.scrollCellToVisible(p[0]),h.setSelectionCells(p));(f||h.editAfterInsert&&null!=l&&mxEvent.isMouseEvent(l)&&null!=p&&1==p.length)&&window.setTimeout(function(){h.startEditing(p[0])},0)}}mxEvent.consume(l)}})};Sidebar.prototype.createDragPreview=function(a,b){var d=document.createElement("div");d.className="geDragPreview";d.style.width=a+"px";d.style.height=b+"px";return d};
h.getDefaultParent())){h.model.beginUpdate();try{m=Math.round(m);g=Math.round(g);if(b&&h.isSplitTarget(k,a,l)){var r=h.view.scale,q=h.view.translate,v=(m+q.x)*r,u=(g+q.y)*r,w=h.cloneCells(a);h.splitEdge(k,w,null,m-c.width/2,g-c.height/2,v,u);p=w}else if(0<a.length&&(p=h.importCells(a,m,g,k),h.model.isVertex(e)&&1==p.length&&h.model.isVertex(p[0]))){var x=h.insertEdge(h.model.getParent(e),null,"",e,p[0],h.createCurrentEdgeStyle());h.applyNewEdgeStyle(e,[x]);p.push(x);h.connectionHandler.insertBeforeSource&&
h.insertEdgeBeforeCell(x,e)}if(null!=h.layoutManager){var z=h.layoutManager.getLayout(k);if(null!=z)for(var r=h.view.scale,q=h.view.translate,v=(m+q.x)*r,u=(g+q.y)*r,y=0;y<p.length;y++)z.moveCell(p[y],v,u)}!d||null!=l&&mxEvent.isShiftDown(l)||h.fireEvent(new mxEventObject("cellsInserted","cells",p));for(y=0;y<p.length;y++)h.model.isVertex(p[y])&&h.isAutoSizeCell(p[y])&&h.updateCellSize(p[y])}catch(H){this.editorUi.handleError(H)}finally{h.model.endUpdate()}null!=p&&0<p.length&&(h.scrollCellToVisible(p[0]),
h.setSelectionCells(p));(f||h.editAfterInsert&&null!=l&&mxEvent.isMouseEvent(l)&&null!=p&&1==p.length)&&window.setTimeout(function(){h.startEditing(p[0])},0)}}mxEvent.consume(l)}})};Sidebar.prototype.createDragPreview=function(a,b){var d=document.createElement("div");d.className="geDragPreview";d.style.width=a+"px";d.style.height=b+"px";return d};
Sidebar.prototype.dropAndConnect=function(a,b,d,c,f,e,h){var l=this.editorUi.editor.graph,k=l.model.isEdge(a)||null!=e?e:h,k=this.getDropAndConnectGeometry(a,b[k],d,b),m=[];if(null!=k){var g=null;l.model.beginUpdate();try{var n=l.getCellGeometry(a),p=l.getCellGeometry(b[c]),r=l.model.getParent(a),q=!0;if(null!=l.layoutManager){var v=l.layoutManager.getLayout(r);null!=v&&v.constructor==mxStackLayout&&(q=!1)}var m=l.model.isEdge(a)?null:l.view.getState(r),u=v=0;if(null!=m)var w=m.origin,v=w.x,u=w.y;
var x=!l.isTableRow(a)&&!l.isTableCell(a)&&(l.model.isEdge(a)||null!=n&&!n.relative&&q),z=l.getCellAt((k.x+v+l.view.translate.x)*l.view.scale,(k.y+u+l.view.translate.y)*l.view.scale,null,null,null,function(a,b,c){return!l.isContainer(a.cell)});if(null!=z&&z!=r)m=l.view.getState(z),null!=m&&(w=m.origin,r=z,x=!0,l.model.isEdge(a)||(k.x-=w.x-v,k.y-=w.y-u));else if(!q||l.isTableRow(a)||l.isTableCell(a))k.x+=v,k.y+=u;v=p.x;u=p.y;l.model.isEdge(b[c])&&(u=v=0);m=b=l.importCells(b,k.x-(x?v:0),k.y-(x?u:0),
x?r:null);if(l.model.isEdge(a))l.model.setTerminal(a,b[c],d==mxConstants.DIRECTION_NORTH),null!=h&&null!=e&&(l.model.remove(b[h]),l.updateShapes(b[h],[a]));else if(l.model.isEdge(b[c])&&null==e){l.model.setTerminal(b[c],a,!0);var y=l.getCellGeometry(b[c]),H=null!=y?y.getTerminalPoint(!0):null;y.points=null;if(null!=H)for(d=0;d<b.length;d++)if(l.model.isEdge(b[d])&&d!=c){var B=l.getCellGeometry(b[d]),F=null!=B?B.getTerminalPoint(!0):null;null!=F&&F.x==H.x&&F.y==H.y&&l.model.setTerminal(b[d],a,!0)}if(null!=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ mxCell.prototype.setCsetAttribute = function (attributeName, attributeValue)
{
var obj = null;
if (!!this.value && (typeof this.value == 'UserObject' || this.value.tagName == 'UserObject'))
//if (!!this.value && typeof this.value == 'object')
{
obj = this.value;

Expand All @@ -38,9 +37,6 @@ mxCell.prototype.setCsetAttribute = function (attributeName, attributeValue)

obj.setAttribute('internalLabel', attributeValue || '');
}
//if (!this.value || typeof this.value != 'UserObject' && obj.style) {
// this.value = obj;
//}
}
else
{
Expand All @@ -57,34 +53,16 @@ mxCell.prototype.setCsetAttribute = function (attributeName, attributeValue)
}

// 'object' is for old diagrams that haven't been updated yet
if (!this.value || (typeof this.value != 'UserObject' && typeof this.value != 'object') && (obj.style || this.value.style)) {
if (!this.value || (typeof this.value != 'UserObject' && typeof this.value != 'object') && (obj.style || this.value.style || this.value == 'Zone')) {
this.value = obj;
}


//obj = doc.createElement('object');
}
catch (e)
{
console.log(e);
}
}

/*
obj.setAttribute(attributeName, attributeValue);
console.log('obj:')
console.log(obj)
// set an internal label as well. Something to concatenate with the SAL for the display label.
if (attributeName === 'label')
{
obj.setAttribute('internalLabel', attributeValue || '');
}
if (!this.value || typeof this.value != 'UserObject' && obj.style)
{
this.value = obj;
}
*/
//this.value = obj;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2506,9 +2506,9 @@ Sidebar.prototype.createItem=function(a,b,d,c,f,e,h,l,k,m,g,n,p,r){l=null!=l?l:!
this.editorUi.editor.graph.defaultEdgeStyle,!0,!0);null!=n?(q.style.backgroundImage="url("+n+")",q.style.backgroundRepeat="no-repeat",q.style.backgroundPosition="center",q.style.backgroundSize="24px 24px"):this.createThumb(v,m,g,q,b,d,c,f,e);var u=new mxRectangle(0,0,f,e);1<a.length||a[0].vertex?(c=this.createDragSource(q,this.createDropHandler(a,!0,h,u,p,r),this.createDragPreview(f,e),a,u,p),this.addClickHandler(q,c,a,k,p),c.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})):
null!=a[0]&&a[0].edge&&(c=this.createDragSource(q,this.createDropHandler(a,!1,h,u,p,r),this.createDragPreview(f,e),a,u,p),this.addClickHandler(q,c,a,k));!mxClient.IS_IOS&&l&&mxEvent.addGestureListeners(q,null,mxUtils.bind(this,function(c){mxEvent.isMouseEvent(c)&&this.showTooltip(q,a,u.width,u.height,b,d)}));return q};
Sidebar.prototype.createDropHandler=function(a,b,d,c,f,e){d=null!=d?d:!0;return mxUtils.bind(this,function(h,l,k,m,g,n){for(n=n?null:mxEvent.isTouchEvent(l)||mxEvent.isPenEvent(l)?document.elementFromPoint(mxEvent.getClientX(l),mxEvent.getClientY(l)):mxEvent.getSource(l);null!=n&&n!=this.container;)n=n.parentNode;if(null==n&&h.isEnabled()){a=h.getImportableCells(a);if(0<a.length){h.stopEditing();n=null==k||mxEvent.isAltDown(l)?!1:h.isValidDropTarget(k,a,l);var p=null;null==k||n||(k=null);if(!h.isCellLocked(k||
h.getDefaultParent())){h.model.beginUpdate();try{m=Math.round(m);g=Math.round(g);if(b&&h.isSplitTarget(k,a,l)){var r=h.view.scale,q=h.view.translate,v=(m+q.x)*r,u=(g+q.y)*r,w=h.cloneCells(a);h.splitEdge(k,w,null,m-c.width/2,g-c.height/2,v,u);p=w}else if(0<a.length&&(console.log("importing cells?"),p=h.importCells(a,m,g,k),h.model.isVertex(e)&&1==p.length&&h.model.isVertex(p[0]))){var x=h.insertEdge(h.model.getParent(e),null,"",e,p[0],h.createCurrentEdgeStyle());h.applyNewEdgeStyle(e,[x]);p.push(x);
h.connectionHandler.insertBeforeSource&&h.insertEdgeBeforeCell(x,e)}if(null!=h.layoutManager){var z=h.layoutManager.getLayout(k);if(null!=z)for(var r=h.view.scale,q=h.view.translate,v=(m+q.x)*r,u=(g+q.y)*r,y=0;y<p.length;y++)z.moveCell(p[y],v,u)}!d||null!=l&&mxEvent.isShiftDown(l)||h.fireEvent(new mxEventObject("cellsInserted","cells",p));for(y=0;y<p.length;y++)h.model.isVertex(p[y])&&h.isAutoSizeCell(p[y])&&h.updateCellSize(p[y])}catch(H){this.editorUi.handleError(H)}finally{h.model.endUpdate()}null!=
p&&0<p.length&&(h.scrollCellToVisible(p[0]),h.setSelectionCells(p));(f||h.editAfterInsert&&null!=l&&mxEvent.isMouseEvent(l)&&null!=p&&1==p.length)&&window.setTimeout(function(){h.startEditing(p[0])},0)}}mxEvent.consume(l)}})};Sidebar.prototype.createDragPreview=function(a,b){var d=document.createElement("div");d.className="geDragPreview";d.style.width=a+"px";d.style.height=b+"px";return d};
h.getDefaultParent())){h.model.beginUpdate();try{m=Math.round(m);g=Math.round(g);if(b&&h.isSplitTarget(k,a,l)){var r=h.view.scale,q=h.view.translate,v=(m+q.x)*r,u=(g+q.y)*r,w=h.cloneCells(a);h.splitEdge(k,w,null,m-c.width/2,g-c.height/2,v,u);p=w}else if(0<a.length&&(p=h.importCells(a,m,g,k),h.model.isVertex(e)&&1==p.length&&h.model.isVertex(p[0]))){var x=h.insertEdge(h.model.getParent(e),null,"",e,p[0],h.createCurrentEdgeStyle());h.applyNewEdgeStyle(e,[x]);p.push(x);h.connectionHandler.insertBeforeSource&&
h.insertEdgeBeforeCell(x,e)}if(null!=h.layoutManager){var z=h.layoutManager.getLayout(k);if(null!=z)for(var r=h.view.scale,q=h.view.translate,v=(m+q.x)*r,u=(g+q.y)*r,y=0;y<p.length;y++)z.moveCell(p[y],v,u)}!d||null!=l&&mxEvent.isShiftDown(l)||h.fireEvent(new mxEventObject("cellsInserted","cells",p));for(y=0;y<p.length;y++)h.model.isVertex(p[y])&&h.isAutoSizeCell(p[y])&&h.updateCellSize(p[y])}catch(H){this.editorUi.handleError(H)}finally{h.model.endUpdate()}null!=p&&0<p.length&&(h.scrollCellToVisible(p[0]),
h.setSelectionCells(p));(f||h.editAfterInsert&&null!=l&&mxEvent.isMouseEvent(l)&&null!=p&&1==p.length)&&window.setTimeout(function(){h.startEditing(p[0])},0)}}mxEvent.consume(l)}})};Sidebar.prototype.createDragPreview=function(a,b){var d=document.createElement("div");d.className="geDragPreview";d.style.width=a+"px";d.style.height=b+"px";return d};
Sidebar.prototype.dropAndConnect=function(a,b,d,c,f,e,h){var l=this.editorUi.editor.graph,k=l.model.isEdge(a)||null!=e?e:h,k=this.getDropAndConnectGeometry(a,b[k],d,b),m=[];if(null!=k){var g=null;l.model.beginUpdate();try{var n=l.getCellGeometry(a),p=l.getCellGeometry(b[c]),r=l.model.getParent(a),q=!0;if(null!=l.layoutManager){var v=l.layoutManager.getLayout(r);null!=v&&v.constructor==mxStackLayout&&(q=!1)}var m=l.model.isEdge(a)?null:l.view.getState(r),u=v=0;if(null!=m)var w=m.origin,v=w.x,u=w.y;
var x=!l.isTableRow(a)&&!l.isTableCell(a)&&(l.model.isEdge(a)||null!=n&&!n.relative&&q),z=l.getCellAt((k.x+v+l.view.translate.x)*l.view.scale,(k.y+u+l.view.translate.y)*l.view.scale,null,null,null,function(a,b,c){return!l.isContainer(a.cell)});if(null!=z&&z!=r)m=l.view.getState(z),null!=m&&(w=m.origin,r=z,x=!0,l.model.isEdge(a)||(k.x-=w.x-v,k.y-=w.y-u));else if(!q||l.isTableRow(a)||l.isTableCell(a))k.x+=v,k.y+=u;v=p.x;u=p.y;l.model.isEdge(b[c])&&(u=v=0);m=b=l.importCells(b,k.x-(x?v:0),k.y-(x?u:0),
x?r:null);if(l.model.isEdge(a))l.model.setTerminal(a,b[c],d==mxConstants.DIRECTION_NORTH),null!=h&&null!=e&&(l.model.remove(b[h]),l.updateShapes(b[h],[a]));else if(l.model.isEdge(b[c])&&null==e){l.model.setTerminal(b[c],a,!0);var y=l.getCellGeometry(b[c]),H=null!=y?y.getTerminalPoint(!0):null;y.points=null;if(null!=H)for(d=0;d<b.length;d++)if(l.model.isEdge(b[d])&&d!=c){var B=l.getCellGeometry(b[d]),F=null!=B?B.getTerminalPoint(!0):null;null!=F&&F.x==H.x&&F.y==H.y&&l.model.setTerminal(b[d],a,!0)}if(null!=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<td>{{parseShapeType(shape)}}</td>
<td>{{shape.layerName}}</td>
<td>
<select class="form-control" (change)="changeShapeToComponent($event, shape.id)">
<select class="form-control" (change)="changeShapeToComponent($event, shape)">
<option *ngFor="let o of this.symbols" [value]="o.abbreviation">
{{o.symbol_Name}}
</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,14 @@ export class ShapesComponent implements OnInit {
});
}

changeShapeToComponent(event: any, id: string) {
changeShapeToComponent(event: any, shape: any) {
let type = event.target.value;
let id = shape.id;
let label = shape.value ? shape.value : '';

this.diagramSvc.getDiagramComponents().subscribe(
(x: any) => {
let label = this.diagramSvc.applyComponentSuffix(type, x);
label = label == '' ? this.diagramSvc.applyComponentSuffix(type, x) : label;

this.diagramSvc.changeShapeToComponent(type, id, label).subscribe(
(compList: any) =>
Expand Down

0 comments on commit dc90abe

Please sign in to comment.