X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosCSVUI.java;h=95a8aeeaff9f64b22595bbd7cf08b708437e64f5;hp=e1b6002dfa23235d08a1fb5ae4a92a537be5e15e;hb=4ac7797d3efb9cc2d9fae88519f55e40b1050224;hpb=3fbefb3eea981d34a09496cf8abf0119de2e35bf diff --git a/altosui/AltosCSVUI.java b/altosui/AltosCSVUI.java index e1b6002d..95a8aeea 100644 --- a/altosui/AltosCSVUI.java +++ b/altosui/AltosCSVUI.java @@ -20,22 +20,18 @@ package altosui; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import javax.swing.filechooser.FileNameExtensionFilter; -import javax.swing.table.*; import java.io.*; -import java.util.*; -import java.text.*; -import java.util.prefs.*; -import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.altoslib_3.*; +import org.altusmetrum.altosuilib_1.*; public class AltosCSVUI - extends JDialog + extends AltosUIDialog implements ActionListener { JFileChooser csv_chooser; JPanel accessory; - JComboBox combo_box; - AltosRecordIterable iterable; + JComboBox combo_box; + Iterable states; AltosWriter writer; static String[] combo_box_items = { "Comma Separated Values (.CSV)", "Googleearth Data (.KML)" }; @@ -59,8 +55,8 @@ public class AltosCSVUI set_default_file(); } - public AltosCSVUI(JFrame frame, AltosRecordIterable in_iterable, File source_file) { - iterable = in_iterable; + public AltosCSVUI(JFrame frame, AltosStateIterable states, File source_file) { + this.states = states; csv_chooser = new JFileChooser(source_file); accessory = new JPanel(); @@ -77,7 +73,7 @@ public class AltosCSVUI c.gridy = 0; accessory.add(accessory_label, c); - combo_box = new JComboBox(combo_box_items); + combo_box = new JComboBox(combo_box_items); combo_box.addActionListener(this); c.gridx = 0; c.gridy = 1; @@ -95,11 +91,11 @@ public class AltosCSVUI writer = new AltosCSV(file); else writer = new AltosKML(file); - writer.write(iterable); + writer.write(states); writer.close(); } catch (FileNotFoundException ee) { JOptionPane.showMessageDialog(frame, - file.getName(), + ee.getMessage(), "Cannot open file", JOptionPane.ERROR_MESSAGE); }