X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fswingjs%2Fj2s%2Fjavax%2Fswing%2Fundo%2FCompoundEdit.js;fp=site%2Fswingjs%2Fj2s%2Fjavax%2Fswing%2Fundo%2FCompoundEdit.js;h=5e1315e7df52d327452ddc75ac715feba212cbec;hp=cbcf3fff928fd331a29fa3b97e07d89c10a3b069;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/swingjs/j2s/javax/swing/undo/CompoundEdit.js b/site/swingjs/j2s/javax/swing/undo/CompoundEdit.js index cbcf3ff..5e1315e 100644 --- a/site/swingjs/j2s/javax/swing/undo/CompoundEdit.js +++ b/site/swingjs/j2s/javax/swing/undo/CompoundEdit.js @@ -1,113 +1,113 @@ -Clazz.declarePackage ("javax.swing.undo"); -Clazz.load (["javax.swing.undo.AbstractUndoableEdit"], "javax.swing.undo.CompoundEdit", ["java.util.Vector"], function () { -c$ = Clazz.decorateAsClass (function () { -this.inProgress = false; -this.edits = null; -Clazz.instantialize (this, arguments); -}, javax.swing.undo, "CompoundEdit", javax.swing.undo.AbstractUndoableEdit); -Clazz.makeConstructor (c$, -function () { -Clazz.superConstructor (this, javax.swing.undo.CompoundEdit); -this.inProgress = true; -this.edits = new java.util.Vector (); -}); -Clazz.defineMethod (c$, "undo", -function () { -Clazz.superCall (this, javax.swing.undo.CompoundEdit, "undo", []); -var i = this.edits.size (); -while (i-- > 0) { -var e = this.edits.elementAt (i); -e.undo (); -} -}); -Clazz.defineMethod (c$, "redo", -function () { -Clazz.superCall (this, javax.swing.undo.CompoundEdit, "redo", []); -var cursor = this.edits.elements (); -while (cursor.hasMoreElements ()) { -(cursor.nextElement ()).redo (); -} -}); -Clazz.defineMethod (c$, "lastEdit", -function () { -var count = this.edits.size (); -if (count > 0) return this.edits.elementAt (count - 1); - else return null; -}); -Clazz.defineMethod (c$, "die", -function () { -var size = this.edits.size (); -for (var i = size - 1; i >= 0; i--) { -var e = this.edits.elementAt (i); -e.die (); -} -Clazz.superCall (this, javax.swing.undo.CompoundEdit, "die", []); -}); -Clazz.overrideMethod (c$, "addEdit", -function (anEdit) { -if (!this.inProgress) { -return false; -} else { -var last = this.lastEdit (); -if (last == null) { -this.edits.addElement (anEdit); -} else if (!last.addEdit (anEdit)) { -if (anEdit.replaceEdit (last)) { -this.edits.removeElementAt (this.edits.size () - 1); -}this.edits.addElement (anEdit); -}return true; -}}, "javax.swing.undo.UndoableEdit"); -Clazz.defineMethod (c$, "end", -function () { -this.inProgress = false; -}); -Clazz.defineMethod (c$, "canUndo", -function () { -return !this.isInProgress () && Clazz.superCall (this, javax.swing.undo.CompoundEdit, "canUndo", []); -}); -Clazz.defineMethod (c$, "canRedo", -function () { -return !this.isInProgress () && Clazz.superCall (this, javax.swing.undo.CompoundEdit, "canRedo", []); -}); -Clazz.defineMethod (c$, "isInProgress", -function () { -return this.inProgress; -}); -Clazz.overrideMethod (c$, "isSignificant", -function () { -var cursor = this.edits.elements (); -while (cursor.hasMoreElements ()) { -if ((cursor.nextElement ()).isSignificant ()) { -return true; -}} -return false; -}); -Clazz.defineMethod (c$, "getPresentationName", -function () { -var last = this.lastEdit (); -if (last != null) { -return last.getPresentationName (); -} else { -return Clazz.superCall (this, javax.swing.undo.CompoundEdit, "getPresentationName", []); -}}); -Clazz.defineMethod (c$, "getUndoPresentationName", -function () { -var last = this.lastEdit (); -if (last != null) { -return last.getUndoPresentationName (); -} else { -return Clazz.superCall (this, javax.swing.undo.CompoundEdit, "getUndoPresentationName", []); -}}); -Clazz.defineMethod (c$, "getRedoPresentationName", -function () { -var last = this.lastEdit (); -if (last != null) { -return last.getRedoPresentationName (); -} else { -return Clazz.superCall (this, javax.swing.undo.CompoundEdit, "getRedoPresentationName", []); -}}); -Clazz.defineMethod (c$, "toString", -function () { -return Clazz.superCall (this, javax.swing.undo.CompoundEdit, "toString", []) + " inProgress: " + this.inProgress + " edits: " + this.edits; -}); -}); +Clazz.declarePackage ("javax.swing.undo"); +Clazz.load (["javax.swing.undo.AbstractUndoableEdit"], "javax.swing.undo.CompoundEdit", ["java.util.Vector"], function () { +c$ = Clazz.decorateAsClass (function () { +this.inProgress = false; +this.edits = null; +Clazz.instantialize (this, arguments); +}, javax.swing.undo, "CompoundEdit", javax.swing.undo.AbstractUndoableEdit); +Clazz.makeConstructor (c$, +function () { +Clazz.superConstructor (this, javax.swing.undo.CompoundEdit); +this.inProgress = true; +this.edits = new java.util.Vector (); +}); +Clazz.defineMethod (c$, "undo", +function () { +Clazz.superCall (this, javax.swing.undo.CompoundEdit, "undo", []); +var i = this.edits.size (); +while (i-- > 0) { +var e = this.edits.elementAt (i); +e.undo (); +} +}); +Clazz.defineMethod (c$, "redo", +function () { +Clazz.superCall (this, javax.swing.undo.CompoundEdit, "redo", []); +var cursor = this.edits.elements (); +while (cursor.hasMoreElements ()) { +(cursor.nextElement ()).redo (); +} +}); +Clazz.defineMethod (c$, "lastEdit", +function () { +var count = this.edits.size (); +if (count > 0) return this.edits.elementAt (count - 1); + else return null; +}); +Clazz.defineMethod (c$, "die", +function () { +var size = this.edits.size (); +for (var i = size - 1; i >= 0; i--) { +var e = this.edits.elementAt (i); +e.die (); +} +Clazz.superCall (this, javax.swing.undo.CompoundEdit, "die", []); +}); +Clazz.overrideMethod (c$, "addEdit", +function (anEdit) { +if (!this.inProgress) { +return false; +} else { +var last = this.lastEdit (); +if (last == null) { +this.edits.addElement (anEdit); +} else if (!last.addEdit (anEdit)) { +if (anEdit.replaceEdit (last)) { +this.edits.removeElementAt (this.edits.size () - 1); +}this.edits.addElement (anEdit); +}return true; +}}, "javax.swing.undo.UndoableEdit"); +Clazz.defineMethod (c$, "end", +function () { +this.inProgress = false; +}); +Clazz.defineMethod (c$, "canUndo", +function () { +return !this.isInProgress () && Clazz.superCall (this, javax.swing.undo.CompoundEdit, "canUndo", []); +}); +Clazz.defineMethod (c$, "canRedo", +function () { +return !this.isInProgress () && Clazz.superCall (this, javax.swing.undo.CompoundEdit, "canRedo", []); +}); +Clazz.defineMethod (c$, "isInProgress", +function () { +return this.inProgress; +}); +Clazz.overrideMethod (c$, "isSignificant", +function () { +var cursor = this.edits.elements (); +while (cursor.hasMoreElements ()) { +if ((cursor.nextElement ()).isSignificant ()) { +return true; +}} +return false; +}); +Clazz.defineMethod (c$, "getPresentationName", +function () { +var last = this.lastEdit (); +if (last != null) { +return last.getPresentationName (); +} else { +return Clazz.superCall (this, javax.swing.undo.CompoundEdit, "getPresentationName", []); +}}); +Clazz.defineMethod (c$, "getUndoPresentationName", +function () { +var last = this.lastEdit (); +if (last != null) { +return last.getUndoPresentationName (); +} else { +return Clazz.superCall (this, javax.swing.undo.CompoundEdit, "getUndoPresentationName", []); +}}); +Clazz.defineMethod (c$, "getRedoPresentationName", +function () { +var last = this.lastEdit (); +if (last != null) { +return last.getRedoPresentationName (); +} else { +return Clazz.superCall (this, javax.swing.undo.CompoundEdit, "getRedoPresentationName", []); +}}); +Clazz.defineMethod (c$, "toString", +function () { +return Clazz.superCall (this, javax.swing.undo.CompoundEdit, "toString", []) + " inProgress: " + this.inProgress + " edits: " + this.edits; +}); +});