1919 lines
77 KiB
HTML
1919 lines
77 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>GoJS® UndoManager Class</title>
|
|
|
|
<script src="../../assets/js/jquery.min.js"></script>
|
|
<script src="../../assets/js/bootstrap.min.js"></script>
|
|
<script src="../../assets/js/highlight.js"></script>
|
|
<script src="../../assets/js/api.js"></script>
|
|
|
|
<link href="../../assets/css/bootstrap.min.css" rel="stylesheet" >
|
|
<!-- custom CSS after bootstrap -->
|
|
<link href="../../assets/css/main.css" rel="stylesheet" type="text/css"/>
|
|
<link href="../../assets/css/api.css" rel="stylesheet" type="text/css"/>
|
|
<!--<link rel="stylesheet" href="../../assets/css/api.css" type="text/css" media="all" />-->
|
|
<link rel="stylesheet" href="../../assets/css/highlight.css" type="text/css" media="all" />
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<!-- non-fixed navbar -->
|
|
<nav id="non-fixed-nav" class="navbar navbar-inverse navbar-top">
|
|
<div class="container-fluid">
|
|
<div class="navbar-header">
|
|
<div class="navheader-container">
|
|
<div class="navheader-collapse" data-toggle="collapse" data-target="#navbar">
|
|
<a id="toplogo" class="navbar-brand" href="../../index.html">GoJS</a>
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="navbar" class="navbar-collapse collapse">
|
|
<ul class="nav navbar-nav navbar-right">
|
|
<li><a href="../../index.html">Home</a></li>
|
|
<li><a href="../../learn/index.html">Learn</a></li>
|
|
<li><a href="../../samples/index.html">Samples</a></li>
|
|
<li><a href="../../intro/index.html">Intro</a></li>
|
|
<li><a href="../../api/index.html">API</a></li>
|
|
<li><a href="https://www.nwoods.com/components/evalform.htm">Register</a></li>
|
|
<li><a href="../../doc/download.html">Download</a></li>
|
|
<li><a href="https://forum.nwoods.com/c/gojs">Forum</a></li>
|
|
<li><a href="https://www.nwoods.com/contact.html" onclick="ga('send','event','Outbound Link','click','contact');">Contact</a></li>
|
|
<li class="buy"><a href="https://www.nwoods.com/sales/index.html" onclick="ga('send','event','Outbound Link','click','buy');">Buy</a></li>
|
|
<li class="activate"><a href="https://www.nwoods.com/app/activate.aspx?sku=gojs">Activate</a></li>
|
|
</ul>
|
|
</div><!--/.nav-collapse -->
|
|
</div>
|
|
</nav>
|
|
|
|
|
|
<div class="container-fluid">
|
|
|
|
<!-- ============================== classes index ============================ -->
|
|
<div id="navindex" class="col-md-2">
|
|
<!-- begin publish.classesIndex -->
|
|
<!-- <div><a href="../index.html">GoJS Class Index</a></div> -->
|
|
|
|
<div class="sidebar-nav">
|
|
<div class="navbar navbar-default" role="navigation">
|
|
<div class="navbar-header">
|
|
<div class="navheader-container">
|
|
<div class="navheader-collapse" data-toggle="collapse" data-target="#DiagramNavbar">
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#DiagramNavbar">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
</div>
|
|
<span class="navbar-brand">Diagram Classes</span>
|
|
</div>
|
|
</div>
|
|
<div id="DiagramNavbar" class="navbar-collapse collapse sidebar-navbar-collapse">
|
|
<ul class="classList nav navbar-nav">
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Adornment.html" class="linkConstructor">Adornment</a></li>
|
|
|
|
<li><a href="../symbols/AnimationManager.html" class="linkConstructor">AnimationManager</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/CommandHandler.html" class="linkConstructor">CommandHandler</a></li>
|
|
|
|
|
|
|
|
<li><a href="../symbols/Diagram.html" class="linkConstructor">Diagram</a></li>
|
|
|
|
<li><a href="../symbols/DiagramEvent.html" class="linkConstructor">DiagramEvent</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/GraphObject.html" class="linkConstructor">GraphObject</a></li>
|
|
|
|
|
|
|
|
<li><a href="../symbols/Group.html" class="linkConstructor">Group</a></li>
|
|
|
|
|
|
|
|
<li><a href="../symbols/InputEvent.html" class="linkConstructor">InputEvent</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Layer.html" class="linkConstructor">Layer</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Link.html" class="linkConstructor">Link</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Node.html" class="linkConstructor">Node</a></li>
|
|
|
|
<li><a href="../symbols/Overview.html" class="linkConstructor">Overview</a></li>
|
|
|
|
<li><a href="../symbols/Palette.html" class="linkConstructor">Palette</a></li>
|
|
|
|
<li><a href="../symbols/Panel.html" class="linkConstructor">Panel</a></li>
|
|
|
|
|
|
|
|
<li><a href="../symbols/Part.html" class="linkConstructor">Part</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Picture.html" class="linkConstructor">Picture</a></li>
|
|
|
|
<li><a href="../symbols/Placeholder.html" class="linkConstructor">Placeholder</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/RowColumnDefinition.html" class="linkConstructor">RowColumnDefinition</a></li>
|
|
|
|
|
|
|
|
<li><a href="../symbols/Shape.html" class="linkConstructor">Shape</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="navbar navbar-default" role="navigation">
|
|
<div class="navbar-header">
|
|
<div class="navheader-container">
|
|
<div class="navheader-collapse" data-toggle="collapse" data-target="#GeometryNavbar">
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#GeometryNavbar">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
</div>
|
|
<span class="navbar-brand">Geometry Classes</span>
|
|
</div>
|
|
</div>
|
|
<div id="GeometryNavbar" class="navbar-collapse collapse sidebar-navbar-collapse">
|
|
<ul class="classList nav navbar-nav">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Brush.html" class="linkConstructor">Brush</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Geometry.html" class="linkConstructor">Geometry</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Margin.html" class="linkConstructor">Margin</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/PathFigure.html" class="linkConstructor">PathFigure</a></li>
|
|
|
|
<li><a href="../symbols/PathSegment.html" class="linkConstructor">PathSegment</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Point.html" class="linkConstructor">Point</a></li>
|
|
|
|
<li><a href="../symbols/Rect.html" class="linkConstructor">Rect</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Size.html" class="linkConstructor">Size</a></li>
|
|
|
|
<li><a href="../symbols/Spot.html" class="linkConstructor">Spot</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="navbar navbar-default" role="navigation">
|
|
<div class="navbar-header">
|
|
<div class="navheader-container">
|
|
<div class="navheader-collapse" data-toggle="collapse" data-target="#ModelNavbar">
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#ModelNavbar">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
</div>
|
|
<span class="navbar-brand">Model Classes</span>
|
|
</div>
|
|
</div>
|
|
<div id="ModelNavbar" class="navbar-collapse collapse sidebar-navbar-collapse">
|
|
<ul class="classList nav navbar-nav">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Binding.html" class="linkConstructor">Binding</a></li>
|
|
|
|
|
|
|
|
<li><a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/GraphLinksModel.html" class="linkConstructor">GraphLinksModel</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Model.html" class="linkConstructor">Model</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/TreeModel.html" class="linkConstructor">TreeModel</a></li>
|
|
|
|
|
|
|
|
<li><a href="../symbols/UndoManager.html" class="linkConstructor">UndoManager</a></li>
|
|
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="navbar navbar-default" role="navigation">
|
|
<div class="navbar-header">
|
|
<div class="navheader-container">
|
|
<div class="navheader-collapse" data-toggle="collapse" data-target="#LayoutNavbar">
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#LayoutNavbar">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
</div>
|
|
<span class="navbar-brand">Layout Classes</span>
|
|
</div>
|
|
</div>
|
|
<div id="LayoutNavbar" class="navbar-collapse collapse sidebar-navbar-collapse">
|
|
<ul class="classList nav navbar-nav">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/CircularLayout.html" class="linkConstructor">CircularLayout</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/ForceDirectedLayout.html" class="linkConstructor">ForceDirectedLayout</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/GridLayout.html" class="linkConstructor">GridLayout</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/LayeredDigraphLayout.html" class="linkConstructor">LayeredDigraphLayout</a></li>
|
|
|
|
|
|
|
|
<li><a href="../symbols/Layout.html" class="linkConstructor">Layout</a></li>
|
|
|
|
|
|
|
|
<li><a href="../symbols/LayoutNetwork.html" class="linkConstructor">LayoutNetwork</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/TreeLayout.html" class="linkConstructor">TreeLayout</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="navbar navbar-default" role="navigation">
|
|
<div class="navbar-header">
|
|
<div class="navheader-container">
|
|
<div class="navheader-collapse" data-toggle="collapse" data-target="#ToolNavbar">
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#ToolNavbar">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
</div>
|
|
<span class="navbar-brand">Tool Classes</span>
|
|
</div>
|
|
</div>
|
|
<div id="ToolNavbar" class="navbar-collapse collapse sidebar-navbar-collapse">
|
|
<ul class="classList nav navbar-nav">
|
|
|
|
|
|
|
|
<li><a href="../symbols/ActionTool.html" class="linkConstructor">ActionTool</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/ClickCreatingTool.html" class="linkConstructor">ClickCreatingTool</a></li>
|
|
|
|
<li><a href="../symbols/ClickSelectingTool.html" class="linkConstructor">ClickSelectingTool</a></li>
|
|
|
|
|
|
|
|
<li><a href="../symbols/ContextMenuTool.html" class="linkConstructor">ContextMenuTool</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/DraggingTool.html" class="linkConstructor">DraggingTool</a></li>
|
|
|
|
<li><a href="../symbols/DragSelectingTool.html" class="linkConstructor">DragSelectingTool</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/HTMLInfo.html" class="linkConstructor">HTMLInfo</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/LinkingBaseTool.html" class="linkConstructor">LinkingBaseTool</a></li>
|
|
|
|
<li><a href="../symbols/LinkingTool.html" class="linkConstructor">LinkingTool</a></li>
|
|
|
|
<li><a href="../symbols/LinkReshapingTool.html" class="linkConstructor">LinkReshapingTool</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/PanningTool.html" class="linkConstructor">PanningTool</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/RelinkingTool.html" class="linkConstructor">RelinkingTool</a></li>
|
|
|
|
<li><a href="../symbols/ResizingTool.html" class="linkConstructor">ResizingTool</a></li>
|
|
|
|
<li><a href="../symbols/RotatingTool.html" class="linkConstructor">RotatingTool</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/TextEditingTool.html" class="linkConstructor">TextEditingTool</a></li>
|
|
|
|
<li><a href="../symbols/Tool.html" class="linkConstructor">Tool</a></li>
|
|
|
|
<li><a href="../symbols/ToolManager.html" class="linkConstructor">ToolManager</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="navbar navbar-default" role="navigation">
|
|
<div class="navbar-header">
|
|
<div class="navheader-container">
|
|
<div class="navheader-collapse" data-toggle="collapse" data-target="#CollectionNavbar">
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#CollectionNavbar">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
</div>
|
|
<span class="navbar-brand">Collection Classes</span>
|
|
</div>
|
|
</div>
|
|
<div id="CollectionNavbar" class="navbar-collapse collapse sidebar-navbar-collapse">
|
|
<ul class="classList nav navbar-nav">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Iterable.html" class="linkConstructor">Iterable</a></li>
|
|
|
|
<li><a href="../symbols/Iterator.html" class="linkConstructor">Iterator</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/List.html" class="linkConstructor">List</a></li>
|
|
|
|
<li><a href="../symbols/Map.html" class="linkConstructor">Map</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../symbols/Set.html" class="linkConstructor">Set</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div> <!-- /class="sidebar-nav -->
|
|
|
|
|
|
|
|
|
|
<!-- end publish.classesIndex -->
|
|
</div>
|
|
|
|
<div id="contentBody" class="col-md-10">
|
|
<!-- ============================== header ================================= -->
|
|
<div id="header" class="fineprint mt30">
|
|
<b>GoJS</b>® Diagramming Components<br/>version 1.8.5 for JavaScript/HTML<br/>by <a href="https://www.nwoods.com/">Northwoods Software®</a>
|
|
</div>
|
|
|
|
<!-- ============================== class title ============================ -->
|
|
<h2 class="classTitle mt30">
|
|
|
|
Class UndoManager
|
|
|
|
</h2>
|
|
|
|
<!-- ============================== class summary ========================== -->
|
|
<span class="hideshowall">
|
|
<span class="nodetails"><button id="buttonShow">Show Details</button></span>
|
|
<span class="details"><button id="buttonHide">Show Summaries</button></span>
|
|
</span>
|
|
|
|
<p class="classsummary">
|
|
|
|
|
|
|
|
UndoManager observes and records model and diagram changes in transactions and
|
|
supports undo/redo operations.
|
|
You will need to set the <a href="../symbols/UndoManager.html#isEnabled" class="linkProperty">isEnabled</a> property to true
|
|
in order for users to perform an undo or a redo.
|
|
<p>
|
|
Typically an operation will call <a href="../symbols/UndoManager.html#startTransaction" class="linkMethod">startTransaction</a>,
|
|
make some changes to the <a href="../symbols/Model.html" class="linkConstructor">Model</a> or <a href="../symbols/Diagram.html" class="linkConstructor">Diagram</a>,
|
|
and then call <a href="../symbols/UndoManager.html#commitTransaction" class="linkMethod">commitTransaction</a>.
|
|
Any <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a>s that occur will be recorded in a
|
|
<a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a> object.
|
|
If for some reason you do not wish to complete the transaction
|
|
successfully, you can call <a href="../symbols/UndoManager.html#rollbackTransaction" class="linkMethod">rollbackTransaction</a> instead
|
|
of <a href="../symbols/UndoManager.html#commitTransaction" class="linkMethod">commitTransaction</a>.
|
|
<p>
|
|
The <a href="../symbols/UndoManager.html#history" class="linkProperty">history</a> property is a list of <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a>s.
|
|
<a href="../symbols/UndoManager.html#commitTransaction" class="linkMethod">commitTransaction</a> will add the <a href="../symbols/UndoManager.html#currentTransaction" class="linkProperty">currentTransaction</a>
|
|
to the <a href="../symbols/UndoManager.html#history" class="linkProperty">history</a> list.
|
|
<a href="../symbols/UndoManager.html#rollbackTransaction" class="linkMethod">rollbackTransaction</a> will undo the changes remembered in the
|
|
<a href="../symbols/UndoManager.html#currentTransaction" class="linkProperty">currentTransaction</a> and then discard it, without changing the <a href="../symbols/UndoManager.html#history" class="linkProperty">history</a>.
|
|
You can limit how many transactions are remembered in the history
|
|
by setting <a href="../symbols/UndoManager.html#maxHistoryLength" class="linkProperty">maxHistoryLength</a>.
|
|
<p>
|
|
Transactions may be nested.
|
|
Be sure to call either <a href="../symbols/UndoManager.html#commitTransaction" class="linkMethod">commitTransaction</a> or <a href="../symbols/UndoManager.html#rollbackTransaction" class="linkMethod">rollbackTransaction</a>
|
|
for each call to <a href="../symbols/UndoManager.html#startTransaction" class="linkMethod">startTransaction</a>.
|
|
Avoid repeated start-commit-start-commit calls as a result of a user's actions.
|
|
Instead, start, make all changes, and then commit.
|
|
<p>
|
|
If you want to restore the diagram to the state before the latest complete
|
|
transaction, call <a href="../symbols/UndoManager.html#undo" class="linkMethod">undo</a>.
|
|
Call <a href="../symbols/UndoManager.html#redo" class="linkMethod">redo</a> to change the diagram to a later state.
|
|
If after some number of undo's you start a transaction,
|
|
all of the history after the current state is discarded,
|
|
and a new transaction may be recorded.
|
|
You cannot undo or redo during a transaction.
|
|
<p>
|
|
Initially each <a href="../symbols/Model.html" class="linkConstructor">Model</a> has its own UndoManager.
|
|
UndoManagers may be shared by multiple Models by replacing
|
|
the standard <a href="../symbols/Model.html#undoManager" class="linkProperty">Model.undoManager</a> created by the model constructor.
|
|
<p>
|
|
There are several informational properties:
|
|
<ul>
|
|
<li><a href="../symbols/UndoManager.html#isInTransaction" class="linkProperty">isInTransaction</a> is true when a top-level transaction has been started that has not yet been committed or rolled-back.</li>
|
|
<li><a href="../symbols/UndoManager.html#currentTransaction" class="linkProperty">currentTransaction</a> holds the flattened list of all <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a>s
|
|
that have happened within the current transaction.</li>
|
|
<li><a href="../symbols/UndoManager.html#transactionLevel" class="linkProperty">transactionLevel</a> indicates the current depth of nesting.</li>
|
|
<li><a href="../symbols/UndoManager.html#nestedTransactionNames" class="linkProperty">nestedTransactionNames</a> holds the stack of transaction names supplied to
|
|
<a href="../symbols/UndoManager.html#startTransaction" class="linkMethod">startTransaction</a> calls.</li>
|
|
<li><a href="../symbols/UndoManager.html#history" class="linkProperty">history</a> holds only complete top-level transactions.</li>
|
|
<li><a href="../symbols/UndoManager.html#isUndoingRedoing" class="linkProperty">isUndoingRedoing</a> is true during a call to <a href="../symbols/UndoManager.html#undo" class="linkMethod">undo</a> or <a href="../symbols/UndoManager.html#redo" class="linkMethod">redo</a>.</li>
|
|
<li><a href="../symbols/UndoManager.html#historyIndex" class="linkProperty">historyIndex</a> indicates which <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a> in the <a href="../symbols/UndoManager.html#history" class="linkProperty">history</a> is the next to be "undone";
|
|
this is decremented by each undo and incremented by a redo.</li>
|
|
<li><a href="../symbols/UndoManager.html#transactionToUndo" class="linkProperty">transactionToUndo</a> and <a href="../symbols/UndoManager.html#transactionToRedo" class="linkProperty">transactionToRedo</a> indicate which <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a> may be undone or redone next, if any.</li>
|
|
<li><a href="../symbols/UndoManager.html#models" class="linkProperty">models</a> returns an iterator over all of the <a href="../symbols/Model.html" class="linkConstructor">Model</a>s that this UndoManager is handling.</li>
|
|
</ul>
|
|
</p>
|
|
|
|
<!-- ============================== constructor summary ==================== -->
|
|
|
|
<h2 id="constructor" class="summaryCaption"> Constructor <span class="nodetails"> Summary</span><span class="details"> Details</span></h2>
|
|
<div class="table-responsive">
|
|
<table class="summaryTable table table-bordered table-condensed" summary="A summary of the constructor documented in the class UndoManager.">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col" class="name">Name</th>
|
|
<th scope="col" class="description">Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td class="name" >
|
|
<div class="name">
|
|
UndoManager()
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp--><p><p>The constructor produces an empty UndoManager
|
|
with no transaction history.
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div><!-- class="table-responsive">-->
|
|
|
|
|
|
<!-- ============================== properties summary ===================== -->
|
|
|
|
|
|
|
|
<h2 class="summaryCaption">Properties<span class="nodetails"> Summary</span><span class="details"> Details</span></h2>
|
|
<div class="table-responsive">
|
|
<table class="summaryTable table table-bordered table-condensed" summary="A summary of the properties documented in the class UndoManager.">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col" class="name">Name, Value Type</th>
|
|
<th scope="col" class="description">Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<tr id="currentTransaction" >
|
|
|
|
<td class="name">
|
|
<div class="name">
|
|
currentTransaction
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{<a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a>}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp <p> -->
|
|
<p>This read-only property returns the current <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a> for recording additional model change events.<span class="nodetails" id="xpropcurrentTransaction"><a class="morelink" onclick="hst('propcurrentTransaction')">More...</a></span> <span class="details" id="propcurrentTransaction">
|
|
This is initialized and augmented by <a href="../symbols/UndoManager.html#handleChanged" class="linkMethod">handleChanged</a>
|
|
before it is added to <a href="../symbols/UndoManager.html#history" class="linkProperty">history</a> by a top-level call
|
|
to <a href="../symbols/UndoManager.html#commitTransaction" class="linkMethod">commitTransaction</a>.
|
|
The value will be null between transactions.</span>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="history" >
|
|
|
|
<td class="name">
|
|
<div class="name">
|
|
history
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{List.<Transaction>}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp <p> -->
|
|
<p>This read-only property returns the whole history, a list of all of the <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a>s,
|
|
each representing a transaction with some number of <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a>s.<span class="nodetails" id="xprophistory"><a class="morelink" onclick="hst('prophistory')">More...</a></span> <span class="details" id="prophistory">
|
|
</span><div class="details" id="dprophistory"><p>
|
|
You should not modify this List.</div>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="historyIndex" >
|
|
|
|
<td class="name">
|
|
<div class="name">
|
|
historyIndex
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{number}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp <p> -->
|
|
<p>This read-only property returns the index into <a href="../symbols/UndoManager.html#history" class="linkProperty">history</a> for the current undoable <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a>.<span class="nodetails" id="xprophistoryIndex"><a class="morelink" onclick="hst('prophistoryIndex')">More...</a></span> <span class="details" id="prophistoryIndex">
|
|
The value is -1 if there is no undoable <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a> to be undone.</span>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="isEnabled" >
|
|
|
|
<td class="name">
|
|
<div class="name">
|
|
isEnabled
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{boolean}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp <p> -->
|
|
<p>Gets or sets whether this UndoManager records any changes.<span class="nodetails" id="xpropisEnabled"><a class="morelink" onclick="hst('propisEnabled')">More...</a></span> <span class="details" id="propisEnabled">
|
|
The default value is false -- you need to set this to true if
|
|
you want the user to be able to undo or redo.
|
|
</span><div class="details" id="dpropisEnabled"><p>
|
|
You can temporarily turn off recording by setting <a href="../symbols/Diagram.html#skipsUndoManager" class="linkProperty">Diagram.skipsUndoManager</a>
|
|
and <a href="../symbols/Model.html#skipsUndoManager" class="linkProperty">Model.skipsUndoManager</a> to true.</div>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="isInTransaction" >
|
|
|
|
<td class="name">
|
|
<div class="name">
|
|
isInTransaction
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{boolean}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp <p> -->
|
|
<p>This read-only property is true after the first call to <a href="../symbols/UndoManager.html#startTransaction" class="linkMethod">startTransaction</a>
|
|
and before a corresponding call to <a href="../symbols/UndoManager.html#commitTransaction" class="linkMethod">commitTransaction</a> or <a href="../symbols/UndoManager.html#rollbackTransaction" class="linkMethod">rollbackTransaction</a>.<span class="nodetails" id="xpropisInTransaction"><a class="morelink" onclick="hst('propisInTransaction')">More...</a></span> <span class="details" id="propisInTransaction">
|
|
</span><div class="details" id="dpropisInTransaction"><p>
|
|
During a transaction <a href="../symbols/UndoManager.html#canUndo" class="linkMethod">canUndo</a> and <a href="../symbols/UndoManager.html#canRedo" class="linkMethod">canRedo</a> will be false.
|
|
<a href="../symbols/UndoManager.html#currentTransaction" class="linkProperty">currentTransaction</a> may be non-null if any <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a>s were recorded.</div>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="isUndoingRedoing" >
|
|
|
|
<td class="name">
|
|
<div class="name">
|
|
isUndoingRedoing
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{boolean}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp <p> -->
|
|
<p>This read-only property is true during a call to <a href="../symbols/UndoManager.html#undo" class="linkMethod">undo</a> or <a href="../symbols/UndoManager.html#redo" class="linkMethod">redo</a>.
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="maxHistoryLength" >
|
|
|
|
<td class="name">
|
|
<div class="name">
|
|
maxHistoryLength
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{number}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp <p> -->
|
|
<p>Gets or sets the maximum number of transactions that this undo manager will remember.<span class="nodetails" id="xpropmaxHistoryLength"><a class="morelink" onclick="hst('propmaxHistoryLength')">More...</a></span> <span class="details" id="propmaxHistoryLength">
|
|
When a transaction is committed and the number exceeds this value,
|
|
the UndoManager will discard the oldest transaction(s).
|
|
The initial value is 999.
|
|
A negative value is treated as if there were no limit.
|
|
</span><div class="details" id="dpropmaxHistoryLength"><p>
|
|
This property is useful in helping limit the memory consumption of typical applications.
|
|
But this does not limit the number of <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a>s that are recorded,
|
|
because there may be an unlimited number of those within each <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a>.
|
|
Decreasing this value will not necessarily remove any existing <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a>s
|
|
if there currently exist more in <a href="../symbols/UndoManager.html#history" class="linkProperty">history</a> than the new value permits.</div>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="models" >
|
|
|
|
<td class="name">
|
|
<div class="name">
|
|
models
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{Iterator.<Model>}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp <p> -->
|
|
<p>This read-only property returns an iterator for all of the <a href="../symbols/Model.html" class="linkConstructor">Model</a>s that this UndoManager is handling.<span class="nodetails" id="xpropmodels"><a class="morelink" onclick="hst('propmodels')">More...</a></span> <span class="details" id="propmodels"></span>
|
|
|
|
<div class="seealso">See also:
|
|
<ul class="seealsolist">
|
|
|
|
<li><a href="../symbols/UndoManager.html#addModel" class="linkMethod">addModel</a></li>
|
|
|
|
<li><a href="../symbols/UndoManager.html#removeModel" class="linkMethod">removeModel</a></li>
|
|
|
|
</ul>
|
|
</div>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="nestedTransactionNames" >
|
|
|
|
<td class="name">
|
|
<div class="name">
|
|
nestedTransactionNames
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{List.<string>}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp <p> -->
|
|
<p>This read-only property returns a stack of ongoing transaction names.<span class="nodetails" id="xpropnestedTransactionNames"><a class="morelink" onclick="hst('propnestedTransactionNames')">More...</a></span> <span class="details" id="propnestedTransactionNames">
|
|
The outermost transaction name will be the first item in the list.
|
|
The last one will be the name of the most recent (nested) call
|
|
to <a href="../symbols/UndoManager.html#startTransaction" class="linkMethod">startTransaction</a>.
|
|
</span><div class="details" id="dpropnestedTransactionNames"><p>
|
|
You should not modify this List.</div>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="transactionLevel" >
|
|
|
|
<td class="name">
|
|
<div class="name">
|
|
transactionLevel
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{number}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp <p> -->
|
|
<p>This read-only property returns the current transaction level.<span class="nodetails" id="xproptransactionLevel"><a class="morelink" onclick="hst('proptransactionLevel')">More...</a></span> <span class="details" id="proptransactionLevel">
|
|
The value is zero when there is no ongoing transaction.
|
|
The initial value is zero.
|
|
<a href="../symbols/UndoManager.html#startTransaction" class="linkMethod">startTransaction</a> will increment this value;
|
|
<a href="../symbols/UndoManager.html#commitTransaction" class="linkMethod">commitTransaction</a> or <a href="../symbols/UndoManager.html#rollbackTransaction" class="linkMethod">rollbackTransaction</a> will decrement it.
|
|
When this value is greater than zero, <a href="../symbols/UndoManager.html#canUndo" class="linkMethod">canUndo</a>
|
|
and <a href="../symbols/UndoManager.html#canRedo" class="linkMethod">canRedo</a> will be false, because
|
|
additional logically related model change events may occur.</span>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="transactionToRedo" >
|
|
|
|
<td class="name">
|
|
<div class="name">
|
|
transactionToRedo
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{<a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a>}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp <p> -->
|
|
<p>This read-only property returns the <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a> in the <a href="../symbols/UndoManager.html#history" class="linkProperty">history</a> to be redone next.<span class="nodetails" id="xproptransactionToRedo"><a class="morelink" onclick="hst('proptransactionToRedo')">More...</a></span> <span class="details" id="proptransactionToRedo">
|
|
The value may be null if the UndoManager is not ready to perform a redo.</span>
|
|
|
|
<div class="seealso">See also:
|
|
<ul class="seealsolist">
|
|
|
|
<li><a href="../symbols/UndoManager.html#transactionToUndo" class="linkProperty">transactionToUndo</a></li>
|
|
|
|
</ul>
|
|
</div>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="transactionToUndo" >
|
|
|
|
<td class="name">
|
|
<div class="name">
|
|
transactionToUndo
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{<a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a>}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp <p> -->
|
|
<p>This read-only property returns the <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a> in the <a href="../symbols/UndoManager.html#history" class="linkProperty">history</a> to be undone next.<span class="nodetails" id="xproptransactionToUndo"><a class="morelink" onclick="hst('proptransactionToUndo')">More...</a></span> <span class="details" id="proptransactionToUndo">
|
|
The value may be null if the UndoManager is not ready to perform an undo.</span>
|
|
|
|
<div class="seealso">See also:
|
|
<ul class="seealsolist">
|
|
|
|
<li><a href="../symbols/UndoManager.html#transactionToRedo" class="linkProperty">transactionToRedo</a></li>
|
|
|
|
</ul>
|
|
</div>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div><!-- class="table-responsive">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ============================== methods summary ======================== -->
|
|
|
|
|
|
|
|
<h2 class="summaryCaption">Method <span class="nodetails"> Summary</span><span class="details"> Details</span></h2>
|
|
<div class="table-responsive">
|
|
<table class="summaryTable table table-bordered table-condensed" summary="A summary of the methods documented in the class UndoManager.">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col" class="name">Name, Return Type</th>
|
|
<th scope="col" class="description">Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<tr id="addModel">
|
|
<td class="name">
|
|
|
|
<div class="name">
|
|
addModel(model)
|
|
</div>
|
|
<div class="attributes">
|
|
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp--><p><p>Make sure this UndoManager knows about a <a href="../symbols/Model.html" class="linkConstructor">Model</a> for which
|
|
it may receive <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a>s when the given <a href="../symbols/Model.html" class="linkConstructor">Model</a> is changed.<span class="nodetails" id="xmethaddModel"><a class="morelink" onclick="hst('methaddModel')">More...</a></span> <span class="details" id="methaddModel">
|
|
The model will also receive notifications about transactions and undo or redo operations.
|
|
</span><div class="details" id="dmethaddModel"><p>
|
|
You should not call this method during a transaction.</div>
|
|
|
|
</p><div class="seealso">See also:
|
|
<ul class="seealsolist">
|
|
|
|
<li><a href="../symbols/UndoManager.html#models" class="linkProperty">models</a></li>
|
|
|
|
<li><a href="../symbols/UndoManager.html#removeModel" class="linkMethod">removeModel</a></li>
|
|
|
|
</ul></div>
|
|
|
|
|
|
<dl class="detailList">
|
|
<dt class="heading">Parameters:</dt>
|
|
|
|
<dt>
|
|
<span class="light fixedFont">{<a href="../symbols/Model.html" class="linkConstructor">Model</a>}</span> <b>model</b>
|
|
|
|
</dt>
|
|
<dd>A <a href="../symbols/Model.html" class="linkConstructor">Model</a> that this UndoManager is managing.</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="canRedo">
|
|
<td class="name">
|
|
|
|
<div class="name">
|
|
canRedo()
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{boolean}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp--><p><p>This predicate returns true if you can call <a href="../symbols/UndoManager.html#redo" class="linkMethod">redo</a>.<span class="nodetails" id="xmethcanRedo"><a class="morelink" onclick="hst('methcanRedo')">More...</a></span> <span class="details" id="methcanRedo">
|
|
This will return false if <a href="../symbols/UndoManager.html#isEnabled" class="linkProperty">isEnabled</a> is false (as it is by default),
|
|
if any transaction is ongoing, if any undo or redo is occurring, or
|
|
if there is no <a href="../symbols/UndoManager.html#transactionToRedo" class="linkProperty">transactionToRedo</a> that can be redone.</span>
|
|
|
|
|
|
|
|
<dl class="detailList">
|
|
<dt class="heading">Returns:</dt>
|
|
|
|
<dt><span class="light fixedFont">{boolean}</span> true if ready for <a href="../symbols/UndoManager.html#redo" class="linkMethod">redo</a> to be called.</dt>
|
|
|
|
</dl>
|
|
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="canUndo">
|
|
<td class="name">
|
|
|
|
<div class="name">
|
|
canUndo()
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{boolean}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp--><p><p>This predicate returns true if you can call <a href="../symbols/UndoManager.html#undo" class="linkMethod">undo</a>.<span class="nodetails" id="xmethcanUndo"><a class="morelink" onclick="hst('methcanUndo')">More...</a></span> <span class="details" id="methcanUndo">
|
|
This will return false if <a href="../symbols/UndoManager.html#isEnabled" class="linkProperty">isEnabled</a> is false (as it is by default),
|
|
if any transaction is ongoing, if any undo or redo is occurring, or
|
|
if there is no <a href="../symbols/UndoManager.html#transactionToUndo" class="linkProperty">transactionToUndo</a> that can be undone.</span>
|
|
|
|
|
|
|
|
<dl class="detailList">
|
|
<dt class="heading">Returns:</dt>
|
|
|
|
<dt><span class="light fixedFont">{boolean}</span> true if ready for <a href="../symbols/UndoManager.html#undo" class="linkMethod">undo</a> to be called.</dt>
|
|
|
|
</dl>
|
|
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="clear">
|
|
<td class="name">
|
|
|
|
<div class="name">
|
|
clear()
|
|
</div>
|
|
<div class="attributes">
|
|
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp--><p><p>Clear all of the <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a>s and clear all other state,
|
|
including any ongoing transaction without rolling back.<span class="nodetails" id="xmethclear"><a class="morelink" onclick="hst('methclear')">More...</a></span> <span class="details" id="methclear">
|
|
However, this maintains its references to its <a href="../symbols/Model.html" class="linkConstructor">Model</a>s.
|
|
</span><div class="details" id="dmethclear"><p>
|
|
You should not call this method during a transaction.</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="commitTransaction">
|
|
<td class="name">
|
|
|
|
<div class="name">
|
|
commitTransaction(tname)
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{boolean}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp--><p><p>Commit the current transaction started by a call to <a href="../symbols/UndoManager.html#startTransaction" class="linkMethod">startTransaction</a>.<span class="nodetails" id="xmethcommitTransaction"><a class="morelink" onclick="hst('methcommitTransaction')">More...</a></span> <span class="details" id="methcommitTransaction">
|
|
</span><div class="details" id="dmethcommitTransaction"><p>
|
|
For convenience, this method is called by <a href="../symbols/Model.html#commitTransaction" class="linkMethod">Model.commitTransaction</a> and <a href="../symbols/Diagram.html#commitTransaction" class="linkMethod">Diagram.commitTransaction</a>.
|
|
<p>
|
|
If this call stops a top-level transaction,
|
|
we mark the <a href="../symbols/UndoManager.html#currentTransaction" class="linkProperty">currentTransaction</a> as complete (<a href="../symbols/Transaction.html#isComplete" class="linkProperty">Transaction.isComplete</a>),
|
|
we add the <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a> to the <a href="../symbols/UndoManager.html#history" class="linkProperty">history</a> list,
|
|
and we return true.
|
|
Committing a transaction when there have been some undos without corresponding
|
|
redos will throw away the <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a>s holding changes that happened
|
|
after the current state, before adding the new <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a> to the
|
|
<a href="../symbols/UndoManager.html#history" class="linkProperty">history</a> list.</div>
|
|
|
|
</p><div class="seealso">See also:
|
|
<ul class="seealsolist">
|
|
|
|
<li><a href="../symbols/UndoManager.html#startTransaction" class="linkMethod">startTransaction</a></li>
|
|
|
|
<li><a href="../symbols/UndoManager.html#rollbackTransaction" class="linkMethod">rollbackTransaction</a></li>
|
|
|
|
</ul></div>
|
|
|
|
|
|
<dl class="detailList">
|
|
<dt class="heading">Parameters:</dt>
|
|
|
|
<dt>
|
|
<span class="light fixedFont">{string=}</span> <b>tname</b>
|
|
|
|
</dt>
|
|
<dd>a short string describing the transaction;
|
|
this is recorded as the <a href="../symbols/Transaction.html#name" class="linkProperty">Transaction.name</a> and need not be the same as the string passed to <a href="../symbols/UndoManager.html#startTransaction" class="linkMethod">startTransaction</a>.
|
|
If the value is an empty string or not supplied, this will use the name given to <a href="../symbols/UndoManager.html#startTransaction" class="linkMethod">startTransaction</a>.</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
<dl class="detailList">
|
|
<dt class="heading">Returns:</dt>
|
|
|
|
<dt><span class="light fixedFont">{boolean}</span> true if ending a top-level transaction.</dt>
|
|
|
|
</dl>
|
|
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="handleChanged">
|
|
<td class="name">
|
|
|
|
<div class="name">
|
|
handleChanged(e)
|
|
</div>
|
|
<div class="attributes">
|
|
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp--><p><p>Maybe record a <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a> in the <a href="../symbols/UndoManager.html#currentTransaction" class="linkProperty">currentTransaction</a>.<span class="nodetails" id="xmethhandleChanged"><a class="morelink" onclick="hst('methhandleChanged')">More...</a></span> <span class="details" id="methhandleChanged">
|
|
This calls <a href="../symbols/UndoManager.html#skipsEvent" class="linkMethod">skipsEvent</a> to see if this should ignore the change.
|
|
If <a href="../symbols/UndoManager.html#skipsEvent" class="linkMethod">skipsEvent</a> returns false, this creates a copy of the <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a>
|
|
and adds it to the <a href="../symbols/UndoManager.html#currentTransaction" class="linkProperty">currentTransaction</a>.
|
|
If there is no <a href="../symbols/UndoManager.html#currentTransaction" class="linkProperty">currentTransaction</a>, this first creates and remembers it.
|
|
</span><div class="details" id="dmethhandleChanged"><p>
|
|
This method always ignores all changes while performing
|
|
an <a href="../symbols/UndoManager.html#undo" class="linkMethod">undo</a> or <a href="../symbols/UndoManager.html#redo" class="linkMethod">redo</a>.
|
|
This method is also a no-op if <a href="../symbols/UndoManager.html#isEnabled" class="linkProperty">isEnabled</a> is false.</div>
|
|
|
|
|
|
<dl class="detailList">
|
|
<dt class="heading">Parameters:</dt>
|
|
|
|
<dt>
|
|
<span class="light fixedFont">{<a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a>}</span> <b>e</b>
|
|
|
|
</dt>
|
|
<dd>a <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a>.</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="redo">
|
|
<td class="name">
|
|
|
|
<div class="name">
|
|
redo()
|
|
</div>
|
|
<div class="attributes">
|
|
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp--><p><p>After an <a href="../symbols/UndoManager.html#undo" class="linkMethod">undo</a>, re-perform the changes in <a href="../symbols/UndoManager.html#transactionToRedo" class="linkProperty">transactionToRedo</a>.<span class="nodetails" id="xmethredo"><a class="morelink" onclick="hst('methredo')">More...</a></span> <span class="details" id="methredo">
|
|
<a href="../symbols/UndoManager.html#canRedo" class="linkMethod">canRedo</a> must be true for this method to have any effect.
|
|
</span><div class="details" id="dmethredo"><p>
|
|
This is called by <a href="../symbols/CommandHandler.html#redo" class="linkMethod">CommandHandler.redo</a>.
|
|
<p>
|
|
This will raise a "StartingRedo" <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a> of type <a href="../symbols/ChangedEvent.html#Transaction" class="linkConstant">ChangedEvent.Transaction</a>,
|
|
perform the <a href="../symbols/Transaction.html#redo" class="linkMethod">Transaction.redo</a> on the <a href="../symbols/UndoManager.html#transactionToRedo" class="linkProperty">transactionToRedo</a>, and then
|
|
raise a "FinishedRedo" <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a> of type <a href="../symbols/ChangedEvent.html#Transaction" class="linkConstant">ChangedEvent.Transaction</a>.
|
|
The two ChangedEvents are to let model listeners know that a redo is about to take place
|
|
and that it just finished.
|
|
<a href="../symbols/UndoManager.html#isUndoingRedoing" class="linkProperty">isUndoingRedoing</a> will temporarily be set to true during this operation.</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="removeModel">
|
|
<td class="name">
|
|
|
|
<div class="name">
|
|
removeModel(model)
|
|
</div>
|
|
<div class="attributes">
|
|
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp--><p><p>Inform this UndoManager that it will no longer be receiving <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a>s
|
|
when the given <a href="../symbols/Model.html" class="linkConstructor">Model</a> is changed.<span class="nodetails" id="xmethremoveModel"><a class="morelink" onclick="hst('methremoveModel')">More...</a></span> <span class="details" id="methremoveModel">
|
|
The model will no longer receive notifications about transactions and undo or redo operations.
|
|
</span><div class="details" id="dmethremoveModel"><p>
|
|
You should not call this method during a transaction.
|
|
If you call this method between transactions when there is a transaction history,
|
|
you should be careful that there are no <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a>s referring to that model in any Transactions.</div>
|
|
|
|
</p><div class="seealso">See also:
|
|
<ul class="seealsolist">
|
|
|
|
<li><a href="../symbols/UndoManager.html#models" class="linkProperty">models</a></li>
|
|
|
|
<li><a href="../symbols/UndoManager.html#addModel" class="linkMethod">addModel</a></li>
|
|
|
|
</ul></div>
|
|
|
|
|
|
<dl class="detailList">
|
|
<dt class="heading">Parameters:</dt>
|
|
|
|
<dt>
|
|
<span class="light fixedFont">{<a href="../symbols/Model.html" class="linkConstructor">Model</a>}</span> <b>model</b>
|
|
|
|
</dt>
|
|
<dd>A <a href="../symbols/Model.html" class="linkConstructor">Model</a> that this UndoManager should no longer manage.</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="rollbackTransaction">
|
|
<td class="name">
|
|
|
|
<div class="name">
|
|
rollbackTransaction()
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{boolean}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp--><p><p>Rollback the current transaction started by a call to <a href="../symbols/UndoManager.html#startTransaction" class="linkMethod">startTransaction</a>, undoing any changes.<span class="nodetails" id="xmethrollbackTransaction"><a class="morelink" onclick="hst('methrollbackTransaction')">More...</a></span> <span class="details" id="methrollbackTransaction">
|
|
</span><div class="details" id="dmethrollbackTransaction"><p>
|
|
For convenience, this method is called by <a href="../symbols/Model.html#rollbackTransaction" class="linkMethod">Model.rollbackTransaction</a> and <a href="../symbols/Diagram.html#rollbackTransaction" class="linkMethod">Diagram.rollbackTransaction</a>.
|
|
<p>
|
|
This undoes and then discards the changes in the <a href="../symbols/UndoManager.html#currentTransaction" class="linkProperty">currentTransaction</a>.
|
|
You must have started a transaction previously.</div>
|
|
|
|
</p><div class="seealso">See also:
|
|
<ul class="seealsolist">
|
|
|
|
<li><a href="../symbols/UndoManager.html#startTransaction" class="linkMethod">startTransaction</a></li>
|
|
|
|
<li><a href="../symbols/UndoManager.html#commitTransaction" class="linkMethod">commitTransaction</a></li>
|
|
|
|
</ul></div>
|
|
|
|
|
|
|
|
<dl class="detailList">
|
|
<dt class="heading">Returns:</dt>
|
|
|
|
<dt><span class="light fixedFont">{boolean}</span> true if ending a top-level transaction.</dt>
|
|
|
|
</dl>
|
|
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="skipsEvent">
|
|
<td class="name">
|
|
|
|
<div class="name">
|
|
skipsEvent(e)
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{boolean}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp--><p><p>This predicate is called by <a href="../symbols/UndoManager.html#handleChanged" class="linkMethod">handleChanged</a> to decide if a <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a>
|
|
is not interesting enough to be remembered.<span class="nodetails" id="xmethskipsEvent"><a class="morelink" onclick="hst('methskipsEvent')">More...</a></span> <span class="details" id="methskipsEvent">
|
|
</span><div class="details" id="dmethskipsEvent"><p>
|
|
Transactional events (of change type <a href="../symbols/ChangedEvent.html#Transaction" class="linkConstant">ChangedEvent.Transaction</a>) are always skipped.
|
|
Changed events for <a href="../symbols/GraphObject.html" class="linkConstructor">GraphObject</a>s that are in <a href="../symbols/Layer.html#isTemporary" class="linkProperty">Layer.isTemporary</a> layers are also skipped.
|
|
<p>
|
|
Sometimes changed events do not even get to <a href="../symbols/UndoManager.html#handleChanged" class="linkMethod">handleChanged</a> because
|
|
<a href="../symbols/Model.html#skipsUndoManager" class="linkProperty">Model.skipsUndoManager</a> or <a href="../symbols/Diagram.html#skipsUndoManager" class="linkProperty">Diagram.skipsUndoManager</a> is true.</div>
|
|
|
|
|
|
<dl class="detailList">
|
|
<dt class="heading">Parameters:</dt>
|
|
|
|
<dt>
|
|
<span class="light fixedFont">{<a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a>}</span> <b>e</b>
|
|
|
|
</dt>
|
|
<dd>the <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a> received by <a href="../symbols/UndoManager.html#handleChanged" class="linkMethod">handleChanged</a>.</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
<dl class="detailList">
|
|
<dt class="heading">Returns:</dt>
|
|
|
|
<dt><span class="light fixedFont">{boolean}</span> true to not record the change.</dt>
|
|
|
|
</dl>
|
|
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="startTransaction">
|
|
<td class="name">
|
|
|
|
<div class="name">
|
|
startTransaction(tname)
|
|
</div>
|
|
<div class="attributes">
|
|
<span class="light">{boolean}</span>
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp--><p><p>Begin a transaction, where the changes are held by a <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a> object
|
|
as the value of <a href="../symbols/UndoManager.html#currentTransaction" class="linkProperty">currentTransaction</a>.<span class="nodetails" id="xmethstartTransaction"><a class="morelink" onclick="hst('methstartTransaction')">More...</a></span> <span class="details" id="methstartTransaction">
|
|
You must call either <a href="../symbols/UndoManager.html#commitTransaction" class="linkMethod">commitTransaction</a> or <a href="../symbols/UndoManager.html#rollbackTransaction" class="linkMethod">rollbackTransaction</a> afterwards.
|
|
</span><div class="details" id="dmethstartTransaction"><p>
|
|
For convenience, this method is called by <a href="../symbols/Model.html#startTransaction" class="linkMethod">Model.startTransaction</a> and <a href="../symbols/Diagram.html#startTransaction" class="linkMethod">Diagram.startTransaction</a>.
|
|
<p>
|
|
Transactions can be nested.
|
|
Starting or ending a nested transaction will return false.
|
|
Nested transactions will share the same <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a> list of <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a>s.
|
|
<p>
|
|
Starting a transaction will not necessarily cause <a href="../symbols/UndoManager.html#currentTransaction" class="linkProperty">currentTransaction</a> to be non-null.
|
|
A <a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a> object is usually only created by <a href="../symbols/UndoManager.html#handleChanged" class="linkMethod">handleChanged</a> when a <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a> first occurs.</div>
|
|
|
|
</p><div class="seealso">See also:
|
|
<ul class="seealsolist">
|
|
|
|
<li><a href="../symbols/UndoManager.html#commitTransaction" class="linkMethod">commitTransaction</a></li>
|
|
|
|
<li><a href="../symbols/UndoManager.html#rollbackTransaction" class="linkMethod">rollbackTransaction</a></li>
|
|
|
|
</ul></div>
|
|
|
|
|
|
<dl class="detailList">
|
|
<dt class="heading">Parameters:</dt>
|
|
|
|
<dt>
|
|
<span class="light fixedFont">{string=}</span> <b>tname</b>
|
|
|
|
</dt>
|
|
<dd>a short string describing the transaction, pushed onto the <a href="../symbols/UndoManager.html#nestedTransactionNames" class="linkProperty">nestedTransactionNames</a> stack.</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
<dl class="detailList">
|
|
<dt class="heading">Returns:</dt>
|
|
|
|
<dt><span class="light fixedFont">{boolean}</span> true if starting a top-level transaction.</dt>
|
|
|
|
</dl>
|
|
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="undo">
|
|
<td class="name">
|
|
|
|
<div class="name">
|
|
undo()
|
|
</div>
|
|
<div class="attributes">
|
|
|
|
|
|
</div>
|
|
</td>
|
|
<td class="description">
|
|
<div class="description">
|
|
<!--newp--><p><p>Reverse the effects of the <a href="../symbols/UndoManager.html#transactionToUndo" class="linkProperty">transactionToUndo</a>.<span class="nodetails" id="xmethundo"><a class="morelink" onclick="hst('methundo')">More...</a></span> <span class="details" id="methundo">
|
|
<a href="../symbols/UndoManager.html#canUndo" class="linkMethod">canUndo</a> must be true for this method to have any effect.
|
|
</span><div class="details" id="dmethundo"><p>
|
|
This is called by <a href="../symbols/CommandHandler.html#undo" class="linkMethod">CommandHandler.undo</a>.
|
|
<p>
|
|
This will raise a "StartingUndo" <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a> of type <a href="../symbols/ChangedEvent.html#Transaction" class="linkConstant">ChangedEvent.Transaction</a>,
|
|
perform the <a href="../symbols/Transaction.html#undo" class="linkMethod">Transaction.undo</a> on the <a href="../symbols/UndoManager.html#transactionToUndo" class="linkProperty">transactionToUndo</a>, and then
|
|
raise a "FinishedUndo" <a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a> of type <a href="../symbols/ChangedEvent.html#Transaction" class="linkConstant">ChangedEvent.Transaction</a>.
|
|
The two ChangedEvents are to let model listeners know that an undo is about to take place
|
|
and that it just finished.
|
|
<a href="../symbols/UndoManager.html#isUndoingRedoing" class="linkProperty">isUndoingRedoing</a> will temporarily be set to true during this operation.</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div><!-- class="table-responsive">-->
|
|
|
|
|
|
|
|
|
|
<!-- ============================== events summary ======================== -->
|
|
|
|
|
|
<!-- ============================== fields summary ===================== -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ============================== constructor details ==================== -->
|
|
|
|
</div> <!-- end contentBody -->
|
|
</div> <!-- end container-fluid -->
|
|
|
|
<!-- ============================== footer ================================= -->
|
|
<div id="footer" class="fineprint" style="clear:both">
|
|
Copyright © 1998-2017 by <a href="https://www.nwoods.com/">Northwoods Software Corporation.</a>
|
|
</div>
|
|
</body>
|
|
</html>
|