Draw the single field element at the given indices.
Draw the single field element at the given indices.
Called after the pen has been moved to the top-left corner of the cell to draw in. Clients should take care to draw within the bounds of the cell, which is a cellSize by cellSize square.
It would be nice if we could give an element as an argument instead of a bunch of indices, but the Field class doesn't currently define any means to actually extract elements from the field; that's left to subclasses. Further complicating things, the panel classes don't know in advance how many dimensions the data field has, so we have to use a variable length indices parameter. If your field class has a read(indices: Int*) method, you can get the current element, regardless of field dimensions, like so:
val element = read(indices: _*)
Compute any needed statistics on your data (for display or to help draw later).
Compute any needed statistics on your data (for display or to help draw later). Called after new data has been received (in updateData) but before drawing begins for that new data.
Update the data being viewed with new "data".
Increase zoom level by zDelta
.
Increase zoom level by zDelta
.
Default zoom/unzoom increment used by zoomIn
and zoomOut
.
Default zoom/unzoom increment used by zoomIn
and zoomOut
. When the
ZoomType is Additive, this value is added to or substracted from the
current zoomLevel
. In multiplicative mode, zoomLevel
is multipled by
zDelta
on zooming in or by its reciprocal on zooming out.
Decrease zoom level by zDelta
.
Decrease zoom level by zDelta
.
Controls how zDelta is applied to the current zoom level.
Controls how zDelta is applied to the current zoom level. In Additive, a delta is added to the current zoom level; in Multiplicative mode, the zoom level is multiplied by delta when zooming in, and by its reciprocal when zooming out.
Default zoom type is additive. If you change it to multiplicative, you should probably ensure that the default zDelta is something other than 1f, as multiplying by one probably won't do anything.
Created with IntelliJ IDEA. User: gonzatob Date: 9/6/12 Time: 2:22 PM
This abstract class takes care of much of the drawing logic needed to render fields that can be visualized as a grid of distinct elements (such as vector fields or dyad fields). It supports pan, zoom, and save/restore functionality, and can handle 0D, 1D, 2D, and 3D fields.
Concrete viewer implementations will need to define three methods. The first is update, which runs before any drawing is done to allow a client to do such things as compute min/max values for normalization. The second is drawElement, where the client must supply the code to draw a single element of the field. Lastly is getXmlTagName, which just defines a name unique to this viewer type for use in the workspace configuration XML files.