Error:
Code:
var ATemplate = g_(go.Group, "Auto", {
resizable: true,
resizeObjectName: "SHAPE",
rotatable: true,
locationSpot: go.Spot.Center,
locationObjectName: "SHAPE",
selectionObjectName: "SHAPE",
background: "transparent",
mouseDragEnter: function(e, grp, prev) {
highlightGroup(e, grp, true);
},
mouseDragLeave: function(e, grp, next) {
highlightGroup(e, grp, false);
},
computesBoundsAfterDrag: true,
mouseDrop: finishDrop,
handlesDragDropForMembers: true,
ungroupable: true
}, new go.Binding("angle","angle").makeTwoWay(), new go.Binding("location","loc",go.Point.parse).makeTwoWay(go.Point.stringify), new go.Binding("background","isHighlighted",function(h) {
return h ? "rgba(255,0,0,0.1)" : "transparent";
}
).ofObject(), g_(go.Panel, "Spot", g_(go.Shape, "Rectangle", {
name: "SHAPE",
fill: "rgba(255,255,255,0)",
strokeWidth: 1,
stroke: "rgba(0,0,0,1)",
width: 150,
height: 50
}), g_(go.TextBlock, {
editable: true,
_isNodeLabel: true,
isMultiline: true,
alignment: new go.Spot(0,0,0,0),//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
cursor: "pointer"
},
new go.Binding("alignment").makeTwoWay(),
new go.Binding("font","font"),
new go.Binding("stroke","color"),
new go.Binding("text","text").makeTwoWay())));
function setMode(mode, itemType) {
myDiagram.startTransaction();
......
myDiagram.commitTransaction("mode changed");
}
var inspector = new Inspector('myInspectorDiv',myDiagram,
{
properties: {
"angle": {
show: Inspector.showIfNode,
type: 'number',
defaultValue: 0
},
"alignment": {
show: Inspector.showIfNode,
type: 'spot'//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
},
......
}
});
function save() {
document.getElementById("mySavedModel").value = myDiagram.model.toJson();
myDiagram.isModified = false;
}
function load() {
myDiagram.model = go.Model.fromJson(document.getElementById("mySavedModel").value);
}