Class GraphLayoutCache.GraphLayoutCacheEdit

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map attributes  
      protected java.lang.Object[] cells  
      protected java.util.Set changedCells  
      protected CellView[] context  
      protected java.awt.geom.Rectangle2D dirtyRegion
      The dirty region associated with this event prior to the change
      protected CellView[] hidden  
      protected java.lang.Object[] invisible  
      protected java.util.Map previousAttributes  
      protected java.lang.Object[] previousCells  
      protected java.lang.Object[] visible  
      • Fields inherited from class javax.swing.undo.CompoundEdit

        edits
      • Fields inherited from class javax.swing.undo.AbstractUndoableEdit

        RedoName, UndoName
    • Constructor Summary

      Constructors 
      Constructor Description
      GraphLayoutCacheEdit​(java.lang.Object[] inserted, java.util.Map attributes, java.lang.Object[] visible, java.lang.Object[] invisible)
      Constructs a GraphViewEdit.
      GraphLayoutCacheEdit​(java.util.Map nested)
      Constructs a GraphViewEdit.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()
      Execute this edit such that the next invocation to this method will invert the last execution.
      java.util.Map getAttributes()
      Returns a map of (cell view, attribute) pairs.
      java.lang.Object[] getChanged()
      Returns the cell views that have changed.
      java.lang.Object[] getContext()
      Returns the views that have not changed explicitly, but implicitly because one of their dependent cells has changed.
      java.awt.geom.Rectangle2D getDirtyRegion()
      Returns the dirty region for the original position of the changed cells before the change happened.
      java.lang.Object[] getInserted()
      Returns the cells that habe been made visible.
      java.util.Map getPreviousAttributes()
      Returns a map of (cell view, attribute) pairs.
      java.lang.Object[] getRemoved()
      Returns the cells that have changed.
      java.lang.Object getSource()
      Returns the source of this change.
      boolean isSignificant()  
      void redo()
      Redoes a change.
      void setDirtyRegion​(java.awt.geom.Rectangle2D dirty)
      In some cases the class firing this event will not have access to the dirty region prior to the change.
      void undo()
      Undoes a change.
      • Methods inherited from class javax.swing.undo.CompoundEdit

        addEdit, canRedo, canUndo, die, end, getPresentationName, getRedoPresentationName, getUndoPresentationName, isInProgress, lastEdit, toString
      • 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
    • Field Detail

      • cells

        protected java.lang.Object[] cells
      • previousCells

        protected java.lang.Object[] previousCells
      • attributes

        protected java.util.Map attributes
      • previousAttributes

        protected java.util.Map previousAttributes
      • visible

        protected java.lang.Object[] visible
      • invisible

        protected java.lang.Object[] invisible
      • dirtyRegion

        protected java.awt.geom.Rectangle2D dirtyRegion
        The dirty region associated with this event prior to the change
      • changedCells

        protected java.util.Set changedCells
    • Constructor Detail

      • GraphLayoutCacheEdit

        public GraphLayoutCacheEdit​(java.util.Map nested)
        Constructs a GraphViewEdit. This modifies the attributes of the specified views and may be used to notify UndoListeners.
        Parameters:
        nested - the map that defines the new attributes
      • GraphLayoutCacheEdit

        public GraphLayoutCacheEdit​(java.lang.Object[] inserted,
                                    java.util.Map attributes,
                                    java.lang.Object[] visible,
                                    java.lang.Object[] invisible)
        Constructs a GraphViewEdit. This modifies the attributes of the specified views and may be used to notify UndoListeners. This should also take an array of removed cell views, but it is not possible to add further UndoableEdits to an already executed CompoundEdit, such as a GraphModel change. Thus, to handle implicit changes -- rather than piggybacking on the model's event -- the CompoundEdit's addEdit method should be extended to accept and instantly execute sub- sequent edits (implicit changes to the view, such as removing a mapping, hiding a view or the like).
        Parameters:
        inserted - an array of inserted cells
        attributes - the map that defines the new attributes
        visible - an array defining which cells are visible
        invisible - an array defining which cells are invisible
    • Method Detail

      • isSignificant

        public boolean isSignificant()
        Specified by:
        isSignificant in interface javax.swing.undo.UndoableEdit
        Overrides:
        isSignificant in class javax.swing.undo.CompoundEdit
      • getContext

        public java.lang.Object[] getContext()
        Returns the views that have not changed explicitly, but implicitly because one of their dependent cells has changed.
        Specified by:
        getContext in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
        Returns:
        array of contextual cells
      • redo

        public void redo()
                  throws javax.swing.undo.CannotRedoException
        Redoes a change.
        Specified by:
        redo in interface javax.swing.undo.UndoableEdit
        Overrides:
        redo in class javax.swing.undo.CompoundEdit
        Throws:
        javax.swing.undo.CannotRedoException - if the change cannot be redone
      • undo

        public void undo()
                  throws javax.swing.undo.CannotUndoException
        Undoes a change.
        Specified by:
        undo in interface javax.swing.undo.UndoableEdit
        Overrides:
        undo in class javax.swing.undo.CompoundEdit
        Throws:
        javax.swing.undo.CannotUndoException - if the change cannot be undone
      • execute

        public void execute()
        Execute this edit such that the next invocation to this method will invert the last execution.