public void preupdate() {
   if (dataChanged && data != null) {
     for (int el = 0, i = 0, m = data.length; i < m; i++) {
       for (int j = 0, n = data[0].length; j < n; j++) {
         for (int k = 0, p = data[0][0].length; k < p; k++, el++) {
           Element element = arrows[el];
           element.setX(data[i][j][k][0]);
           element.setY(data[i][j][k][1]);
           element.setZ(data[i][j][k][2]);
           element.setSizeX(data[i][j][k][3] * zoom);
           element.setSizeY(data[i][j][k][4] * zoom);
           element.setSizeZ(data[i][j][k][5] * zoom);
           magnitude[el] = data[i][j][k][6];
         }
       }
     }
     if (autoscaleMagnitude) computeMagnitudeExtrema();
     dataChanged = false;
     colorChanged = true;
   }
   if (colorChanged) {
     if (levels > 0)
       for (int i = 0, n = arrows.length; i < n; i++) {
         Color color = magToColor(magnitude[i]);
         if (color == null) {
           arrows[i].setVisible(false);
           continue;
         }
         arrows[i].setVisible(true);
         arrows[i].getStyle().setLineColor(color);
         arrows[i].getStyle().setFillColor(color);
       }
     else
       for (int i = 0, n = arrows.length; i < n; i++) {
         arrows[i].setVisible(true);
         arrows[i].getStyle().setLineColor(minColor);
         arrows[i].getStyle().setFillColor(minColor);
       }
   }
   colorChanged = false;
 }