Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jointjs update merge #73

Open
wants to merge 18 commits into
base: create-modules
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30,848 changes: 11,818 additions & 19,030 deletions dashboard-service/src/main/webapp/resources/js/joint.js

Large diffs are not rendered by default.

870 changes: 770 additions & 100 deletions dashboard-service/src/main/webapp/resources/types/jointjs/jointjs.d.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,40 @@ import {PropertiesPack} from "./PropertiesPack";
import {PropertyEditElement} from "./PropertyEditElement";
import {UIDGenerator} from "../controller/UIDGenerator";
import {DiagramNode} from "./DiagramNode";

class ImageWithPorts extends joint.shapes.basic.Generic {
constructor(portsModelInterface: joint.shapes.basic.PortsModelInterface) {
super(portsModelInterface);

this.set("markup", '<g class="rotatable"><g class="scalable"><rect class ="outer"/><image/></g><text/><g class="inPorts"/><g class="outPorts"/></g>')
this.set("portMarkup", '<g class="port<%= id %>"><circle/><text/></g>')
}

getPortAttrs(portName: string, index: number, total: number, selector: string, type: string): {} {

var attrs = {};

var portClass = 'port' + index;
var portSelector = selector + '>.' + portClass;
var portTextSelector = portSelector + '>text';
var portCircleSelector = portSelector + '>circle';

attrs[portTextSelector] = { text: portName };
attrs[portCircleSelector] = { port: { id: portName || _.uniqueId(type), type: type } };
attrs[portSelector] = { ref: 'rect', 'ref-x': (index + 0.5) * (1 / total) };

if (selector === '.outPorts') {
attrs[portSelector]['ref-dx'] = 0;
}

return attrs;
}
};

export class DefaultDiagramNode implements DiagramNode {

private logicalId: string;
private jointObject: joint.shapes.devs.ImageWithPorts;
private jointObject: ImageWithPorts;
private name: string;
private type: string;
private constPropertiesPack: PropertiesPack;
Expand All @@ -29,7 +59,7 @@ export class DefaultDiagramNode implements DiagramNode {
position: { x: x, y: y },
size: { width: 50, height: 50 },
outPorts: [''],
attrs: {
attrs: <{ [selector: string]: { [key: string]: string} }> {
image: {
'xlink:href': imagePath
},
Expand All @@ -40,7 +70,7 @@ export class DefaultDiagramNode implements DiagramNode {
jQuery.extend(jointObjectAttributes, {id: id});
}

this.jointObject = new joint.shapes.devs.ImageWithPorts(jointObjectAttributes);
this.jointObject = new ImageWithPorts(jointObjectAttributes);
this.changeableProperties = properties;
this.imagePath = imagePath;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class DiagramScene extends joint.dia.Paper {
validateMagnet: function (cellView, magnet) {
return magnet.getAttribute('magnet') !== 'passive';
},
diagramElementView: joint.dia.ElementView.extend(jQuery.extend(joint.shapes.basic.PortsViewInterface,
elementView: joint.dia.ElementView.extend(jQuery.extend(joint.shapes.basic.PortsViewInterface,
{
pointerdown: DiagramElementListener.pointerdown
}))
Expand Down
284 changes: 172 additions & 112 deletions editor-core/src/main/webapp/app/types/backbone/backbone.d.ts

Large diffs are not rendered by default.

Loading