[osm2garmin] r269 committed - Update Issue 132:...

12 views
Skip to first unread message

osm2g...@googlecode.com

unread,
Oct 11, 2014, 6:10:14 PM10/11/14
to mant...@gmail.com
Revision: 269
Author: mant...@gmail.com
Date: Sat Oct 11 22:09:54 2014 UTC
Log: Update Issue 132:
Created API extension Planet Torrent Creator. This allows to generate
latest Planet torrent in the current directory.
Changed default torrent download link.
Updated webseed download to simultaneously download from all available
mirrors.
Fixed problem with progress display in Ubuntu and possibly Mac OSX.
https://code.google.com/p/osm2garmin/source/detail?r=269

Added:

/trunk/Osm2garminAPI/src/main/java/org/mantlik/osm2garmin/PlanetTorrentCreator.java

/trunk/Osm2garminAPI/src/test/java/jbittorrentapi/GenerateHashesFromRemoteTest.java
Modified:
/trunk/Osm2garminAPI/src/main/java/jbittorrentapi/DownloadManager.java
/trunk/Osm2garminAPI/src/main/java/jbittorrentapi/Downloader.java
/trunk/Osm2garminAPI/src/main/java/jbittorrentapi/TorrentProcessor.java
/trunk/Osm2garminAPI/src/main/java/jbittorrentapi/WebseedTask.java
/trunk/Osm2garminAPI/src/main/resources/org/mantlik/osm2garmin/regions.txt

/trunk/Osm2garminAPI/src/main/resources/org/mantlik/osm2garmin/settings.properties
/trunk/Osm2garminGUI/nb-configuration.xml

/trunk/Osm2garminGUI/src/main/java/org/mantlik/osm2garminspi/DownloadsourcesPanel.form

/trunk/Osm2garminGUI/src/main/java/org/mantlik/osm2garminspi/DownloadsourcesPanel.java

/trunk/Osm2garminGUI/src/main/java/org/mantlik/osm2garminspi/MainWindowTopComponent.form

/trunk/Osm2garminGUI/src/main/java/org/mantlik/osm2garminspi/MainWindowTopComponent.java

=======================================
--- /dev/null
+++
/trunk/Osm2garminAPI/src/main/java/org/mantlik/osm2garmin/PlanetTorrentCreator.java
Sat Oct 11 22:09:54 2014 UTC
@@ -0,0 +1,185 @@
+/*
+ * #%L
+ * Osm2garminAPI
+ * %%
+ * Copyright (C) 2011 - 2014 Frantisek Mantlik <frantisek at mantlik.cz>
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+/*
+ * Copyright (C) 2014 frantisek
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
+ */
+package org.mantlik.osm2garmin;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.Scanner;
+import jbittorrentapi.TorrentFile;
+import jbittorrentapi.TorrentProcessor;
+
+/**
+ * Create Planet torrent file from the remote
+ *
+ * @author frantisek
+ */
+public class PlanetTorrentCreator {
+
+ private static final SimpleDateFormat DF = new
SimpleDateFormat("yyMMdd");
+ private static final String[] MIRRORS = {
+ "http://ftp.heanet.ie/mirrors/openstreetmap.org/pbf",
+ "http://ftp5.gwdg.de/pub/misc/openstreetmap/planet.openstreetmap.org//pbf",
+ "http://planet.openstreetmap.org/pbf"
+ };
+ private static final String[][] ANNOUNCE = {
+ {"http://www.mantlik.cz:80/tracker/announce.php"},
+ {"http://tracker.ipv6tracker.org:80/announce",
+ "udp://tracker.ipv6tracker.org:80/announce"},
+ {"udp://tracker.publicbt.com:80/announce",
+ "http://tracker.publicbt.com:80/announce"},
+ {"udp://tracker.openbittorrent.com:80/announce"},
+ {"http://open-tracker.appspot.com/announce"}
+ };
+ private static final int PIECE_LENGTH = 4 * 1024 * 1024;
+ private static final long MAX_PLANET_AGE = 31;
+
+ private String planetName;
+ private long planetLength;
+ private String md5;
+ private final String mirror = MIRRORS[(int)(Math.random() *
MIRRORS.length)];
+
+ private void findLastPlanetFile() {
+ long planetTime = System.currentTimeMillis();
+ planetLength = -1;
+ for (int i = 0; i < MAX_PLANET_AGE; i++) {
+ planetTime -= 1000l * 60 * 60 * 24;
+ String dd = DF.format(new Date(planetTime));
+ try {
+ URL url = new URL(mirror + "/" + "planet-" + dd
+ ".osm.pbf");
+ planetLength = url.openConnection().getContentLengthLong();
+ } catch (MalformedURLException ex) {
+ ex.printStackTrace();
+ } catch (IOException ex) {
+ System.out.println(ex.getMessage());
+ }
+ if (planetLength > 1000000000) {
+ planetName = "planet-" + dd + ".osm.pbf";
+ return;
+ }
+ }
+ }
+
+ private void downloadMD5() {
+ try {
+ HttpURLConnection connection = (HttpURLConnection) new
URL(mirror + "/" + planetName + ".md5").openConnection();
+ Scanner scanner = new Scanner(connection.getInputStream());
+ md5 = scanner.nextLine().substring(0, 32);
+ scanner.close();
+ } catch (MalformedURLException ex) {
+ ex.printStackTrace();
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ private void createTorrent() {
+ TorrentFile torrent = new TorrentFile();
+ torrent.announceURL = ANNOUNCE[0][0];
+ torrent.comment = "Original data from
http://planet.openstreetmap.org/ "
+ + "(C) OpenStreetMap contributors";
+ torrent.createdBy = "Osm2garmin 1.2";
+ torrent.creationDate = System.currentTimeMillis() / 1000;
+ for (String[] tierarr : ANNOUNCE) {
+ ArrayList<String> tier = new ArrayList<String>();
+ tier.addAll(Arrays.asList(tierarr));
+ torrent.announceList.add(tier);
+ }
+ torrent.changeAnnounce();
+ ArrayList<String> urlList = new ArrayList<String>();
+ for (String amirror : MIRRORS) {
+ urlList.add(amirror + "/" + planetName);
+ }
+ torrent.urlList.addAll(urlList);
+ torrent.setPieceLength(0, PIECE_LENGTH);
+ torrent.length.add(planetLength);
+ torrent.name.add(planetName);
+ TorrentProcessor tp = new TorrentProcessor(torrent);
+ ArrayList<String> md5list = new ArrayList<String>();
+ md5list.add(md5);
+ if (tp.generatePieceHashesFromRemote(MIRRORS, md5list.toArray(new
String[0]))) {
+ try {
+ FileOutputStream os = new FileOutputStream(planetName
+ ".torrent");
+ os.write(tp.generateTorrent());
+ os.close();
+ } catch (FileNotFoundException ex) {
+ ex.printStackTrace();
+ System.exit(9);
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ System.exit(9);
+ }
+ } else {
+ System.out.println("Torrent creation failed.");
+ }
+
+ }
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) {
+ PlanetTorrentCreator instance = new PlanetTorrentCreator();
+ instance.findLastPlanetFile();
+ if (instance.planetLength < 1000000000) {
+ System.out.println("Cannot find planet file not older than " +
MAX_PLANET_AGE +
+ " days at " + instance.mirror + ".");
+ System.exit(9);
+ }
+ System.out.println("Found " + instance.planetName + " (" +
instance.planetLength + " bytes)");
+ if (new File(instance.planetName + ".torrent").exists()) {
+ System.out.println(instance.planetName + ".torrent already
exists. Exiting.");
+ System.exit(0);
+ }
+ System.out.println("Downloading MD5 checksum.");
+ instance.downloadMD5();
+ System.out.println("Creating torrent file.");
+ instance.createTorrent();
+ System.out.println("Processing finished.");
+ }
+
+}
=======================================
--- /dev/null
+++
/trunk/Osm2garminAPI/src/test/java/jbittorrentapi/GenerateHashesFromRemoteTest.java
Sat Oct 11 22:09:54 2014 UTC
@@ -0,0 +1,89 @@
+/*
+ * #%L
+ * Osm2garminAPI
+ * %%
+ * Copyright (C) 2011 - 2014 Frantisek Mantlik <frantisek at mantlik.cz>
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+/*
+ * Copyright (C) 2014 frantisek
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
+ */
+package jbittorrentapi;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Scanner;
+import static org.junit.Assert.assertTrue;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ *
+ * @author frantisek
+ */
+public class GenerateHashesFromRemoteTest {
+
+ private static final String[] MIRRORS = {
+ "http://planet.openstreetmap.org/notes"
+ };
+ private static final String FILENAME = "planet-notes-latest.osn.bz2";
+ private static final int PIECE_LENGTH = 1024 * 1024;
+
+ @Ignore
+ @Test
+ public void testGenerateHashes() throws MalformedURLException,
IOException, NoSuchAlgorithmException {
+ System.out.println("Test Generate Hashes from Remote File");
+ TorrentFile torrent = new TorrentFile();
+ torrent.creationDate = System.currentTimeMillis() / 1000;
+ torrent.urlList.addAll(Arrays.asList(MIRRORS));
+ torrent.setPieceLength(0, PIECE_LENGTH);
+ torrent.name.add(FILENAME);
+ URL url = new URL(MIRRORS[0] + "/" + FILENAME);
+ HttpURLConnection connection = (HttpURLConnection)
url.openConnection();
+ long length = connection.getContentLengthLong();
+ torrent.length.add(length);
+ connection = (HttpURLConnection) new URL(MIRRORS[0] + "/" +
FILENAME + ".md5").openConnection();
+ Scanner scanner = new Scanner(connection.getInputStream());
+ String md5 = scanner.nextLine().substring(0, 32);
+ scanner.close();
+ System.out.println("MD5:" + md5);
+ TorrentProcessor tp = new TorrentProcessor(torrent);
+ ArrayList<String> md5list = new ArrayList<String>();
+ md5list.add(md5);
+ assertTrue("Hashes generation failed.",
tp.generatePieceHashesFromRemote(MIRRORS,
+ md5list.toArray(new String[0])));
+ }
+}
=======================================
--- /trunk/Osm2garminAPI/src/main/java/jbittorrentapi/DownloadManager.java
Fri May 18 11:17:43 2012 UTC
+++ /trunk/Osm2garminAPI/src/main/java/jbittorrentapi/DownloadManager.java
Sat Oct 11 22:09:54 2014 UTC
@@ -239,9 +239,11 @@
if (!initialized) {
init();
}
- DownloadTask dt = new WebseedTask(torrent.info_hash_as_binary,
clientID, this);
- task.put(WEBSEED_ID, dt);
- dt.start();
+ for (int i = 0; i < torrent.urlList.size(); i++) {
+ DownloadTask dt = new WebseedTask(torrent.info_hash_as_binary,
clientID, this, i+1);
+ task.put(WEBSEED_ID + (i+1), dt);
+ dt.start();
+ }
this.pu = new PeerUpdater(this.clientID, this.torrent);
this.pu.addPeerUpdateListener(this);
this.pu.setListeningPort(this.cl.getConnectedPort());
@@ -377,7 +379,7 @@
* for (int i = 0; i < this.output_files.length; i++) { try {
* this.output_files[i].close(); } catch (Exception e) {
* System.err.println(e.getMessage()); }
- }
+ }
*/
}

@@ -548,9 +550,9 @@
|| (this.isComplete.cardinality() > this.nbPieces - 3))
&& //(this.isRequested.cardinality() ==
this.nbPieces)) &&
(!this.isPieceComplete(startPiece + i))
- && (WEBSEED_ID.equals(id) ||
this.peerAvailabilies.get(id) != null)) {
+ && (id.contains(WEBSEED_ID) ||
this.peerAvailabilies.get(id) != null)) {

- if (WEBSEED_ID.equals(id) ||
this.peerAvailabilies.get(id).get(startPiece + i)) {
+ if (id.contains(WEBSEED_ID) ||
this.peerAvailabilies.get(id).get(startPiece + i)) {
possible.add(startPiece + i);
}
}
@@ -628,7 +630,7 @@
try {
this.task.get(it.next()).ms.addMessageToQueue(
new Message_PP(PeerProtocol.HAVE,
- Utils.intToByteArray(i), 1));
+ Utils.intToByteArray(i), 1));
} catch (NullPointerException npe) {
}
}
@@ -641,7 +643,7 @@
} catch (Exception ex) {
System.out.println(ex);
}
- if (!peerID.equals(WEBSEED_ID)) {
+ if (!peerID.contains(WEBSEED_ID)) {
this.lastPieceReceived = System.currentTimeMillis();
}

@@ -813,10 +815,10 @@
dt.ms.addMessageToQueue(new Message_PP(
PeerProtocol.PIECE,
Utils.concat(Utils.intToByteArray(piece),
- Utils.concat(Utils.intToByteArray(begin),
- this.getPieceBlock(piece,
- begin,
- length)))));
+ Utils.concat(Utils.intToByteArray(begin),
+ this.getPieceBlock(piece,
+ begin,
+ length)))));
dt.peer.setULRate(length);
}
dt = null;
=======================================
--- /trunk/Osm2garminAPI/src/main/java/jbittorrentapi/Downloader.java Thu
Apr 26 13:53:51 2012 UTC
+++ /trunk/Osm2garminAPI/src/main/java/jbittorrentapi/Downloader.java Sat
Oct 11 22:09:54 2014 UTC
@@ -28,6 +28,7 @@
import java.net.URL;
import java.util.Iterator;
import java.util.Observable;
+import org.openide.util.Exceptions;

/**
*
@@ -197,12 +198,11 @@
if (downloaded > 1) {
downloaded--; // overlap to process correctly fully
downloaded file
}
-

try {
// Open connection to URL.
- HttpURLConnection connection =
- (HttpURLConnection) url.openConnection();
+ HttpURLConnection connection
+ = (HttpURLConnection) url.openConnection();

// Specify what portion of file to download.
if (size < 1) {
@@ -232,6 +232,11 @@
System.out.print(requestProperties);
error();
}
+
+ if (connection.getHeaderField("content-length") == null) {
+ System.out.println("Server did not return content-length
header.");
+ error();
+ }

// Check for valid content length.
long contentLength =
Long.decode(connection.getHeaderField("content-length"));
@@ -289,7 +294,11 @@
stateChanged();
}
} catch (Exception e) {
- System.out.println("Download error.");
+ if (e.getMessage() != null) {
+ System.out.println("Download error " + e.getMessage()
+ ".");
+ } else {
+ Exceptions.printStackTrace(e);
+ }
error();
} finally {
// Close file.
=======================================
--- /trunk/Osm2garminAPI/src/main/java/jbittorrentapi/TorrentProcessor.java
Thu Jan 12 12:38:00 2012 UTC
+++ /trunk/Osm2garminAPI/src/main/java/jbittorrentapi/TorrentProcessor.java
Sat Oct 11 22:09:54 2014 UTC
@@ -40,8 +40,15 @@
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.nio.ByteBuffer;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
import java.util.*;
+import org.openide.util.Exceptions;

/**
*
@@ -211,8 +218,8 @@
this.torrent.name.add(new String((byte[])
info.get("name")));
}
// Fill in piece lengths
-
torrent.setPieceLength(torrent.piece_hash_values_as_binary.size()-1,
torrent.getPieceLength(0));
-
torrent.setPieceLength(torrent.piece_hash_values_as_binary.size()-1,
+
torrent.setPieceLength(torrent.piece_hash_values_as_binary.size() - 1,
torrent.getPieceLength(0));
+
torrent.setPieceLength(torrent.piece_hash_values_as_binary.size() - 1,
(int) (torrent.total_length %
torrent.getPieceLength(0)));
} else {
return null;
@@ -439,6 +446,133 @@
bb.array(), 0, bb.capacity() - bb.remaining())));
}
}
+
+ /**
+ * Generate the SHA-1 hashes for the file in the torrent in parameter
The
+ * file is not saved locally
+ *
+ * @param torr TorrentFile
+ * @param remote_urls Server addresses to be used to download the file
from
+ * @param md5list Optional MD5 hash, null if not provided
+ * @return true if successful
+ */
+ public boolean generatePieceHashesFromRemote(TorrentFile torr,
String[] remote_urls, String[] md5list) {
+ ByteBuffer bb = ByteBuffer.allocate(torr.getPieceLength(0));
+ int index = 0;
+ long total = 0;
+ MessageDigest md = null;
+ torr.piece_hash_values_as_binary.clear();
+ for (int i = 0; i < torr.name.size(); i++) {
+ String md5 = null;
+ if (md5list != null) {
+ md5 = md5list[i];
+ }
+ boolean compute_md5 = md5 != null;
+ long length = torr.length.get(i);
+ total += length;
+ String fname = (String) torr.name.get(i);
+ long processed = 0;
+ if (compute_md5) {
+ try {
+ md = MessageDigest.getInstance("MD5");
+ } catch (NoSuchAlgorithmException ex) {
+ Exceptions.printStackTrace(ex);
+ return false;
+ }
+ }
+ while (processed < length) {
+ InputStream fis = null;
+ try {
+ URL url = new URL(remote_urls[(int) (Math.random() *
remote_urls.length)] + "/" + fname);
+ HttpURLConnection connection = (HttpURLConnection)
url.openConnection();
+ connection.setRequestProperty("Range",
+ "bytes=" + processed + "-");
+ connection.connect();
+ if (connection.getResponseCode() / 100 != 2) {
+ System.out.println("Bad response code from
server " + connection.getResponseCode()
+ + " - " + connection.getResponseMessage()
+ ".");
+ continue;
+ }
+ long contentLength =
Long.decode(connection.getHeaderField("content-length"));
+ if (contentLength < 1) {
+ System.out.println("Bad file size reported from
server.");
+ continue;
+ }
+ fis = connection.getInputStream();
+ int read = 0;
+ int piece = (int) (processed /
torrent.getPieceLength(0));
+ int pieces = (int) (torr.length.get(i) /
torrent.getPieceLength(0));
+ byte[] data = new byte[torr.getPieceLength(0)];
+ System.out.println("Starting data download from " +
url.toExternalForm());
+ while ((read = fis.read(data, 0, bb.remaining())) !=
-1) {
+ if (compute_md5 && read > 0) {
+ md.update(data, 0, read);
+ }
+ bb.put(data, 0, read);
+ processed += read;
+ if (bb.remaining() == 0) {
+ torr.piece_hash_values_as_binary.put(index++,
Utils.hash(bb.array()));
+ bb.clear();
+ piece++;
+ System.out.print("Piece " + piece + " / " +
pieces + " \r");
+ }
+ }
+ fis.close();
+ System.out.println();
+ System.out.println("Finished download from " +
url.toExternalForm());
+ if (compute_md5) {
+ byte[] mdbytes = md.digest();
+ StringBuilder sb = new StringBuilder();
+ for (int j = 0; j < mdbytes.length; j++) {
+ sb.append(Integer.toString((mdbytes[j] & 0xff)
+ 0x100, 16).substring(1));
+ }
+ if
(!md5.trim().toLowerCase().contains(sb.toString().toLowerCase())) {
+ System.out.println(md5 + " != " +
sb.toString());
+ System.out.println("MD5 checksum of the file "
+ fname + " failed.");
+ return false;
+ } else {
+ System.out.println("MD5 checksum of the file "
+ fname +" OK.");
+ }
+ }
+ } catch (MalformedURLException ex) {
+ if (fis != null) {
+ try {
+ fis.close();
+ } catch (IOException ex1) {
+ Exceptions.printStackTrace(ex1);
+ }
+ }
+ System.out.println("\r\n" + ex.getMessage() + "
Retrying.");
+ } catch (IOException ex) {
+ if (fis != null) {
+ try {
+ fis.close();
+ } catch (IOException ex1) {
+ Exceptions.printStackTrace(ex1);
+ }
+ }
+ System.out.println("\r\n" + ex.getMessage() + "
Retrying.");
+ }
+ }
+ }
+ if (bb.remaining() != bb.capacity()) {
+ torr.piece_hash_values_as_binary.put(index++,
Utils.hash(Utils.subArray(
+ bb.array(), 0, bb.capacity() - bb.remaining())));
+ }
+ return true;
+ }
+
+ /**
+ * Generate the SHA-1 hashes for the file in the torrent in parameter
The
+ * file is not saved locally
+ *
+ * @param remote_urls Server address to be used to download the file
from
+ * @param md5 Optional MD5 hash list, null if not provided
+ * @return true if successful
+ */
+ public boolean generatePieceHashesFromRemote(String[] remote_urls,
String[] md5) {
+ return this.generatePieceHashesFromRemote(torrent, remote_urls,
md5);
+ }

/**
* Generate the SHA-1 hashes for the files in the current object
TorrentFile
@@ -465,6 +599,14 @@
if (torr.createdBy.length() > 0) {
map.put("created by", torr.createdBy);
}
+
+ if (! torr.announceList.isEmpty()) {
+ map.put("announce-list", torr.announceList);
+ }
+
+ if (! torr.urlList.isEmpty()) {
+ map.put("url-list", torr.urlList);
+ }

SortedMap info = new TreeMap();
if (torr.name.size() == 1) {
=======================================
--- /trunk/Osm2garminAPI/src/main/java/jbittorrentapi/WebseedTask.java Fri
May 18 11:17:43 2012 UTC
+++ /trunk/Osm2garminAPI/src/main/java/jbittorrentapi/WebseedTask.java Sat
Oct 11 22:09:54 2014 UTC
@@ -38,13 +38,15 @@
public class WebseedTask extends DownloadTask implements Observer {

private DownloadManager manager;
- private static final long MAX_IDLE_TIME = 60000; // start download
when no piece received for 60 sec
+ private static final long MAX_IDLE_TIME = 20000; // start download
when no piece received for 60 sec
public static boolean webseedActive = false;
private long sleepAfterError = 1000;
+ private int sequence = 1;

- public WebseedTask(byte[] fileID, byte[] myID, DownloadManager
manager) {
+ public WebseedTask(byte[] fileID, byte[] myID, DownloadManager
manager, int sequence) {
super(null, fileID, myID, false, null);
this.manager = manager;
+ this.sequence = sequence;
}

@Override
@@ -54,14 +56,13 @@
if (!manager.isComplete() && (System.currentTimeMillis() -
manager.lastPieceReceived) > MAX_IDLE_TIME) {
webseedActive = true;
downloadPiece = null;
- manager.peerReady(DownloadManager.WEBSEED_ID);
+ manager.peerReady(DownloadManager.WEBSEED_ID +
sequence);
if (downloadPiece != null) {
boolean breakDownload = false;
downloadPiece.clearData();
TreeMap<Integer, Long> offsets = (TreeMap<Integer,
Long>) downloadPiece.getFileAndOffset();
ArrayList<String> urls = manager.torrent.urlList;
- int index = (int) (Math.random() * urls.size());
- String url = urls.get(index);
+ String url = urls.get(sequence - 1);
int fileIndex = offsets.firstKey();
for (int i = 0; i < offsets.size(); i++) {
long offs = offsets.get(fileIndex);
@@ -80,7 +81,7 @@
}
if (downloader.getStatus() !=
Downloader.COMPLETE) {
downloader.cancel();
-
manager.pieceCompleted(DownloadManager.WEBSEED_ID,
downloadPiece.getIndex(), false);
+
manager.pieceCompleted(DownloadManager.WEBSEED_ID + sequence,
downloadPiece.getIndex(), false);
breakDownload = true;
continue;
}
@@ -103,9 +104,9 @@
continue;
}
if (downloadPiece.verify()) {
-
manager.pieceCompleted(DownloadManager.WEBSEED_ID,
downloadPiece.getIndex(), true);
+
manager.pieceCompleted(DownloadManager.WEBSEED_ID + sequence,
downloadPiece.getIndex(), true);
} else {
-
manager.pieceCompleted(DownloadManager.WEBSEED_ID,
downloadPiece.getIndex(), false);
+
manager.pieceCompleted(DownloadManager.WEBSEED_ID + sequence,
downloadPiece.getIndex(), false);
}
}
} else {
@@ -114,7 +115,7 @@
Thread.sleep(1000);
} catch (IOException ex) {
if (downloadPiece != null) {
- manager.pieceCompleted(DownloadManager.WEBSEED_ID,
downloadPiece.getIndex(), false);
+ manager.pieceCompleted(DownloadManager.WEBSEED_ID +
sequence, downloadPiece.getIndex(), false);
}
} catch (InterruptedException ex) {
}
=======================================
---
/trunk/Osm2garminAPI/src/main/resources/org/mantlik/osm2garmin/regions.txt
Thu Mar 28 20:31:23 2013 UTC
+++
/trunk/Osm2garminAPI/src/main/resources/org/mantlik/osm2garmin/regions.txt
Sat Oct 11 22:09:54 2014 UTC
@@ -1,13 +1,15 @@
-55 -50 180 10 australia_nz
--24 35 10 72 western_europe
-6 35 20 85 central_europe
-15 35 60 85 eastern_europe
--179 41 -13 85 canada_alasca
--105 26 -24 49 usa_east
--179 26 -95 49 usa_west
--179 5 -24 33 central_america
--179 -60 -24 15 south_america
-40 0 180 35 asia_south
-55 35 180 85 asia_north
--24 -5 60 40 africa_north
--24 -40 60 15 africa_south
+55.0 -50.0 180.0 10.0 australia_nz
+-24.0 45.0 10.0 72.0 western_europe
+-24.0 35.0 20.0 48.0 southern_europe
+6.0 45.0 20.0 85.0 central_europe
+15.0 35.0 60.0 85.0 eastern_europe
+-179.0 41.0 -13.0 85.0 canada_alasca
+-105.0 26.0 -24.0 49.0 usa_east
+-179.0 26.0 -95.0 49.0 usa_west
+-179.0 5.0 -24.0 33.0 central_america
+-179.0 -60.0 -24.0 15.0 south_america
+40.0 0.0 95.0 40.0 asia_south_west
+85.0 0.0 180.0 40.0 asia_south_east
+55.0 35.0 180.0 85.0 asia_north
+-24.0 -5.0 60.0 40.0 africa_north
+-24.0 -40.0 60.0 15.0 africa_south
=======================================
---
/trunk/Osm2garminAPI/src/main/resources/org/mantlik/osm2garmin/settings.properties
Sun Nov 25 10:49:58 2012 UTC
+++
/trunk/Osm2garminAPI/src/main/resources/org/mantlik/osm2garmin/settings.properties
Sat Oct 11 22:09:54 2014 UTC
@@ -74,7 +74,7 @@
# Download method torrent or http
download_method=torrent
# URL for download of torrent files planet-yymmdd.osm.bz2.torrent
-torrent_download_url=http://osm-torrent.torres.voyager.hr/files/
+torrent_download_url=http://www.mantlik.cz/tracker/torrents/
# Bittorrent client port range
torrent_port_start=6881
torrent_port_end=6999
=======================================
---
/trunk/Osm2garminGUI/src/main/java/org/mantlik/osm2garminspi/DownloadsourcesPanel.form
Wed Mar 21 13:38:53 2012 UTC
+++
/trunk/Osm2garminGUI/src/main/java/org/mantlik/osm2garminspi/DownloadsourcesPanel.form
Sat Oct 11 22:09:54 2014 UTC
@@ -62,7 +62,7 @@
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
- <Component id="jLabel7" alignment="1" pref="506"
max="32767" attributes="0"/>
+ <Component id="jLabel7" alignment="1" pref="0"
max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0"
attributes="0">
<Component id="jLabel21" alignment="0"
min="-2" max="-2" attributes="0"/>
=======================================
---
/trunk/Osm2garminGUI/src/main/java/org/mantlik/osm2garminspi/DownloadsourcesPanel.java
Wed Mar 21 13:38:53 2012 UTC
+++
/trunk/Osm2garminGUI/src/main/java/org/mantlik/osm2garminspi/DownloadsourcesPanel.java
Sat Oct 11 22:09:54 2014 UTC
@@ -342,7 +342,7 @@

private void
torrentDownloadUrlItemPropertyChange(java.beans.PropertyChangeEvent evt)
{//GEN-FIRST:event_torrentDownloadUrlItemPropertyChange
if
(!torrentDownloadUrlItem.getText().equals(NbPreferences.forModule(Osm2garmin.class).get("torrent_download_url",
- "http://osm-torrent.torres.voyager.hr/files/"))) {
+ "http://www.mantlik.cz/tracker/torrents/"))) {
controller.changed();
}
}//GEN-LAST:event_torrentDownloadUrlItemPropertyChange
@@ -396,7 +396,7 @@

+ "http://ftp5.gwdg.de/pub/misc/openstreetmap/planet.openstreetmap.org/,"
+ "http://planet.openstreetmap.org/").replace(",", "\n"));

torrentDownloadUrlItem.setText(NbPreferences.forModule(Osm2garmin.class).get("torrent_download_url",
- "http://osm-torrent.torres.voyager.hr/files/"));
+ "http://www.mantlik.cz/tracker/torrents/"));

torrentMethodItem.setSelected(NbPreferences.forModule(Osm2garmin.class)
.get("download_method", "torrent").equals("torrent"));

torrentPortStartItem.setText(NbPreferences.forModule(Osm2garmin.class).get("torrent_port_start",
=======================================
---
/trunk/Osm2garminGUI/src/main/java/org/mantlik/osm2garminspi/MainWindowTopComponent.form
Mon Jan 23 12:09:25 2012 UTC
+++
/trunk/Osm2garminGUI/src/main/java/org/mantlik/osm2garminspi/MainWindowTopComponent.form
Sat Oct 11 22:09:54 2014 UTC
@@ -26,7 +26,7 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
- <Component id="jPanel7" min="-2" max="-2" attributes="0"/>
+ <Component id="jPanel7" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@@ -36,12 +36,13 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" alignment="0" attributes="0">
+ <Component id="jPanel6" max="32767" attributes="0"/>
+ <Group type="102" attributes="0">
<Group type="103" groupAlignment="0"
attributes="0">
- <Component id="overallProgress" max="32767"
attributes="0"/>
+ <Component id="overallProgress" pref="472"
max="32767" attributes="0"/>
<Component id="jLabel5" alignment="0"
min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
@@ -49,7 +50,6 @@
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="cancelButton" linkSize="1"
min="-2" pref="103" max="-2" attributes="0"/>
</Group>
- <Component id="jPanel6" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
@@ -58,9 +58,9 @@
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
- <EmptySpace max="-2" attributes="0"/>
- <Component id="jPanel6" min="-2" pref="312" max="-2"
attributes="0"/>
- <EmptySpace type="separate" max="-2" attributes="0"/>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
+ <Component id="jPanel6" max="32767" attributes="0"/>
+ <EmptySpace type="separate" min="-2" max="-2"
attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="103" alignment="1" groupAlignment="3"
attributes="0">
<Component id="cancelButton" alignment="3"
min="-2" max="-2" attributes="0"/>
@@ -72,7 +72,7 @@
<Component id="overallProgress" min="-2"
max="-2" attributes="0"/>
</Group>
</Group>
- <EmptySpace max="32767" attributes="0"/>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -132,13 +132,13 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
- <EmptySpace max="-2" attributes="0"/>
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
- <Component id="jPanel8" min="-2" max="32767"
attributes="0"/>
- <Component id="jPanel9" alignment="0" min="-2"
max="32767" attributes="0"/>
+ <Component id="jPanel8" max="32767"
attributes="0"/>
+ <Component id="jPanel9" max="32767"
attributes="0"/>
</Group>
- <EmptySpace max="-2" attributes="0"/>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -147,8 +147,8 @@
<Group type="102" attributes="0">
<Component id="jPanel8" min="-2" pref="167" max="-2"
attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
- <Component id="jPanel9" min="-2" pref="132" max="-2"
attributes="0"/>
- <EmptySpace max="32767" attributes="0"/>
+ <Component id="jPanel9" max="32767" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -169,221 +169,150 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" alignment="0" attributes="0">
- <EmptySpace max="-2" attributes="0"/>
+ <Group type="102" attributes="0">
<Group type="103" groupAlignment="0"
attributes="0">
- <Component id="jPanel3" max="32767"
attributes="0"/>
- <Component id="jPanel2" max="32767"
attributes="0"/>
- <Component id="jPanel1" alignment="0"
max="32767" attributes="0"/>
+ <Component id="jLabel1" linkSize="3"
alignment="1" min="-2" pref="175" max="-2" attributes="0"/>
+ <Component id="jLabel2" linkSize="3"
alignment="1" min="-2" max="-2" attributes="0"/>
+ <Component id="jLabel3" linkSize="3"
alignment="1" min="-2" pref="173" max="-2" attributes="0"/>
</Group>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0"
attributes="0">
+ <Component id="planetUpdateStatus"
max="32767" attributes="0"/>
+ <Component id="jScrollPane1" alignment="1"
max="32767" attributes="0"/>
+ <Component id="planetDownloadStatus"
alignment="0" max="32767" attributes="0"/>
+ <Component id="planetUpdateDownloadStatus"
alignment="0" max="32767" attributes="0"/>
+ </Group>
+ <EmptySpace min="13" pref="13" max="-2"
attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
- <Component id="jPanel1" min="-2" pref="57"
max="-2" attributes="0"/>
- <EmptySpace max="32767" attributes="0"/>
- <Component id="jPanel2" min="-2" max="-2"
attributes="0"/>
+ <Component id="jScrollPane1" min="-2" max="-2"
attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
- <Component id="jPanel3" min="-2" max="-2"
attributes="0"/>
- <EmptySpace min="-2" pref="68" max="-2"
attributes="0"/>
+ <Group type="103" groupAlignment="3"
attributes="0">
+ <Component id="jLabel1" alignment="3"
min="-2" max="-2" attributes="0"/>
+ <Component id="planetDownloadStatus"
alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace min="-2" pref="11" max="-2"
attributes="0"/>
+ <Group type="103" groupAlignment="3"
attributes="0">
+ <Component id="planetUpdateDownloadStatus"
alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="jLabel2" alignment="3"
max="32767" attributes="0"/>
+ </Group>
+ <EmptySpace min="-2" pref="15" max="-2"
attributes="0"/>
+ <Group type="103" groupAlignment="3"
attributes="0">
+ <Component id="planetUpdateStatus"
alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="jLabel3" alignment="3"
min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace min="-2" pref="80" max="-2"
attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
- <Container class="javax.swing.JPanel" name="jPanel2">
+ <Component class="javax.swing.JTextField"
name="planetDownloadStatus">
+ <Properties>
+ <Property name="editable" type="boolean"
value="false"/>
+ <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.planetDownloadStatus.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.planetDownloadStatus.toolTipText"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_CreateCodeCustom"
type="java.lang.String" value="new JTextFieldImage()"/>
+ </AuxValues>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel1">
+ <Properties>
+ <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.jLabel1.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Container class="javax.swing.JScrollPane"
name="jScrollPane1">
+ <Properties>
+ <Property name="border"
type="javax.swing.border.Border"
editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="null"/>
+ </Property>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="autoScrollPane"
type="java.lang.Boolean" value="true"/>
+ </AuxValues>

- <Layout>
- <DimensionLayout dim="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
- <EmptySpace max="-2" attributes="0"/>
- <Component id="jLabel2" min="-2" pref="146"
max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="planetUpdateDownloadStatus"
max="32767" attributes="0"/>
- <EmptySpace min="-2" pref="14" max="-2"
attributes="0"/>
- </Group>
- </Group>
- </DimensionLayout>
- <DimensionLayout dim="1">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" alignment="0" attributes="0">
- <Group type="103" groupAlignment="3"
attributes="0">
- <Component
id="planetUpdateDownloadStatus" alignment="3" min="-2" max="-2"
attributes="0"/>
- <Component id="jLabel2" alignment="3"
min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace min="0" pref="10" max="32767"
attributes="0"/>
- </Group>
- </Group>
- </DimensionLayout>
- </Layout>
+ <Layout
class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
- <Component class="javax.swing.JTextField"
name="planetUpdateDownloadStatus">
+ <Component class="javax.swing.JTextPane"
name="torrentStatusItem">
<Properties>
<Property name="editable" type="boolean"
value="false"/>
- <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.planetUpdateDownloadStatus.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ <Property name="border"
type="javax.swing.border.Border"
editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="null"/>
</Property>
- <Property name="toolTipText"
type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.planetUpdateDownloadStatus.toolTipText"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ <Property name="contentType"
type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.torrentStatusItem.contentType_1"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
</Property>
- </Properties>
- <AuxValues>
- <AuxValue
name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String"
value="new JTextFieldImage()"/>
- </AuxValues>
- </Component>
- <Component class="javax.swing.JLabel" name="jLabel2">
- <Properties>
- <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.jLabel2.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ <Property name="text" type="java.lang.String"
value="&lt;html&gt;&#xd;&#xa; &lt;head&gt;&#xd;&#xa;&#xd;
&lt;style&gt;body {text-align: right}&lt;/style&gt;&#xa;
&lt;/head&gt;&#xd;&#xa; &lt;body&gt;&#xd;&#xa;No active downloads.&#xa;
&lt;/body&gt;&#xd;&#xa;&lt;/html&gt;&#xd;&#xa;" noResource="true"/>
+ <Property name="margin" type="java.awt.Insets"
editor="org.netbeans.beaninfo.editors.InsetsEditor">
+ <Insets value="[0, 0, 0, 0]"/>
</Property>
- </Properties>
- </Component>
- </SubComponents>
- </Container>
- <Container class="javax.swing.JPanel" name="jPanel3">
-
- <Layout>
- <DimensionLayout dim="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
- <EmptySpace max="-2" attributes="0"/>
- <Component id="jLabel3" min="-2" pref="146"
max="-2" attributes="0"/>
- <EmptySpace min="-2" pref="7" max="-2"
attributes="0"/>
- <Component id="planetUpdateStatus"
max="32767" attributes="0"/>
- <EmptySpace min="-2" pref="14" max="-2"
attributes="0"/>
- </Group>
- </Group>
- </DimensionLayout>
- <DimensionLayout dim="1">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" alignment="0" attributes="0">
- <Group type="103" groupAlignment="3"
attributes="0">
- <Component id="planetUpdateStatus"
alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="jLabel3" alignment="3"
min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace min="0" pref="11" max="32767"
attributes="0"/>
- </Group>
- </Group>
- </DimensionLayout>
- </Layout>
- <SubComponents>
- <Component class="javax.swing.JTextField"
name="planetUpdateStatus">
- <Properties>
- <Property name="editable" type="boolean"
value="false"/>
- <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.planetUpdateStatus.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ <Property name="minimumSize"
type="java.awt.Dimension"
editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[10, 10]"/>
</Property>
- <Property name="toolTipText"
type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.planetUpdateStatus.toolTipText"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ <Property name="name" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.torrentStatusItem.name"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
</Property>
+ <Property name="opaque" type="boolean"
value="false"/>
</Properties>
- <AuxValues>
- <AuxValue
name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String"
value="new JTextFieldImage()"/>
- </AuxValues>
- </Component>
- <Component class="javax.swing.JLabel" name="jLabel3">
- <Properties>
- <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.jLabel3.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
- </Property>
- </Properties>
</Component>
</SubComponents>
</Container>
- <Container class="javax.swing.JPanel" name="jPanel1">
-
- <Layout>
- <DimensionLayout dim="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" alignment="0" attributes="0">
- <EmptySpace max="-2" attributes="0"/>
- <Component id="jLabel1" min="-2" pref="146"
max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="0"
attributes="0">
- <Component id="planetDownloadStatus"
pref="334" max="32767" attributes="0"/>
- <Component id="jScrollPane1" max="32767"
attributes="0"/>
- </Group>
- <EmptySpace max="-2" attributes="0"/>
- </Group>
- </Group>
- </DimensionLayout>
- <DimensionLayout dim="1">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
- <Component id="jScrollPane1" min="-2"
max="-2" attributes="0"/>
- <EmptySpace max="32767" attributes="0"/>
- <Group type="103" groupAlignment="3"
attributes="0">
- <Component id="jLabel1" alignment="3"
min="-2" max="-2" attributes="0"/>
- <Component id="planetDownloadStatus"
alignment="3" min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace max="-2" attributes="0"/>
- </Group>
- </Group>
- </DimensionLayout>
- </Layout>
- <SubComponents>
- <Component class="javax.swing.JTextField"
name="planetDownloadStatus">
- <Properties>
- <Property name="editable" type="boolean"
value="false"/>
- <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.planetDownloadStatus.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
- </Property>
- <Property name="toolTipText"
type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.planetDownloadStatus.toolTipText"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
- </Property>
- </Properties>
- <AuxValues>
- <AuxValue
name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String"
value="new JTextFieldImage()"/>
- </AuxValues>
- </Component>
- <Component class="javax.swing.JLabel" name="jLabel1">
- <Properties>
- <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.jLabel1.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
- </Property>
- </Properties>
- </Component>
- <Container class="javax.swing.JScrollPane"
name="jScrollPane1">
- <Properties>
- <Property name="border"
type="javax.swing.border.Border"
editor="org.netbeans.modules.form.editors2.BorderEditor">
- <Border info="null"/>
- </Property>
- </Properties>
- <AuxValues>
- <AuxValue name="autoScrollPane"
type="java.lang.Boolean" value="true"/>
- </AuxValues>
-
- <Layout
class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
- <SubComponents>
- <Component class="javax.swing.JTextPane"
name="torrentStatusItem">
- <Properties>
- <Property name="border"
type="javax.swing.border.Border"
editor="org.netbeans.modules.form.editors2.BorderEditor">
- <Border info="null"/>
- </Property>
- <Property name="contentType"
type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.torrentStatusItem.contentType_1"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
- </Property>
- <Property name="editable" type="boolean"
value="false"/>
- <Property name="text" type="java.lang.String"
value="&lt;html&gt;&#xd;&#xa; &lt;head&gt;&#xd;&#xa;&#xd;
&lt;style&gt;body {text-align: right}&lt;/style&gt;&#xa;
&lt;/head&gt;&#xd;&#xa; &lt;body&gt;&#xd;&#xa;No active downloads.&#xa;
&lt;/body&gt;&#xd;&#xa;&lt;/html&gt;&#xd;&#xa;" noResource="true"/>
- <Property name="margin" type="java.awt.Insets"
editor="org.netbeans.beaninfo.editors.InsetsEditor">
- <Insets value="[0, 0, 0, 0]"/>
- </Property>
- <Property name="minimumSize"
type="java.awt.Dimension"
editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[10, 10]"/>
- </Property>
- <Property name="name" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.torrentStatusItem.name"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
- </Property>
- <Property name="opaque" type="boolean"
value="false"/>
- </Properties>
- </Component>
- </SubComponents>
- </Container>
- </SubComponents>
- </Container>
+ <Component class="javax.swing.JLabel" name="jLabel2">
+ <Properties>
+ <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.jLabel2.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField"
name="planetUpdateStatus">
+ <Properties>
+ <Property name="editable" type="boolean"
value="false"/>
+ <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.planetUpdateStatus.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.planetUpdateStatus.toolTipText"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_CreateCodeCustom"
type="java.lang.String" value="new JTextFieldImage()"/>
+ </AuxValues>
+ </Component>
+ <Component class="javax.swing.JTextField"
name="planetUpdateDownloadStatus">
+ <Properties>
+ <Property name="editable" type="boolean"
value="false"/>
+ <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.planetUpdateDownloadStatus.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.planetUpdateDownloadStatus.toolTipText"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ <Property name="maximumSize" type="java.awt.Dimension"
editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[3000, 2147483647]"/>
+ </Property>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_CreateCodeCustom"
type="java.lang.String" value="new JTextFieldImage()"/>
+ </AuxValues>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel3">
+ <Properties>
+ <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.jLabel3.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ </Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel9">
@@ -401,136 +330,93 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
- <Component id="jPanel5" max="32767" attributes="0"/>
- <Component id="jPanel4" max="32767" attributes="0"/>
+ <Group type="102" attributes="0">
+ <EmptySpace min="-2" max="-2" attributes="0"/>
+ <Component id="regionLabel" max="32767"
attributes="0"/>
+ </Group>
+ <Group type="102" alignment="0" attributes="0">
+ <Group type="103" groupAlignment="1" max="-2"
attributes="0">
+ <Component id="jLabel4" linkSize="6"
pref="189" max="32767" attributes="0"/>
+ <Component id="jLabel6" linkSize="6"
max="32767" attributes="0"/>
+ </Group>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0"
attributes="0">
+ <Component id="contoursStatus" max="32767"
attributes="0"/>
+ <Component id="regionsStatus" max="32767"
attributes="0"/>
+ </Group>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
+ </Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
- <Component id="jPanel5" min="-2" pref="57"
max="-2" attributes="0"/>
- <EmptySpace type="unrelated" max="-2"
attributes="0"/>
- <Component id="jPanel4" min="-2" max="-2"
attributes="0"/>
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="regionLabel" min="-2" pref="15"
max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3"
attributes="0">
+ <Component id="contoursStatus" alignment="3"
min="-2" max="-2" attributes="0"/>
+ <Component id="jLabel6" alignment="3"
min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace type="unrelated" max="-2"
attributes="0"/>
+ <Group type="103" groupAlignment="3"
attributes="0">
+ <Component id="regionsStatus" alignment="3"
min="-2" max="-2" attributes="0"/>
+ <Component id="jLabel4" alignment="3"
min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace min="0" pref="9" max="32767"
attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
- <Container class="javax.swing.JPanel" name="jPanel4">
-
- <Layout>
- <DimensionLayout dim="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
- <EmptySpace max="-2" attributes="0"/>
- <Component id="jLabel4" min="-2" pref="146"
max="-2" attributes="0"/>
- <EmptySpace min="-2" pref="7" max="-2"
attributes="0"/>
- <Component id="regionsStatus" max="32767"
attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- </Group>
- </Group>
- </DimensionLayout>
- <DimensionLayout dim="1">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" alignment="0" attributes="0">
- <Group type="103" groupAlignment="3"
attributes="0">
- <Component id="regionsStatus"
alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="jLabel4" alignment="3"
min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace min="0" pref="10" max="32767"
attributes="0"/>
- </Group>
- </Group>
- </DimensionLayout>
- </Layout>
- <SubComponents>
- <Component class="javax.swing.JTextField"
name="regionsStatus">
- <Properties>
- <Property name="editable" type="boolean"
value="false"/>
- <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.regionsStatus.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
- </Property>
- <Property name="toolTipText"
type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.regionsStatus.toolTipText"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
- </Property>
- </Properties>
- <AuxValues>
- <AuxValue
name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String"
value="new JTextFieldImage()"/>
- </AuxValues>
- </Component>
- <Component class="javax.swing.JLabel" name="jLabel4">
- <Properties>
- <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.jLabel4.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
- </Property>
- </Properties>
- </Component>
- </SubComponents>
- </Container>
- <Container class="javax.swing.JPanel" name="jPanel5">
-
- <Layout>
- <DimensionLayout dim="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
- <EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="0"
attributes="0">
- <Group type="102" alignment="0"
attributes="0">
- <Component id="jLabel6" min="-2"
pref="146" max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="contoursStatus"
max="32767" attributes="0"/>
- </Group>
- <Component id="regionLabel"
alignment="0" max="32767" attributes="0"/>
- </Group>
- <EmptySpace max="-2" attributes="0"/>
- </Group>
- </Group>
- </DimensionLayout>
- <DimensionLayout dim="1">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" alignment="0" attributes="0">
- <Component id="regionLabel" min="-2"
pref="15" max="-2" attributes="0"/>
- <EmptySpace type="unrelated" max="-2"
attributes="0"/>
- <Group type="103" groupAlignment="3"
attributes="0">
- <Component id="contoursStatus"
alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="jLabel6" alignment="3"
min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace max="-2" attributes="0"/>
- </Group>
- </Group>
- </DimensionLayout>
- </Layout>
- <SubComponents>
- <Component class="javax.swing.JLabel"
name="regionLabel">
- <Properties>
- <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.regionLabel.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
- </Property>
- </Properties>
- </Component>
- <Component class="javax.swing.JTextField"
name="contoursStatus">
- <Properties>
- <Property name="editable" type="boolean"
value="false"/>
- <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.contoursStatus.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
- </Property>
- <Property name="toolTipText"
type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.contoursStatus.toolTipText"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
- </Property>
- </Properties>
- <AuxValues>
- <AuxValue
name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String"
value="new JTextFieldImage()"/>
- </AuxValues>
- </Component>
- <Component class="javax.swing.JLabel" name="jLabel6">
- <Properties>
- <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.jLabel6.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
- </Property>
- </Properties>
- </Component>
- </SubComponents>
- </Container>
+ <Component class="javax.swing.JLabel" name="regionLabel">
+ <Properties>
+ <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.regionLabel.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField"
name="contoursStatus">
+ <Properties>
+ <Property name="editable" type="boolean"
value="false"/>
+ <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.contoursStatus.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.contoursStatus.toolTipText"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_CreateCodeCustom"
type="java.lang.String" value="new JTextFieldImage()"/>
+ </AuxValues>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel6">
+ <Properties>
+ <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.jLabel6.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField"
name="regionsStatus">
+ <Properties>
+ <Property name="editable" type="boolean"
value="false"/>
+ <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.regionsStatus.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.regionsStatus.toolTipText"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_CreateCodeCustom"
type="java.lang.String" value="new JTextFieldImage()"/>
+ </AuxValues>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel4">
+ <Properties>
+ <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/mantlik/osm2garminspi/Bundle.properties"
key="MainWindowTopComponent.jLabel4.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
&quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ </Component>
</SubComponents>
</Container>
</SubComponents>
=======================================
---
/trunk/Osm2garminGUI/src/main/java/org/mantlik/osm2garminspi/MainWindowTopComponent.java
Sun Nov 25 10:49:58 2012 UTC
+++
/trunk/Osm2garminGUI/src/main/java/org/mantlik/osm2garminspi/MainWindowTopComponent.java
Sat Oct 11 22:09:54 2014 UTC
@@ -21,6 +21,7 @@
*/
package org.mantlik.osm2garminspi;

+import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
@@ -59,17 +60,17 @@
* Top component which displays something.
*/
@ConvertAsProperties(dtd = "-//org.mantlik.osm2garmin.gui//MainWindow//EN",
-autostore = false)
+ autostore = false)
@TopComponent.Description(preferredID = "MainWindowTopComponent",
-iconBase = "org/mantlik/osm2garmin/gui/Globe16.png",
-persistenceType = TopComponent.PERSISTENCE_ALWAYS)
+ iconBase = "org/mantlik/osm2garmin/gui/Globe16.png",
+ persistenceType = TopComponent.PERSISTENCE_ALWAYS)
@TopComponent.Registration(mode = "editor", openAtStartup = true)
@ActionID(category = "Window", id
= "org.mantlik.osm2garmin.gui.MainWindowTopComponent")
@ActionReference(path = "Menu/Window" /*
* , position = 333
*/)
@TopComponent.OpenActionRegistration(displayName = "#CTL_MainWindowAction",
-preferredID = "MainWindowTopComponent")
+ preferredID = "MainWindowTopComponent")
@Messages({
"CTL_MainWindowAction=MainWindow",
"CTL_MainWindowTopComponent=MainWindow",
@@ -88,6 +89,7 @@
new Color(200, 200, 200), new Color(51, 153, 255), new Color(127,
255, 127),
new Color(255, 127, 127)
};
+ private static final Color OPAQUE = new Color(0, 0, 0, 0);
private float[] ulsp = new float[100], dlsp = new float[100];
private boolean stopped = false;

@@ -176,25 +178,20 @@
cancelButton = new javax.swing.JButton();
jPanel6 = new javax.swing.JPanel();
jPanel8 = new javax.swing.JPanel();
- jPanel2 = new javax.swing.JPanel();
- planetUpdateDownloadStatus = new JTextFieldImage();
- jLabel2 = new javax.swing.JLabel();
- jPanel3 = new javax.swing.JPanel();
- planetUpdateStatus = new JTextFieldImage();
- jLabel3 = new javax.swing.JLabel();
- jPanel1 = new javax.swing.JPanel();
planetDownloadStatus = new JTextFieldImage();
jLabel1 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
torrentStatusItem = new javax.swing.JTextPane();
+ jLabel2 = new javax.swing.JLabel();
+ planetUpdateStatus = new JTextFieldImage();
+ planetUpdateDownloadStatus = new JTextFieldImage();
+ jLabel3 = new javax.swing.JLabel();
jPanel9 = new javax.swing.JPanel();
- jPanel4 = new javax.swing.JPanel();
- regionsStatus = new JTextFieldImage();
- jLabel4 = new javax.swing.JLabel();
- jPanel5 = new javax.swing.JPanel();
regionLabel = new javax.swing.JLabel();
contoursStatus = new JTextFieldImage();
jLabel6 = new javax.swing.JLabel();
+ regionsStatus = new JTextFieldImage();
+ jLabel4 = new javax.swing.JLabel();


setDisplayName(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.displayName"));
// NOI18N

@@ -224,58 +221,6 @@


jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(null,
org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.jPanel8.border.title"),
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new
java.awt.Color(51, 153, 255))); // NOI18N

- planetUpdateDownloadStatus.setEditable(false);
-
planetUpdateDownloadStatus.setText(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.planetUpdateDownloadStatus.text"));
// NOI18N
-
planetUpdateDownloadStatus.setToolTipText(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.planetUpdateDownloadStatus.toolTipText"));
// NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(jLabel2,
org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.jLabel2.text"));
// NOI18N
-
- javax.swing.GroupLayout jPanel2Layout = new
javax.swing.GroupLayout(jPanel2);
- jPanel2.setLayout(jPanel2Layout);
- jPanel2Layout.setHorizontalGroup(
-
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel2Layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel2,
javax.swing.GroupLayout.PREFERRED_SIZE, 146,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(planetUpdateDownloadStatus)
- .addGap(14, 14, 14))
- );
- jPanel2Layout.setVerticalGroup(
-
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel2Layout.createSequentialGroup()
- .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(planetUpdateDownloadStatus,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel2))
- .addGap(0, 10, Short.MAX_VALUE))
- );
-
- planetUpdateStatus.setEditable(false);
-
planetUpdateStatus.setText(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.planetUpdateStatus.text"));
// NOI18N
-
planetUpdateStatus.setToolTipText(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.planetUpdateStatus.toolTipText"));
// NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(jLabel3,
org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.jLabel3.text"));
// NOI18N
-
- javax.swing.GroupLayout jPanel3Layout = new
javax.swing.GroupLayout(jPanel3);
- jPanel3.setLayout(jPanel3Layout);
- jPanel3Layout.setHorizontalGroup(
-
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel3Layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 146,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(7, 7, 7)
- .addComponent(planetUpdateStatus)
- .addGap(14, 14, 14))
- );
- jPanel3Layout.setVerticalGroup(
-
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel3Layout.createSequentialGroup()
- .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(planetUpdateStatus,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel3))
- .addGap(0, 11, Short.MAX_VALUE))
- );
-
planetDownloadStatus.setEditable(false);

planetDownloadStatus.setText(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.planetDownloadStatus.text"));
// NOI18N

planetDownloadStatus.setToolTipText(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.planetDownloadStatus.toolTipText"));
// NOI18N
@@ -284,9 +229,9 @@

jScrollPane1.setBorder(null);

+ torrentStatusItem.setEditable(false);
torrentStatusItem.setBorder(null);

torrentStatusItem.setContentType(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.torrentStatusItem.contentType_1"));
// NOI18N
- torrentStatusItem.setEditable(false);
torrentStatusItem.setText("<html>\r\n <head>\r\n\r <style>body
{text-align: right}</style>\n </head>\r\n <body>\r\nNo active
downloads.\n </body>\r\n</html>\r\n"); // NOI18N
torrentStatusItem.setMargin(new java.awt.Insets(0, 0, 0, 0));
torrentStatusItem.setMinimumSize(new java.awt.Dimension(10, 10));
@@ -294,80 +239,60 @@
torrentStatusItem.setOpaque(false);
jScrollPane1.setViewportView(torrentStatusItem);

- javax.swing.GroupLayout jPanel1Layout = new
javax.swing.GroupLayout(jPanel1);
- jPanel1.setLayout(jPanel1Layout);
- jPanel1Layout.setHorizontalGroup(
-
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 146,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(planetDownloadStatus,
javax.swing.GroupLayout.DEFAULT_SIZE, 334, Short.MAX_VALUE)
- .addComponent(jScrollPane1))
- .addContainerGap())
- );
- jPanel1Layout.setVerticalGroup(
-
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel1)
- .addComponent(planetDownloadStatus,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap())
- );
+ org.openide.awt.Mnemonics.setLocalizedText(jLabel2,
org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.jLabel2.text"));
// NOI18N
+
+ planetUpdateStatus.setEditable(false);
+
planetUpdateStatus.setText(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.planetUpdateStatus.text"));
// NOI18N
+
planetUpdateStatus.setToolTipText(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.planetUpdateStatus.toolTipText"));
// NOI18N
+
+ planetUpdateDownloadStatus.setEditable(false);
+
planetUpdateDownloadStatus.setText(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.planetUpdateDownloadStatus.text"));
// NOI18N
+
planetUpdateDownloadStatus.setToolTipText(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.planetUpdateDownloadStatus.toolTipText"));
// NOI18N
+ planetUpdateDownloadStatus.setMaximumSize(new
java.awt.Dimension(3000, 2147483647));
+
+ org.openide.awt.Mnemonics.setLocalizedText(jLabel3,
org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.jLabel3.text"));
// NOI18N

javax.swing.GroupLayout jPanel8Layout = new
javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(

jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
- .addContainerGap()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jPanel3,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
- .addComponent(jPanel2,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
- .addComponent(jPanel1,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)))
+ .addComponent(jLabel1,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 175,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel2,
javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(jLabel3,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 173,
javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(planetUpdateStatus)
+ .addComponent(jScrollPane1,
javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(planetDownloadStatus)
+ .addComponent(planetUpdateDownloadStatus,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
+ .addGap(13, 13, 13))
);
+
+ jPanel8Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new
java.awt.Component[] {jLabel1, jLabel2, jLabel3});
+
jPanel8Layout.setVerticalGroup(

jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
- .addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 57,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
- .addComponent(jPanel2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jPanel3,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(68, 68, 68))
+ .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel1)
+ .addComponent(planetDownloadStatus,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(11, 11, 11)
+ .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(planetUpdateDownloadStatus,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel2,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
+ .addGap(15, 15, 15)
+ .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(planetUpdateStatus,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel3))
+ .addGap(80, 80, 80))
);


jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(null,
org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.jPanel9.border.title"),
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new
java.awt.Color(51, 153, 255))); // NOI18N

- regionsStatus.setEditable(false);
-
regionsStatus.setText(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.regionsStatus.text"));
// NOI18N
-
regionsStatus.setToolTipText(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.regionsStatus.toolTipText"));
// NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(jLabel4,
org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.jLabel4.text"));
// NOI18N
-
- javax.swing.GroupLayout jPanel4Layout = new
javax.swing.GroupLayout(jPanel4);
- jPanel4.setLayout(jPanel4Layout);
- jPanel4Layout.setHorizontalGroup(
-
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel4Layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel4,
javax.swing.GroupLayout.PREFERRED_SIZE, 146,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(7, 7, 7)
- .addComponent(regionsStatus)
- .addContainerGap())
- );
- jPanel4Layout.setVerticalGroup(
-
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel4Layout.createSequentialGroup()
- .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(regionsStatus,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel4))
- .addGap(0, 10, Short.MAX_VALUE))
- );
-
org.openide.awt.Mnemonics.setLocalizedText(regionLabel,
org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.regionLabel.text"));
// NOI18N

contoursStatus.setEditable(false);
@@ -376,45 +301,45 @@

org.openide.awt.Mnemonics.setLocalizedText(jLabel6,
org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.jLabel6.text"));
// NOI18N

- javax.swing.GroupLayout jPanel5Layout = new
javax.swing.GroupLayout(jPanel5);
- jPanel5.setLayout(jPanel5Layout);
- jPanel5Layout.setHorizontalGroup(
-
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel5Layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel5Layout.createSequentialGroup()
- .addComponent(jLabel6,
javax.swing.GroupLayout.PREFERRED_SIZE, 146,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(contoursStatus))
- .addComponent(regionLabel,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
- .addContainerGap())
- );
- jPanel5Layout.setVerticalGroup(
-
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel5Layout.createSequentialGroup()
- .addComponent(regionLabel,
javax.swing.GroupLayout.PREFERRED_SIZE, 15,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(contoursStatus,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel6))
- .addContainerGap())
- );
+ regionsStatus.setEditable(false);
+
regionsStatus.setText(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.regionsStatus.text"));
// NOI18N
+
regionsStatus.setToolTipText(org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.regionsStatus.toolTipText"));
// NOI18N
+
+ org.openide.awt.Mnemonics.setLocalizedText(jLabel4,
org.openide.util.NbBundle.getMessage(MainWindowTopComponent.class, "MainWindowTopComponent.jLabel4.text"));
// NOI18N

javax.swing.GroupLayout jPanel9Layout = new
javax.swing.GroupLayout(jPanel9);
jPanel9.setLayout(jPanel9Layout);
jPanel9Layout.setHorizontalGroup(

jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGroup(jPanel9Layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(regionLabel,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
+ .addGroup(jPanel9Layout.createSequentialGroup()
+ .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
false)
+ .addComponent(jLabel4,
javax.swing.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE)
+ .addComponent(jLabel6,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(contoursStatus)
+ .addComponent(regionsStatus))
+ .addContainerGap())
);
+
+ jPanel9Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new
java.awt.Component[] {jLabel4, jLabel6});
+
jPanel9Layout.setVerticalGroup(

jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
- .addComponent(jPanel5,
javax.swing.GroupLayout.PREFERRED_SIZE, 57,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(regionLabel,
javax.swing.GroupLayout.PREFERRED_SIZE, 15,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(contoursStatus,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(jPanel4,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap())
+ .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(regionsStatus,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel4))
+ .addGap(0, 9, Short.MAX_VALUE))
);

javax.swing.GroupLayout jPanel6Layout = new
javax.swing.GroupLayout(jPanel6);
@@ -424,8 +349,8 @@
.addGroup(jPanel6Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jPanel8,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(jPanel9,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addComponent(jPanel8,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addComponent(jPanel9,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
.addContainerGap())
);
jPanel6Layout.setVerticalGroup(
@@ -433,8 +358,8 @@
.addGroup(jPanel6Layout.createSequentialGroup()
.addComponent(jPanel8,
javax.swing.GroupLayout.PREFERRED_SIZE, 167,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jPanel9,
javax.swing.GroupLayout.PREFERRED_SIZE, 132,
javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
+ .addComponent(jPanel9,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addContainerGap())
);

javax.swing.GroupLayout jPanel7Layout = new
javax.swing.GroupLayout(jPanel7);
@@ -444,15 +369,15 @@
.addGroup(jPanel7Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jPanel6,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addGroup(jPanel7Layout.createSequentialGroup()
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(overallProgress,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addComponent(overallProgress,
javax.swing.GroupLayout.DEFAULT_SIZE, 472, Short.MAX_VALUE)
.addComponent(jLabel5))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(startButton,
javax.swing.GroupLayout.PREFERRED_SIZE, 97,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(cancelButton,
javax.swing.GroupLayout.PREFERRED_SIZE, 103,
javax.swing.GroupLayout.PREFERRED_SIZE))
- .addComponent(jPanel6,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
+ .addComponent(cancelButton,
javax.swing.GroupLayout.PREFERRED_SIZE, 103,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);

@@ -462,7 +387,7 @@

jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addContainerGap()
- .addComponent(jPanel6,
javax.swing.GroupLayout.PREFERRED_SIZE, 312,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jPanel6,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addGap(18, 18, 18)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
@@ -472,7 +397,7 @@
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(overallProgress,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
+ .addContainerGap())
);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
@@ -483,7 +408,7 @@
);
layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
}// </editor-fold>//GEN-END:initComponents

@@ -534,11 +459,6 @@
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
- private javax.swing.JPanel jPanel1;
- private javax.swing.JPanel jPanel2;
- private javax.swing.JPanel jPanel3;
- private javax.swing.JPanel jPanel4;
- private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JPanel jPanel8;
@@ -950,17 +870,34 @@

public void setImage(Image img) {
image = img;
+ this.invalidate();
}

@Override
public void paint(Graphics g) {
+ Graphics2D g2d = (Graphics2D) g;
+ g2d.setComposite(AlphaComposite.SrcOver.derive(0.7f));
if (image != null) {
+ this.setBackground(OPAQUE);
setOpaque(false);
- g.drawImage(image, 0, 0, this);
+ g2d.drawImage(image, 0, 0, this);
} else {
+ setBackground(Color.WHITE);
setOpaque(true);
}
- super.paint(g);
+ super.paint(g2d);
+ g2d.dispose();
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+ Graphics2D g2d = (Graphics2D) g.create();
+ if (isOpaque()) {
+ g2d.setColor(getBackground());
+ g2d.fillRect(0, 0, getWidth(), getHeight());
+ }
+ super.paintComponent(g2d);
+ g2d.dispose();
}
}
}
Reply all
Reply to author
Forward
0 new messages