fixed network image in search performance monitor

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

@ -72,7 +72,8 @@ public class plasmaGrafics {
if (searches == null) return null; // this was a local search and there are no threads
// get a copy of a recent network picture
ymagePainter eventPicture = (ymagePainter) getNetworkPicture(120000).clone();
ymagePainter eventPicture = getNetworkPicture(120000);
if (eventPicture instanceof ymageMatrixPainter) eventPicture = new ymageMatrixPainter((ymageMatrix) eventPicture);
// get dimensions
int cr = Math.min(eventPicture.getWidth(), eventPicture.getHeight()) / 5 - 20;

@ -72,6 +72,19 @@ public class ymageMatrix implements Cloneable {
private byte defaultMode;
private boolean grabComplementary = false;
public ymageMatrix(ymageMatrix matrix) {
// clones the matrix
this.width = matrix.width;
this.height = matrix.height;
this.defaultColR = matrix.defaultColR;
this.defaultColG = matrix.defaultColG;
this.defaultColB = matrix.defaultColB;
this.defaultMode = matrix.defaultMode;
this.grabComplementary = matrix.grabComplementary;
this.grid = new byte[3 * width * height];
System.arraycopy(matrix.grid, 0, this.grid, 0, matrix.grid.length);
}
public ymageMatrix(int width, int height, String backgroundColor) {
this(width, height, colNum(backgroundColor));
}
@ -83,7 +96,7 @@ public class ymageMatrix implements Cloneable {
this.defaultColG = 0xFF;
this.defaultColB = 0xFF;
this.defaultMode = MODE_REPLACE;
grid = new byte[3*width*height];
grid = new byte[3 * width * height];
// fill grid with background color
byte bgR = (byte) (backgroundColor >> 16);
@ -108,13 +121,7 @@ public class ymageMatrix implements Cloneable {
}
public Object clone() {
ymageMatrix ip = new ymageMatrix(this.width, this.height, 0);
System.arraycopy(this.grid, 0, ip.grid, 0, this.grid.length);
ip.defaultColR = this.defaultColR;
ip.defaultColG = this.defaultColG;
ip.defaultColB = this.defaultColB;
ip.defaultMode = this.defaultMode;
return ip;
return new ymageMatrix(this);
}
public int getWidth() {

@ -66,6 +66,10 @@ public class ymageMatrixPainter extends ymageMatrix implements ymagePainter {
super(width, height, backgroundColor);
}
public ymageMatrixPainter(ymageMatrix matrix) {
super(matrix);
}
private static int[] getCircleCoords(int radius) {
if ((radius - 1) < circles.length) return circles[radius - 1];

Loading…
Cancel
Save