| 
JHotDraw 7.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.undo.AbstractUndoableEdit
javax.swing.undo.CompoundEdit
org.jhotdraw.undo.CompositeEdit
public class CompositeEdit
This is basically the same like javax.swing.undo.CompoundEdit but it has a slightly different behaviour: The compound edit ends, when it is added to itself. This way it can be fired two times to an UndoManager: The first time, when a sequence of compuondable edits starts, end the last time, when the sequence is over.
For example:
// fire CompositeEdit at start of sequence CompositeEdit ce = new CompositeEdit(); fireUndoableEditEvent(ce); ...fire edits which shall compounded here... // fire CompositeEdit at end of sequence again, to end it. fireUndoableEditEvent(ce);
| Field Summary | 
|---|
| Fields inherited from class javax.swing.undo.CompoundEdit | 
|---|
edits | 
| Fields inherited from class javax.swing.undo.AbstractUndoableEdit | 
|---|
RedoName, UndoName | 
| Constructor Summary | |
|---|---|
CompositeEdit()
Creates new CompositeEdit.  | 
|
CompositeEdit(boolean isSignificant)
Creates new CompositeEdit.  | 
|
CompositeEdit(java.lang.String presentationName)
Creates new CompositeEdit.  | 
|
CompositeEdit(java.lang.String presentationName,
              boolean isSignificant)
Creates new CompositeEdit.  | 
|
| Method Summary | |
|---|---|
 boolean | 
addEdit(javax.swing.undo.UndoableEdit anEdit)
If this edit is inProgress, accepts anEdit and returns true.  | 
 java.lang.String | 
getPresentationName()
Returns the presentation name.  | 
 java.lang.String | 
getRedoPresentationName()
Returns the redo presentation name.  | 
 java.lang.String | 
getUndoPresentationName()
Returns the undo presentation name.  | 
 boolean | 
isSignificant()
Returns false if this edit is insignificant - for example one that maintains the user's selection, but does not change any model state.  | 
 void | 
setSignificant(boolean newValue)
 | 
 void | 
setVerbose(boolean b)
 | 
| Methods inherited from class javax.swing.undo.CompoundEdit | 
|---|
canRedo, canUndo, die, end, isInProgress, lastEdit, redo, toString, undo | 
| Methods inherited from class javax.swing.undo.AbstractUndoableEdit | 
|---|
replaceEdit | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public CompositeEdit()
CompoundEdit.getPresentationName()public CompositeEdit(boolean isSignificant)
CompoundEdit.getPresentationName()public CompositeEdit(java.lang.String presentationName)
CompoundEdit.getPresentationName()
public CompositeEdit(java.lang.String presentationName,
                     boolean isSignificant)
CompoundEdit.getPresentationName()| Method Detail | 
|---|
public void setVerbose(boolean b)
public java.lang.String getPresentationName()
getPresentationName in interface javax.swing.undo.UndoableEditgetPresentationName in class javax.swing.undo.CompoundEditCompoundEdit.getPresentationName()public java.lang.String getUndoPresentationName()
getUndoPresentationName in interface javax.swing.undo.UndoableEditgetUndoPresentationName in class javax.swing.undo.CompoundEditCompoundEdit.getUndoPresentationName()public java.lang.String getRedoPresentationName()
getRedoPresentationName in interface javax.swing.undo.UndoableEditgetRedoPresentationName in class javax.swing.undo.CompoundEditCompoundEdit.getRedoPresentationName()public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
The last edit added to this CompositeEdit is given a chance to addEdit(anEdit). If it refuses (returns false), anEdit is given a chance to replaceEdit the last edit. If anEdit returns false here, it is added to edits.
If the CompositeEdit is added to itself, then method end() is called, and true is returned.
addEdit in interface javax.swing.undo.UndoableEditaddEdit in class javax.swing.undo.CompoundEditpublic boolean isSignificant()
isSignificant in interface javax.swing.undo.UndoableEditisSignificant in class javax.swing.undo.CompoundEditpublic void setSignificant(boolean newValue)
  | 
Copyright 1996-2007 (c) JHotDraw.org. Some rights reserved.  | 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||