001/**
002 * 
003 */
004package icy.roi.edit;
005
006import icy.painter.Anchor2D;
007
008import java.awt.Image;
009
010import plugins.kernel.roi.roi2d.ROI2DShape;
011
012/**
013 * Base class of 2D control point change implementation for ROI undoable edition.
014 * 
015 * @author Stephane
016 */
017public class AbstractPoint2DROIEdit extends AbstractROIEdit
018{
019    protected Anchor2D point;
020
021    public AbstractPoint2DROIEdit(ROI2DShape roi, Anchor2D point, String name, Image icon)
022    {
023        super(roi, name, icon);
024
025        this.point = point;
026    }
027
028    public AbstractPoint2DROIEdit(ROI2DShape roi, Anchor2D point, String name)
029    {
030        this(roi, point, name, roi.getIcon());
031    }
032
033    public AbstractPoint2DROIEdit(ROI2DShape roi, Anchor2D point, Image icon)
034    {
035        this(roi, point, "ROI point changed", icon);
036    }
037
038    public AbstractPoint2DROIEdit(ROI2DShape roi, Anchor2D point)
039    {
040        this(roi, point, "ROI point changed", roi.getIcon());
041    }
042
043    public ROI2DShape getROI2DShape()
044    {
045        return (ROI2DShape) getSource();
046    }
047
048    public Anchor2D getPoint()
049    {
050        return point;
051    }
052
053    @Override
054    public void die()
055    {
056        super.die();
057
058        point = null;
059    }
060}