enhanced network graphic

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7446 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent 30df013c2b
commit 991b92f4ae

@ -11,7 +11,7 @@
<script type="text/javascript">
<!--
imagestub = "NetworkPicture.png?width=768&height=576&bgcolor=FFFFFF&ct=5000&coronaangle=";
imagestub = "NetworkPicture.png?width=1024&height=576&bgcolor=FFFFFF&ct=5000&coronaangle=";
imageanimindex = 0;
imageloadindex = 0;
imagecycles = 0;
@ -23,7 +23,7 @@
for (j = 0; j < 6; j++) initanimationphase(j, handle);
}
function initanimationphase(phase, handle) {
imagearray[phase] = new Image(768, 576);
imagearray[phase] = new Image(1024, 576);
angle = phase * 60;
imagearray[phase].src = imagestub + angle + "&handle=" + handle;
}
@ -222,7 +222,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<div class="left">
<p>
<a href="NetworkPicture.png?width=768&amp;height=576&amp;bgcolor=FFFFFF"><img id="NetworkPicture" src="NetworkPicture.png?width=768&amp;height=576&amp;bgcolor=FFFFFF&amp;coronaangle=0" alt="The YaCy Network" width="768" height="576" /></a>
<a href="NetworkPicture.png?width=1024&amp;height=576&amp;bgcolor=FFFFFF"><img id="NetworkPicture" src="NetworkPicture.png?width=1024&amp;height=576&amp;bgcolor=FFFFFF&amp;coronaangle=0" alt="The YaCy Network" width="1024" height="576" /></a>
</p>
</div>
<div class="left">

@ -62,10 +62,10 @@ public class NetworkPicture {
return buffer;
}
int width = 768;
int width = 1024; // 640x480 = VGA, 768x576 = SD/4:3, 1024x576 =SD/16:9 1280x720 = HD/16:9, 1920x1080 = FULL HD/16:9
int height = 576;
int passiveLimit = 720; // 12 hours
int potentialLimit = 720;
int passiveLimit = 10080; // minutes; 1440 = 1 day; 720 = 12 hours; 10080 = 1 week;
int potentialLimit = 10080;
int maxCount = 1000;
String bgcolor = NetworkGraph.COL_BACKGROUND;
boolean corona = true;
@ -73,11 +73,11 @@ public class NetworkPicture {
long communicationTimeout = -1;
if (post != null) {
width = post.getInt("width", 768);
height = post.getInt("height", 576);
passiveLimit = post.getInt("pal", 1440);
potentialLimit = post.getInt("pol", 1440);
maxCount = post.getInt("max", 1000);
width = post.getInt("width", width);
height = post.getInt("height", height);
passiveLimit = post.getInt("pal", passiveLimit);
potentialLimit = post.getInt("pol", potentialLimit);
maxCount = post.getInt("max", maxCount);
corona = post.get("corona", "true").equals("true");
coronaangle = (corona) ? post.getInt("coronaangle", 0) : -1;
communicationTimeout = post.getLong("ct", -1);
@ -88,7 +88,7 @@ public class NetworkPicture {
if (width < 320 ) width = 320;
if (width > 1920) width = 1920;
if (height < 240) height = 240;
if (height > 1920) height = 1920;
if (height > 1080) height = 1080;
if (!authorized) {
width = Math.min(768, width);
height = Math.min(576, height);

@ -174,14 +174,14 @@ public class NetworkGraph {
RasterPlotter networkPicture = new RasterPlotter(width, height, (bgcolor.equals("000000")) ? RasterPlotter.DrawMode.MODE_ADD : RasterPlotter.DrawMode.MODE_SUB, bgcolor);
if (seedDB == null) return networkPicture; // no other peers known
final int innerradius = Math.min(width, height) / 5;
int outerradius = innerradius + innerradius * seedDB.sizeConnected() / 100;
if (outerradius > innerradius * 2) outerradius = innerradius * 2;
final int maxradius = Math.min(width, height) / 2;
final int innerradius = maxradius * 4 / 10;
int outerradius = maxradius - 20;
// draw network circle
networkPicture.setColor(COL_DHTCIRCLE);
networkPicture.arc(width / 2, height / 2 + 20, innerradius - 20, innerradius + 20, 0, 360);
networkPicture.arc(width / 2, height / 2, innerradius - 20, innerradius + 20, 0, 360);
//System.out.println("Seed Maximum distance is " + yacySeed.maxDHTDistance);
//System.out.println("Seed Minimum distance is " + yacySeed.minDHTNumber);
@ -200,7 +200,7 @@ public class NetworkGraph {
continue;
}
//Log.logInfo("NetworkGraph", "drawing peer " + seed.getName());
drawNetworkPicturePeer(networkPicture, width / 2, height / 2 + 20, innerradius, outerradius, seed, COL_ACTIVE_DOT, COL_ACTIVE_LINE, COL_ACTIVE_TEXT, coronaangle);
drawNetworkPicturePeer(networkPicture, width / 2, height / 2, innerradius, outerradius, seed, COL_ACTIVE_DOT, COL_ACTIVE_LINE, COL_ACTIVE_TEXT, coronaangle);
count++;
}
totalCount += count;
@ -218,7 +218,7 @@ public class NetworkGraph {
if (lastseen > passiveLimit) {
break; // we have enough, this list is sorted so we don't miss anything
}
drawNetworkPicturePeer(networkPicture, width / 2, height / 2 + 20, innerradius, outerradius, seed, COL_PASSIVE_DOT, COL_PASSIVE_LINE, COL_PASSIVE_TEXT, coronaangle);
drawNetworkPicturePeer(networkPicture, width / 2, height / 2, innerradius, outerradius, seed, COL_PASSIVE_DOT, COL_PASSIVE_LINE, COL_PASSIVE_TEXT, coronaangle);
count++;
}
totalCount += count;
@ -236,13 +236,13 @@ public class NetworkGraph {
if (lastseen > potentialLimit) {
break; // we have enough, this list is sorted so we don't miss anything
}
drawNetworkPicturePeer(networkPicture, width / 2, height / 2 + 20, innerradius, outerradius, seed, COL_POTENTIAL_DOT, COL_POTENTIAL_LINE, COL_POTENTIAL_TEXT, coronaangle);
drawNetworkPicturePeer(networkPicture, width / 2, height / 2, innerradius, outerradius, seed, COL_POTENTIAL_DOT, COL_POTENTIAL_LINE, COL_POTENTIAL_TEXT, coronaangle);
count++;
}
totalCount += count;
// draw my own peer
drawNetworkPicturePeer(networkPicture, width / 2, height / 2 + 20, innerradius, outerradius, seedDB.mySeed(), COL_MYPEER_DOT, COL_MYPEER_LINE, COL_MYPEER_TEXT, coronaangle);
drawNetworkPicturePeer(networkPicture, width / 2, height / 2, innerradius, outerradius, seedDB.mySeed(), COL_MYPEER_DOT, COL_MYPEER_LINE, COL_MYPEER_TEXT, coronaangle);
// draw DHT activity
if (communicationTimeout >= 0) {
@ -253,14 +253,14 @@ public class NetworkGraph {
if (event == null || event.getPubDate() == null) continue;
if (event.getPubDate().after(horizon)) {
//System.out.println("*** NETWORK-DHTRECEIVE: " + event.getLink());
drawNetworkPictureConnection(networkPicture, width / 2, height / 2 + 20, innerradius, seedDB.mySeed(), seedDB.get(event.getLink()), COL_DHTIN);
drawNetworkPictureConnection(networkPicture, width / 2, height / 2, innerradius, seedDB.mySeed(), seedDB.get(event.getLink()), COL_DHTIN);
}
}
for (Hit event: yacyChannel.channels(yacyChannel.DHTSEND)) {
if (event == null || event.getPubDate() == null) continue;
if (event.getPubDate().after(horizon)) {
//System.out.println("*** NETWORK-DHTSEND: " + event.getLink());
drawNetworkPictureConnection(networkPicture, width / 2, height / 2 + 20, innerradius, seedDB.mySeed(), seedDB.get(event.getLink()), COL_DHTOUT);
drawNetworkPictureConnection(networkPicture, width / 2, height / 2, innerradius, seedDB.mySeed(), seedDB.get(event.getLink()), COL_DHTOUT);
}
}
}

@ -58,7 +58,7 @@ public class PrintTool {
for (int j = 0; j < 5; j++) {
c = row & 3L;
if (c == 3) matrix.plot(x + 5 - j, y, 100);
if (c == 2) matrix.plot(x + 5 - j, y, 36);
else if (c == 2) matrix.plot(x + 5 - j, y, 36);
row = row >> 2;
}
y--;
@ -67,7 +67,7 @@ public class PrintTool {
for (int j = 0; j < 5; j++) {
c = row & 3L;
if (c == 3) matrix.plot(x, y - 5 + j, 100);
if (c == 2) matrix.plot(x, y - 5 + j, 36);
else if (c == 2) matrix.plot(x, y - 5 + j, 36);
row = row >> 2;
}
x--;
@ -76,7 +76,7 @@ public class PrintTool {
for (int j = 0; j < 5; j++) {
c = row & 3L;
if (c == 3) { matrix.plot(x + 5 - j, y + 5 - j, 100); matrix.plot(x + 6 - j, y + 5 - j, 50); matrix.plot(x + 5 - j, y + 6 - j, 50); }
if (c == 2) { matrix.plot(x + 5 - j, y + 5 - j, 36); matrix.plot(x + 6 - j, y + 5 - j, 18); matrix.plot(x + 5 - j, y + 6 - j, 18); }
else if (c == 2) { matrix.plot(x + 5 - j, y + 5 - j, 36); matrix.plot(x + 6 - j, y + 5 - j, 18); matrix.plot(x + 5 - j, y + 6 - j, 18); }
row = row >> 2;
}
x++;

Loading…
Cancel
Save