001/**
002 * 
003 */
004package icy.sequence.edit;
005
006import icy.roi.ROI;
007import icy.sequence.Sequence;
008
009import java.awt.Image;
010import java.util.ArrayList;
011import java.util.Collection;
012import java.util.List;
013
014/**
015 * Abstract ROI list sequence undoable edit.
016 * 
017 * @author Stephane
018 */
019public class AbstractROIsSequenceEdit extends AbstractSequenceEdit
020{
021    Collection<ROI> rois;
022
023    public AbstractROIsSequenceEdit(Sequence sequence, Collection<ROI> rois, String name, Image icon)
024    {
025        super(sequence, name, icon);
026
027        this.rois = rois;
028    }
029
030    public AbstractROIsSequenceEdit(Sequence sequence, Collection<ROI> rois, String name)
031    {
032        this(sequence, rois, name, null);
033    }
034
035    public AbstractROIsSequenceEdit(Sequence sequence, Collection<ROI> rois)
036    {
037        this(sequence, rois, (rois.size() > 1) ? "ROIs changed" : "ROI changed", null);
038    }
039
040    public List<ROI> getROIs()
041    {
042        return new ArrayList<ROI>(rois);
043    }
044
045    @Override
046    public void die()
047    {
048        super.die();
049
050        rois = null;
051    }
052}