for (Node node : mapRow) {
float[] projection3D = node.getProjection3D();
String hexColor = '#' +
percentageToHexByte(projection3D[0]) +
percentageToHexByte(projection3D[1]) +
percentageToHexByte(projection3D[2]);
pageContext.setAttribute("hexColor", hexColor);
List<Pair<Double,Long>> contentIDs = node.getAssignedIDs();
int n = FastMath.min(nodeMaxSize, contentIDs.size());
if (n > 0) {
int rowSize = (int) FastMath.round(FastMath.sqrt(n));
Iterator<Pair<Double,Long>> it = contentIDs.iterator();
int k = 0;
while (k < nodeMaxSize && it.hasNext()) {
out.write(String.valueOf(it.next().getSecond()));
out.write(' ');
if ((k+1) % rowSize == 0 && k != n-1) {
out.write("<br/>");
}
k++;
}
if (it.hasNext()) {
out.write("...");
}
k = 0;
while (k < n) {
out.write('ยท');
if ((k+1) % rowSize == 0 && k != n-1) {
out.write("<br/>");
}
k++;
}
}
|
}