package smart_gs.swingui.toolbar.action;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.Point2D;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JFileChooser;
import javax.swing.JOptionPane;

import smart_gs.image_search.logical.TextType;
import smart_gs.logical.LineSegmentForEdit;
import smart_gs.logical.Preference;
import smart_gs.logical.Spread;
import smart_gs.smleditor.swingui.LineSegEditor;
import smart_gs.swingui.WorkspaceWindow;

public class SaveLineSegmentsInSegfoFormatAction implements ActionListener {
	private LineSegEditor editor;
	private Spread spread;
	private String file_name;
	private JFileChooser chooser;
	private boolean forced;

	public SaveLineSegmentsInSegfoFormatAction(LineSegEditor parent, boolean forced) {
		this.editor = parent;
		this.forced = forced;
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		this.editor.saveInSegfo(this.forced);
		WorkspaceWindow.getInstance().updateAndPaintSpreadTree();
	}

}
