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