X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosSiteMapPreload.java;h=8380b9673c253ec00f0954bc0e3d0beee4a0bcf3;hp=5de7a05edee77fde6c30cf7033117f76cae66dba;hb=4ac7797d3efb9cc2d9fae88519f55e40b1050224;hpb=7ecde50fbebe68a2e2200a2f8d081fd37074f840 diff --git a/altosui/AltosSiteMapPreload.java b/altosui/AltosSiteMapPreload.java index 5de7a05e..8380b967 100644 --- a/altosui/AltosSiteMapPreload.java +++ b/altosui/AltosSiteMapPreload.java @@ -18,21 +18,15 @@ package altosui; import java.awt.*; -import java.awt.image.*; import java.awt.event.*; import javax.swing.*; -import javax.swing.event.MouseInputAdapter; -import javax.imageio.ImageIO; -import javax.swing.table.*; import java.io.*; import java.util.*; import java.text.*; -import java.util.prefs.*; import java.lang.Math; -import java.awt.geom.Point2D; -import java.awt.geom.Line2D; import java.net.URL; import java.net.URLConnection; +import org.altusmetrum.altosuilib_1.*; class AltosMapPos extends Box { AltosUI owner; @@ -183,8 +177,8 @@ class AltosSites extends Thread { public void run() { try { URLConnection uc = url.openConnection(); - int length = uc.getContentLength(); - + //int length = uc.getContentLength(); + InputStreamReader in_stream = new InputStreamReader(uc.getInputStream(), Altos.unicode_set); BufferedReader in = new BufferedReader(in_stream); @@ -212,14 +206,14 @@ class AltosSites extends Thread { } } -public class AltosSiteMapPreload extends AltosDialog implements ActionListener, ItemListener { +public class AltosSiteMapPreload extends AltosUIDialog implements ActionListener, ItemListener { AltosUI owner; AltosSiteMap map; AltosMapPos lat; AltosMapPos lon; - final static int radius = 4; + final static int radius = 5; final static int width = (radius * 2 + 1); final static int height = (radius * 2 + 1); @@ -228,7 +222,7 @@ public class AltosSiteMapPreload extends AltosDialog implements ActionListener, AltosSites sites; JLabel site_list_label; JComboBox site_list; - + JToggleButton load_button; boolean loading; JButton close_button; @@ -332,7 +326,7 @@ public class AltosSiteMapPreload extends AltosDialog implements ActionListener, pane.setLayout(new GridBagLayout()); - map = new AltosSiteMap(4); + map = new AltosSiteMap(radius); c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; @@ -353,7 +347,7 @@ public class AltosSiteMapPreload extends AltosDialog implements ActionListener, pbar.setValue(0); pbar.setString(""); pbar.setStringPainted(true); - + c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.CENTER; c.insets = i; @@ -379,7 +373,7 @@ public class AltosSiteMapPreload extends AltosDialog implements ActionListener, c.gridwidth = 1; pane.add(site_list_label, c); - + site_list = new JComboBox(new String[] { "Site List" }); site_list.addItemListener(this); @@ -396,7 +390,7 @@ public class AltosSiteMapPreload extends AltosDialog implements ActionListener, c.gridwidth = 1; pane.add(site_list, c); - + lat = new AltosMapPos(owner, "Latitude:", lat_hemi_names, @@ -413,7 +407,7 @@ public class AltosSiteMapPreload extends AltosDialog implements ActionListener, c.anchor = GridBagConstraints.CENTER; pane.add(lat, c); - + lon = new AltosMapPos(owner, "Longitude:", lon_hemi_names, @@ -435,7 +429,7 @@ public class AltosSiteMapPreload extends AltosDialog implements ActionListener, load_button = new JToggleButton("Load Map"); load_button.addActionListener(this); load_button.setActionCommand("load"); - + c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.CENTER; c.insets = i; @@ -452,7 +446,7 @@ public class AltosSiteMapPreload extends AltosDialog implements ActionListener, close_button = new JButton("Close"); close_button.addActionListener(this); close_button.setActionCommand("close"); - + c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.CENTER; c.insets = i; @@ -470,4 +464,4 @@ public class AltosSiteMapPreload extends AltosDialog implements ActionListener, setLocationRelativeTo(owner); setVisible(true); } -} \ No newline at end of file +}