Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fixed network image in search performance monitor

orbiteraadace1285c1
diff --git a/source/de/anomic/plasma/plasmaGrafics.java b/source/de/anomic/plasma/plasmaGrafics.java
index d2217d63d..06b4aa1cb 100644
--- a/source/de/anomic/plasma/plasmaGrafics.java
+++ b/source/de/anomic/plasma/plasmaGrafics.java
@@ -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;
diff --git a/source/de/anomic/ymage/ymageMatrix.java b/source/de/anomic/ymage/ymageMatrix.java
index 55c5f68a5..4bdd66b4f 100644
--- a/source/de/anomic/ymage/ymageMatrix.java
+++ b/source/de/anomic/ymage/ymageMatrix.java
@@ -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() {
diff --git a/source/de/anomic/ymage/ymageMatrixPainter.java b/source/de/anomic/ymage/ymageMatrixPainter.java
index 6fd8b4fd7..793011b39 100644
--- a/source/de/anomic/ymage/ymageMatrixPainter.java
+++ b/source/de/anomic/ymage/ymageMatrixPainter.java
@@ -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];