Image icons disappeared when i tried to add BPMN context menu event.
GO(go.Node, "Spot",
{
locationObjectName: "SHAPE",
locationSpot: go.Spot.Center,
resizable: true,
resizeObjectName: "PANEL",
toolTip: tooltiptemplate,
contextMenu: activityNodeMenu,
itemTemplate: boundaryEventItemTemplate,
selectionAdorned: false
},
new go.Binding("itemArray", "boundaryEventArray"),
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
new go.Binding("layerName", "isSelected", function (s) { return s ? "Foreground" : ""; }).ofObject(),
GO(go.Panel, "Auto",
{
name: "PANEL",
minSize: new go.Size(ActivityNodeWidth, ActivityNodeHeight),
desiredSize: new go.Size(ActivityNodeWidth, ActivityNodeHeight)
},
new go.Binding("desiredSize", "size", go.Size.parse).makeTwoWay(go.Size.stringify),
GO(go.Panel, "Spot",
GO(go.Shape, "RoundedRectangle",
{
name: "SHAPE",
fill: ActivityNodeFill, stroke: ActivityNodeStroke,
parameter1: 10,
portId: "", fromLinkable: true, toLinkable: true, cursor: "pointer",
fromSpot: go.Spot.RightSide, toSpot: go.Spot.LeftSide,
},
new go.Binding("stroke", "isSelected", function (sel) {
if (sel) return "dodgerblue"; else return "black";
}).ofObject(""),
new go.Binding("fill", "isSelected", function (sel) {
if (sel) return "#f0f8ff"; else return "white";
}).ofObject(""),
new go.Binding("fill", "color"),
new go.Binding("strokeWidth", "isCall",
function (s) { return s ? ActivityNodeStrokeWidthIsCall : ActivityNodeStrokeWidth; })
),
GO(go.Shape, "Circle", {
alignment: new go.Spot(0, 0, 4.5, 4.5),
alignmentFocus: go.Spot.TopLeft,
fill: null,
strokeWidth: 1,
width: 25,
height: 25,
visible: false
},
new go.Binding("visible", "eventDimension", function (val) {
return val ? true : false;
})
),
GO(go.Shape, "BpmnTaskScript",
{
alignment: new go.Spot(0, 0, 5, 5), alignmentFocus: go.Spot.TopLeft,
width: 22, height: 22
},
new go.Binding("fill", "taskType", nodeActivityTaskTypeColorConverter),
new go.Binding("figure", "taskType", nodeActivityTaskTypeConverter),
new go.Binding("alignment", "eventDimension", function (val) {
return val ? new go.Spot(0, 0, 8, 8) : new go.Spot(0, 0, 5, 5);
}),
new go.Binding("width", "eventDimension", function (val) {
return val ? 18 : 22;
}),
new go.Binding("height", "eventDimension", function (val) {
return val ? 18 : 22;
})
),
makeMarkerPanel(false, 1)
),
GO(go.TextBlock,
{
alignment: go.Spot.Center, textAlign: "center", margin: 12,
editable: false, overflow: go.TextBlock.OverflowEllipsis
},
new go.Binding("text", "", function (val, node) {
var name = "";
if (val && val.externalData && val.externalData.Name !== undefined && val.externalData.Name !== null) {
name = val.externalData.Name;
}
return name == "" ? val.text : name;
}).makeTwoWay()
),
GO(go.Panel, "Auto", { alignment: go.Spot.Center, margin: new go.Margin(40, 12, 12, 12) },
GO(go.Shape, "Rectangle", {
fill: "#fe9635",
stroke: null
}),
GO(go.TextBlock, { text: "(instantiated)", editable: false, visible: false },
new go.Binding("visible", "eventDimension", function (val) {
return val ? true : false;
})
)
),
{
mouseEnter: function (e, node) { internalHelper.showSmallPorts(node, true); },
mouseLeave: function (e, node) { internalHelper.showSmallPorts(node, false); }
},
GO(go.Shape, {
name: "SHAPE",
width: 100, height: 65,
fill: "transparent",
cursor: "all-scroll",
strokeWidth: 0
})
),
{
doubleClick: function (e, node) {
var part = node.part;
internalHelper._openProcessStepModel({
parameters: args.parameters,
processData: args.processData,
toolboxItems: args.toolboxItems,
readOnly: args.readOnly,
part: part
});
}
},
new go.Binding("movable", "locked", function (val) {
return val ? false : true;
}),
new go.Binding("deletable", "locked", function (val) {
return val ? false : true;
}),
new go.Binding("resizable", "locked", function (val) {
return val ? false : true;
}),
getInfoShapes()
);
function getInfoShapes() {
GO(go.Picture,
{
name: name,
source: imageSource,
desiredSize: new go.Size(16, 16),
alignment: spot,
visible: false,
alignmentFocus: alignmentFocus,
mouseLeave: internalHelper.removeBoxHolder
}
);
}