Documentation of 'org.jhotdraw.undo.CompositeEdit' Java class
CompositeEdit
org.jhotdraw.undo

Class CompositeEdit

  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.undo.UndoableEdit
    Direct Known Subclasses:
    CompositeFigureEdit


    public class CompositeEdit
    extends javax.swing.undo.CompoundEdit
    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 compoundable 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);
     
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      CompositeEdit()
      Creates a new CompositeEdit which uses CompoundEdit#getPresentationName() and is significant..
      CompositeEdit(boolean isSignificant)
      Creates a new CompositeEdit which uses the specified significance.
      CompositeEdit(java.lang.String presentationName)
      Creates a new CompositeEdit which uses the specified presentation name.
      CompositeEdit(java.lang.String presentationName, boolean isSignificant)
      Creates a new CompositeEdit which uses the given presentation name and significance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      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, redo, toString, undo
      • Methods inherited from class javax.swing.undo.AbstractUndoableEdit

        replaceEdit
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CompositeEdit

        public CompositeEdit()
        Creates a new CompositeEdit which uses CompoundEdit#getPresentationName() and is significant..
        See Also:
        CompoundEdit.getPresentationName()
      • CompositeEdit

        public CompositeEdit(boolean isSignificant)
        Creates a new CompositeEdit which uses the specified significance.

        The presentation name is used from CompoundEdit#getPresentationName().

        See Also:
        CompoundEdit.getPresentationName()
      • CompositeEdit

        public CompositeEdit(java.lang.String presentationName)
        Creates a new CompositeEdit which uses the specified presentation name.

        If the presentation name is null, then CompoundEdit.getPresentatioName is used.

        See Also:
        CompoundEdit.getPresentationName()
      • CompositeEdit

        public CompositeEdit(java.lang.String presentationName,
                             boolean isSignificant)
        Creates a new CompositeEdit which uses the given presentation name and significance.

        If the presentation name is null, then CompoundEdit.getPresentatioName is used.

        See Also:
        CompoundEdit.getPresentationName()
    • Method Detail

      • setVerbose

        public void setVerbose(boolean b)
      • getPresentationName

        public java.lang.String getPresentationName()
        Returns the presentation name. If the presentation name is null, then CompoundEdit.getPresentatioName is returned.
        Specified by:
        getPresentationName in interface javax.swing.undo.UndoableEdit
        Overrides:
        getPresentationName in class javax.swing.undo.CompoundEdit
        See Also:
        CompoundEdit.getPresentationName()
      • getUndoPresentationName

        public java.lang.String getUndoPresentationName()
        Returns the undo presentation name. If the presentation name is null, then CompoundEdit.getUndoPresentationName is returned.
        Specified by:
        getUndoPresentationName in interface javax.swing.undo.UndoableEdit
        Overrides:
        getUndoPresentationName in class javax.swing.undo.CompoundEdit
        See Also:
        CompoundEdit.getUndoPresentationName()
      • getRedoPresentationName

        public java.lang.String getRedoPresentationName()
        Returns the redo presentation name. If the presentation name is null, then CompoundEdit.getRedoPresentationName is returned.
        Specified by:
        getRedoPresentationName in interface javax.swing.undo.UndoableEdit
        Overrides:
        getRedoPresentationName in class javax.swing.undo.CompoundEdit
        See Also:
        CompoundEdit.getRedoPresentationName()
      • addEdit

        public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
        If this edit is inProgress, accepts anEdit and returns true.

        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.

        Specified by:
        addEdit in interface javax.swing.undo.UndoableEdit
        Overrides:
        addEdit in class javax.swing.undo.CompoundEdit
      • isSignificant

        public 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.
        Specified by:
        isSignificant in interface javax.swing.undo.UndoableEdit
        Overrides:
        isSignificant in class javax.swing.undo.CompoundEdit
      • setSignificant

        public void setSignificant(boolean newValue)

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.