Skip to content

Commit cc3581c

Browse files
fix
2 parents c4d4d30 + 7978e9d commit cc3581c

File tree

4 files changed

+49
-10
lines changed

4 files changed

+49
-10
lines changed

src/akmm/ui_buildmodels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export function buildGoModel(metis: akm.cxMetis, model: akm.cxModel, modelview:
334334
const object = node.object as akm.cxObject;
335335
let objtype = object?.type as akm.cxObjectType;
336336
if (!objtype) objtype = metis.findObjectType(object.typeRef);
337-
if (objtype.name !== 'EntityType') {
337+
if (objtype?.name !== 'EntityType') {
338338
const typeview = objtype?.getDefaultTypeView() as akm.cxObjectTypeView;
339339
if (typeview) {
340340
if (!node.template) node.template = typeview.template;

src/akmm/ui_templates.ts

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,14 @@ go.Shape.defineFigureGenerator("Message", function(shape, w, h) {
5959
fig.add(new go.PathSegment(go.PathSegment.Line, w, h));
6060
fig.add(new go.PathSegment(go.PathSegment.Line, 0, h));
6161
fig.add(new go.PathSegment(go.PathSegment.Line, 0, 0).close());
62-
62+
fig.add(new go.PathSegment(go.PathSegment.Line, w, 0));
63+
fig.add(new go.PathSegment(go.PathSegment.Line, 0.5*w, 0.5*h));
64+
fig.add(new go.PathSegment(go.PathSegment.Line, 0, 0.5*h));
65+
6366
// Add a fold line
64-
fig = new go.PathFigure(0.5 * w, 0, false);
65-
geo.add(fig);
66-
fig.add(new go.PathSegment(go.PathSegment.Line, w, h));
67+
// fig = new go.PathFigure(0.5 * w, 0, false);
68+
// geo.add(fig);
69+
// fig.add(new go.PathSegment(go.PathSegment.Line, w, h));
6770

6871
return geo;
6972
});
@@ -129,7 +132,7 @@ let figureNames = [
129132
'Rectangle',
130133
'RoundedRectangle',
131134
'Square',
132-
// 'FivePointedStar',
135+
'FivePointedStar',
133136
// 'ThinX',
134137
// 'ThickX',
135138
// 'ThinCross',
@@ -3684,9 +3687,41 @@ export function addGroupTemplates(groupTemplateMap: any, contextMenu: any, portC
36843687
);
36853688
groupTemplateMap.add("Lane", laneTemplate);
36863689
addGroupTemplateName('Lane');
3687-
36883690
// define a custom resize adornment that has two resize handles if the group is expanded
3689-
groupTemplateMap.get("Lane").resizeAdornmentTemplate = addResizeAdornment("Lane");
3691+
3692+
const laneTemplate2 =
3693+
$(go.Group, "Horizontal", groupStyle(),
3694+
{
3695+
name: "GROUP",
3696+
selectionObjectName: "GROUP", // selecting a lane causes the body of the lane to be highlit, not the label
3697+
resizable: true,
3698+
minSize: getMinSize(),
3699+
selectionAdorned: true,
3700+
contextMenu: contextMenu,
3701+
},
3702+
new go.Binding("isSubGraphExpanded", "expanded").makeTwoWay(),
3703+
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
3704+
new go.Binding("desiredSize", "size", go.Size.parse).makeTwoWay(go.Size.stringify),
3705+
// the lane header consisting of a Shape and a TextBlock
3706+
new go.Binding("layout", "groupLayout").makeTwoWay(),
3707+
{ // Tooltip
3708+
toolTip:
3709+
$(go.Adornment, "Auto",
3710+
$(go.Shape, { fill: "lightyellow" }),
3711+
$(go.TextBlock, { margin: 8 }, // the tooltip shows the result of calling nodeInfo(data)
3712+
new go.Binding("text", "",
3713+
function (d) {
3714+
return uid.nodeInfo(d, myMetis);
3715+
}
3716+
)
3717+
)
3718+
)
3719+
},
3720+
groupTop3(contextMenu, 'Icon', 1),
3721+
);
3722+
groupTemplateMap.add("Lane_w_handles", laneTemplate2);
3723+
addGroupTemplateName('Lane_w_handles');
3724+
groupTemplateMap.get("Lane_w_handles").resizeAdornmentTemplate = addResizeAdornment("Lane_w_handles");
36903725
}
36913726
if (true) { // poolTemplate
36923727
const poolTemplate =

src/components/gojs/GoJSApp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ class GoJSApp extends React.Component<{}, AppState> {
13491349
myDiagram.model.setDataProperty(part, "group", goNode.group);
13501350
goNode.scale = goNode.getMyScale(myGoModel);
13511351
part.scale = Number(goNode.scale);
1352-
gjs.scale = part.scale
1352+
gjsNode.scale = part.scale
13531353
myDiagram.model.setDataProperty(node, "scale", part.scale);
13541354
}
13551355
// if (goNode) {

tsconfig.tsbuildinfo

Lines changed: 5 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)