markgojs
Version:
Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams
58 lines • 2.56 kB
HTML
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Simulating Input Events</title>
<!-- Copyright 1998-2019 by Northwoods Software Corporation. -->
<meta charset="UTF-8">
<script src="../samples/assets/require.js"></script>
<script src="../assets/js/goSamples.js"></script> <!-- this is only for the GoJS Samples framework -->
<script id="code">
function init() {
require(["RobotScript"], function (app) {
app.init();
document.getElementById("dragFromPalette").onclick = app.dragFromPalette;
document.getElementById("copyNode").onclick = app.copyNode;
document.getElementById("dragSelectNodes").onclick = app.dragSelectNodes;
document.getElementById("clickContextMenu").onclick = app.clickContextMenu;
document.getElementById("deleteSelection").onclick = app.deleteSelection;
document.getElementById("clickLambda").onclick = app.clickLambda;
document.getElementById("doubleClickLambda").onclick = app.doubleClickLambda;
});
}
</script>
</head>
<body onload="init()">
<div id="sample">
<div style="width:100%; white-space:nowrap;">
<span style="display: inline-block; vertical-align: top; width:80px">
<div id="myPaletteDiv" style="border: solid 1px black; height: 400px"></div>
</span>
<span style="display: inline-block; vertical-align: top; width:80%">
<div id="myDiagramDiv" style="border: solid 1px black; height: 400px"></div>
</span>
</div>
<p>
To simulate mouse events the buttons below use the <b>Robot</b> class that is defined in <a href="Robot.ts">Robot.ts</a>.
</p>
<p>
Click these buttons in order from top to bottom:<br />
<button id="dragFromPalette">Drag From Palette</button><br />
<button id="copyNode">Copy Node</button><br />
<button id="dragSelectNodes">Drag Select Nodes</button><br />
<button id="clickContextMenu">Context Menu Click Alpha</button><br />
<button id="deleteSelection">Delete</button><br />
</p>
<p>
Clicking operations:<br />
<button id="clickLambda">Click Lambda</button><br />
<button id="doubleClickLambda">Double Click Lambda</button><br />
</p>
<p>
The <a>UndoManager</a> has been enabled in the main Diagram.
Give focus to the Diagram and you can undo everything and then redo everything to confirm what was executed by the Robot.
</p>
<div id="myStatus" style="color:green"></div>
</div>
</body>
</html>