package smart_gs.swingui.toolbar.action;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
import smart_gs.logical.LineSegmentForEdit;
import smart_gs.smleditor.swingui.LineSegEditor;

public class LineSegEditorUndoActionListener implements ActionListener {
	LineSegEditor editor;

	public LineSegEditorUndoActionListener(LineSegEditor editor) {
		this.editor = editor;
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		if (!editor.undoStackIsEmpty()) {
			editor.popUndoStack();
			editor.rewriteLineSegIndexes();
			editor.invalidate();
			editor.validate();
			editor.repaint();
		}
	}
}
