itemName.setText(itemNameString);
int rank = dataItem.getRank();
// System.out.println("dataItem rank=" + rank);
if (rank < 3) {
try {
IArray array = dataItem.getData();
// System.out.println("array rank =" + array.getRank());
// System.out.println("array shape =" + Arrays.toString(array.getShape()));
arrayViewer.setArray(array, itemNameString);
}
catch (IOException e) {
e.printStackTrace();
}
}
else {
playerComposite.setVisible(true);
// Create rank - 2 player
for (int i = 0; i < rank - 2; i++) {
createPlayer(i);
}
// At first display the first index
try {
// Extract the completeShapeInformation
int[] completeShape = dataItem.getShape();
// Create the first index origine fill to 0
arrayOrigine = new int[rank];
Arrays.fill(arrayOrigine, 0);
// Create the unitary slice
arrayShape = new int[rank];
Arrays.fill(arrayShape, 1);
arrayShape[arrayShape.length - 2] = completeShape[completeShape.length - 2];
arrayShape[arrayShape.length - 1] = completeShape[completeShape.length - 1];
IArray array = dataItem.getData(arrayOrigine, arrayShape);
IArray slice = array.getArrayUtils().section(arrayOrigine, arrayShape)
.getArray();
arrayViewer.setArray(slice, itemNameString);
}
catch (Exception e) {
e.printStackTrace();