}
private static void openTableDialog(String name, IArray data) {
NumberMatrixTable table = new NumberMatrixTable();
Chart viewer = new Chart();
// Parse Object arrays into double arrays
Object storageData = data.getStorage();
Object finalData = null;
if (storageData.getClass().isArray()) {
Object[] storageArray = (Object[]) storageData;
finalData = Array.newInstance(Double.TYPE, storageArray.length);
double[] castedFinalArray = (double[]) finalData;
for (int i = 0; i < storageArray.length; ++i) {
Object subData = storageArray[i];
if (subData instanceof Number) {
castedFinalArray[i] = ((Number) subData).doubleValue();
}
}
}
try {
AbstractNumberMatrix<?> matrix = new DoubleMatrix();
int[] shape = data.getShape();
if (shape.length == 2) {
matrix.setFlatValue(finalData, shape[0], shape[1]);
}
table.setData(matrix);
// viewer.setAnnotation(IChartViewer.TIME_ANNO, IChartViewer.Y1);
Map<String, Object> dataToChart = new HashMap<String, Object>();
dataToChart.put(name, finalData);
viewer.setData(dataToChart);
} catch (Exception e) {
e.printStackTrace();
}