McCal Array Viewer

Array Viewer is a part of McCal Viewer, specifically designed for displaying one- or two-dimentional array data in a spreadsheet-like interface. You can view and edit the elements of an array. Furthermore, users can copy and paste data beween McCal Array Viewer and Microsoft Excel® files.

To open a spreadsheet file, and copy/paste data, one of the following 'Office' programs can be utilized.

Unfortunately, the programs below seem not to support 'copy-and-paste'.

McCal-lite does not support ArrayViewer.

Manual

How to start ArrayViewer

Tap on the array-type variable in McCal Viewer. A dialog for managing the variable appears (shown below). Pressing the "ArrayViewer" button starts up ArrayViewer.

matrixview

Dragging and Scaling the view

To move the view, touch and drag any part of the grid-like sheet. Matrix Viewer also supports "fling" and "pinch" gesture. The width of the columns are changed by "pinch".

Selecting and Editing a cell

Double tap on the cell of which value you wan to change, and its background color will turn red. Now, you can change the value of the selected element.

array-select

Enter an expression, such as "123" and "a[1][0]+1", in the text window at the top of the screen, and press the eval() button.

To un-select the cell, double tap on the selected cell.

Selecting a region

You can select a rectangular region of a sheet, and copy/paste it between McCal and spreadsheet files. To select a rectangular region, long-press the cell at the top-left corner of the rectangle (in the case below, soccer[2][0] cell). The background color turns blue. Without releasing your finger, drag diagonally to the corresponding cell at the opposite corner (soccer[3][1]).

array-region

Alternatively, you can select one line (horizontally or vertically in the 2D array) as a region. Just touch the corresponding label in the horizontal or vertical label-view.

Now it's ready to copy the region to the clipboard.

Copying and Pasting a region

In the current implementation of Array Viewer, copying/pasting a rectangular region of a 2D array to a spreadsheet file is supported using Google's QuickOffice® app, or one of the other programs listed in the beginning.

To copy the selected region, choose "Copy" in the option menu, then the data are sent to the Android clipboard. In an Office program, you can paste the data to a spreadsheet. Please note that, since Office programs do not understand complex numbers, complex numbers will be converted to strings.

To copy data from an Office program, first select/copy the data of your interest in the program. Go back to McCal Array Viewer, and double-tap on the cell at the top-left corner of the region you are going to copy (selecting a cell). The background color of the cell turns red. Then choose "Paste" in the option menu.

Note that any previous data in the destination region will be lost by over-writing. You can undo pasting only once by selecting "Undo" in the option menu.

When the copied region extends to the outside of the 2D array, the size of the array is expanded automatically.

It is possible to 'copy-and-paste' data within McCal Viewer. Floating point numbers and complex numbers will be copied without any rounding errors.

After selecting and copying a region, ppress the upper-left arrow of the ActionBar, then McCal Viewer returns to the variable list. Now, open the destination variable in ArrayViewer. Select the cell for the destination region, and "paste" using the option menu.

Deleting a region

Unlike other spreadsheet programs, you cannot delete a rectangular region in McCal Matrix Viewer. It is, though, possible to delete a line (column or row). After selecting a horizontal or vertical line, choose "Delete" in the option menu.

Enlarging the size of the array

You can change the size of the 2D array by choosing "Expand" in the option menu. One line of "zero-filled" cells will appear at each side of the array (top, left, bottom, and right). Delete unnecessary lines later.

Limitations of 'copy/paste'

Android Office programs seem to use a non-standard format for the Android clipboard. Although we tried our best to support the format, we cannot guarantee the correctness of data conversion.

 

Activity transition

The following figure illustrates how users go to, and come back from, the sub-activities of the McCal system.

acttrans