Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
crawling peers now produce waves in network graphic
orbiterb80b2fbdcc7a
diff --git a/htroot/NetworkPicture.java b/htroot/NetworkPicture.javaindex c4299ffa1..b42ac4443 100644--- a/htroot/NetworkPicture.java+++ b/htroot/NetworkPicture.java@@ -80,7 +80,7 @@ public class NetworkPicture {shortestName = 10;longestName = 12;- ImagePainter img = new ImagePainter(width, height, 0);+ ImagePainter img = new ImagePainter(width, height, "000010");img.setMode(ImagePainter.MODE_ADD);if (yacyCore.seedDB == null) return img.toImage(true); // no other peers known@@ -88,7 +88,7 @@ public class NetworkPicture {if (size == 0) return img.toImage(true); // no other peers known// draw network circle- img.setColor("004020");+ img.setColor("008020");img.arc(width / 2, height / 2, innerradius - 20, innerradius + 20, 0, 360);//System.out.println("Seed Maximum distance is " + yacySeed.maxDHTDistance);@@ -177,6 +177,20 @@ public class NetworkPicture {int ppm10 = seed.getPPM() / 10;if (ppm10 > 0) {if (ppm10 > 3) ppm10 = 3;+ // draw a wave around crawling peers+ long strength;+ img.setMode(ImagePainter.MODE_SUB);+ img.setColor("303030");+ img.arcArc(x, y, innerradius, angle, dotsize + 1, dotsize + 1, 0, 360);+ int waveradius = innerradius / 2;+ for (int r = 0; r < waveradius; r++) {+ strength = (waveradius - r) * (long) (0x08 * ppm10 * (1.0 + Math.sin(Math.PI * 16 * r / waveradius))) / waveradius;+ //System.out.println("r = " + r + ", Strength = " + strength);+ img.setColor((strength << 16) | (strength << 8) | strength);+ img.arcArc(x, y, innerradius, angle, dotsize + r, dotsize + r, 0, 360);+ }+ /*+ // draw coronaimg.setMode(ImagePainter.MODE_SUB);img.setColor("303030");img.arcArc(x, y, innerradius, angle, dotsize + 1, dotsize + ppm10 + 1, 0, 360);@@ -185,6 +199,7 @@ public class NetworkPicture {img.arcArc(x, y, innerradius, angle, dotsize + ppm10 , dotsize + ppm10 , 0, 360);img.setColor("500000");img.arcArc(x, y, innerradius, angle, dotsize + ppm10 + 1, dotsize + ppm10 + 1, 0, 360);+ */}}diff --git a/source/de/anomic/plasma/plasmaWordIndexDistribution.java b/source/de/anomic/plasma/plasmaWordIndexDistribution.javaindex 48e74fd69..81cb6c4d1 100644--- a/source/de/anomic/plasma/plasmaWordIndexDistribution.java+++ b/source/de/anomic/plasma/plasmaWordIndexDistribution.java@@ -264,7 +264,7 @@ public final class plasmaWordIndexDistribution {}return indexCount;} else {- log.logSevere("Index distribution failed. Too less peers (" + hc + ") received the index, not deleted locally.");+ log.logSevere("Index distribution failed. Too few peers (" + hc + ") received the index, not deleted locally.");return -1;}}diff --git a/source/de/anomic/tools/ImagePainter.java b/source/de/anomic/tools/ImagePainter.javaindex 6bf96e6b3..736e9eb30 100644--- a/source/de/anomic/tools/ImagePainter.java+++ b/source/de/anomic/tools/ImagePainter.java@@ -98,6 +98,10 @@ public class ImagePainter {private int defaultColR, defaultColG, defaultColB;private byte defaultMode;+ public ImagePainter(int width, int height, String backgroundColor) {+ this(width, height, colNum(backgroundColor));+ }+public ImagePainter(int width, int height, long backgroundColor) {this.width = width;this.height = height;@@ -118,12 +122,12 @@ public class ImagePainter {}}- private long colNum(String col) {+ private static long colNum(String col) {return Long.parseLong(col, 16);//return Integer.parseInt(col.substring(0,2), 16) << 16 | Integer.parseInt(col.substring(2,4), 16) << 8 | Integer.parseInt(col.substring(4,6), 16);}- private String colStr(long c) {+ private static String colStr(long c) {String s = Long.toHexString(c);while (s.length() < 6) s = "0" + s;return s;