001package icy.sequence.edit; 002 003import icy.roi.ROI; 004import icy.sequence.Sequence; 005 006import javax.swing.undo.CannotRedoException; 007import javax.swing.undo.CannotUndoException; 008 009/** 010 * ROI remove Sequence edit event 011 * 012 * @author Stephane 013 */ 014public class ROIRemoveSequenceEdit extends AbstractROISequenceEdit 015{ 016 public ROIRemoveSequenceEdit(Sequence sequence, ROI source) 017 { 018 super(sequence, source, "ROI removed"); 019 } 020 021 @Override 022 public void undo() throws CannotUndoException 023 { 024 super.undo(); 025 026 getSequence().addROI(getROI(), false); 027 } 028 029 @Override 030 public void redo() throws CannotRedoException 031 { 032 super.redo(); 033 034 getSequence().removeROI(getROI(), false); 035 } 036}