package smart_gs.swingui.toolbar.action;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import smart_gs.drawing_tool.ImageLabel;
import smart_gs.drawing_tool.drawing_mode.LineSegEditorDrawMode;
import smart_gs.drawing_tool.drawing_mode.LineSegEditorSelectMode;
import smart_gs.drawing_tool.drawing_mode.LineSegEditorSemiAutomaticMode;
import smart_gs.logical.Preference;
import smart_gs.smleditor.swingui.GSEditorFrame;
import smart_gs.smleditor.swingui.LineSegEditor;


public class LineSegEditorActionListener implements ActionListener {

	private GSEditorFrame parent;
	public LineSegEditorActionListener (GSEditorFrame parent) {
		this.parent = parent;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		ImageLabel.setLineVisible(true);
		if (parent.getSpread() == null) return;
		LineSegEditor editor = new LineSegEditor(parent.getSpread());
		editor.setMode(new LineSegEditorSelectMode(editor));
		editor.setVisible(true);
	}
}

