small update to network drawing

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@892 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 20 years ago
parent 2b5829c3da
commit 579b22d8ff

@ -88,6 +88,7 @@ public class NetworkPicture {
// draw connected senior and principals
int count = 0;
int totalCount = 0;
Enumeration e = yacyCore.seedDB.seedsConnected(true, false, null);
while (e.hasMoreElements() && count < maxCount) {
seed = (yacySeed) e.nextElement();
@ -96,6 +97,7 @@ public class NetworkPicture {
count++;
}
}
totalCount += count;
// draw disconnected senior and principals that have been seen lately
count = 0;
@ -109,6 +111,7 @@ public class NetworkPicture {
count++;
}
}
totalCount += count;
// draw juniors that have been seen lately
count = 0;
@ -122,13 +125,16 @@ public class NetworkPicture {
count++;
}
}
totalCount += count;
// draw my own peer
drawPeer(img, width / 2, height / 2, radius, yacyCore.seedDB.mySeed, "800000", "FFFFFF");
// draw description
img.setColor("FFFFFF");
img.print(2, 8, "YACY NETWORK PICTURE / SNAPSHOT FROM " + new Date().toString().toUpperCase());
img.print(2, 8, "YACY NETWORK PICTURE", true);
img.print(2, 16, "DRAWING OF " + totalCount + " SELECTED PEERS", true);
img.print(width - 2, 8, "SNAPSHOT FROM " + new Date().toString().toUpperCase(), false);
return img.toImage(true);
}

@ -100,8 +100,8 @@ public class imagetest {
img.setMode(ImagePainter.MODE_ADD);
img.setColor(ImagePainter.ADDITIVE_BLACK);
for (int y = 0; y < 600; y = y + 50) img.print(0, 6 + y, "" + y);
for (int x = 0; x < 800; x = x + 50) img.print(x, 6 , "" + x);
for (int y = 0; y < 600; y = y + 50) img.print(0, 6 + y, "" + y, true);
for (int x = 0; x < 800; x = x + 50) img.print(x, 6 , "" + x, true);
img.setColor(ImagePainter.ADDITIVE_RED);
img.dot(550, 110, 90, true);
img.setColor(ImagePainter.ADDITIVE_GREEN);
@ -114,9 +114,9 @@ public class imagetest {
img.arc(220, 110, 50, 90, 30, 110);
img.arc(210, 120, 50, 90, 30, 110);
img.setColor(ImagePainter.ADDITIVE_BLACK);
img.print(50, 110, "BROADCAST MESSAGE #772: NODE %882 BLACK abcefghijklmnopqrstuvwxyz");
img.print(50, 110, "BROADCAST MESSAGE #772: NODE %882 BLACK abcefghijklmnopqrstuvwxyz", true);
img.setColor(ImagePainter.ADDITIVE_GREEN);
img.print(50, 120, "BROADCAST MESSAGE #772: NODE %882 GREEN abcefghijklmnopqrstuvwxyz");
img.print(50, 120, "BROADCAST MESSAGE #772: NODE %882 GREEN abcefghijklmnopqrstuvwxyz", true);
for (long i = 0; i < 256; i++) {
img.setColor(i);
img.dot(10 + 14 * (int) (i / 16), 200 + 14 * (int) (i % 16), 6, true);

@ -1,4 +1,4 @@
// plasmaSwitchboard.java
// plasmaCrawlStacker.java
// -----------------------
// part of YaCy
// (C) by Michael Peter Christen; mc@anomic.de

@ -307,10 +307,11 @@ public class ImagePainter {
}
public void print(int x, int y, String message) {
public void print(int x, int y, String message, boolean alignRight) {
int xx = (alignRight) ? x : x - 6 * message.length();
for (int i = 0; i < message.length(); i++) {
print(x, y, message.charAt(i));
x += 6;
print(xx, y, message.charAt(i));
xx += 6;
}
}
@ -326,7 +327,7 @@ public class ImagePainter {
int xp = x - 3 * message.length();
if ((angle > (90 + arcDist)) && (angle < (270 - arcDist))) xp = x - 6 * message.length();
if ((angle < (90 - arcDist)) || (angle > (270 + arcDist))) xp = x;
print(xp, yp, message);
print(xp, yp, message, true);
}
public void arcLine(int cx, int cy, int innerRadius, int outerRadius, int angle) {

Loading…
Cancel
Save