@Override public void localize(final long[] position) { for (int i = 0; i < position.length; i++) position[i] = getLongPosition(i); }
@Override public float getFloatPosition(final int d) { return getLongPosition(d); }
@Override public int getIntPosition(final AxisType axis) { return (int) getLongPosition(axis); }
@Override public double getDoublePosition(final int d) { return getLongPosition(d); }
@Override public void move(final long distance, final int d) { setPosition(getLongPosition(d) + distance, d); }
@Override public void fwd(final int d) { setPosition(getLongPosition(d) + 1, d); }
@Override public void move(final int distance, final int d) { setPosition(getLongPosition(d) + distance, d); }
@Override public void bck(final int d) { setPosition(getLongPosition(d) - 1, d); }
@Override public long getLongPosition(final int d) { return getLongPosition(axis(d).type()); }
@Override public boolean isVisible(final DataView view) { for (int i = 0; i < numDimensions(); i++) { final AxisType axis = axis(i).type(); if (axis.isXY()) continue; final long value = getLongPosition(axis); final int index = view.getData().dimensionIndex(axis); if (index < 0) { // verify that the display's position matches the view's value if (value != view.getLongPosition(axis)) return false; } else { // verify that the display's position matches the data's range final double min = index < 0 ? 0 : view.getData().realMin(index); final double max = index < 0 ? 0 : view.getData().realMax(index); if (value < min || value > max) { // dimensional position is outside the data's range return false; } } } return true; }
@Override public void update() { // NB - this combinedinterval.update() call rebuilds the interval. We have // found cases where this is necessary to avoid situations where the we try // to access a no longer existing axis. As an example of this try running // legacy command Type > 8-bit Color on Clowns. Without this line, when you // run the command, an exception is thrown. // TODO - is this a performance issue? combinedInterval.update(); for (final DataView view : this) { for (int i = 0; i < numDimensions(); i++) { AxisType axis = axis(i).type(); if (axis.isXY()) continue; final int axisNum = view.getData().dimensionIndex(axis); if (axisNum < 0) continue; final long p = getLongPosition(axis); Data data = view.getData(); double size = data.realMax(axisNum) - data.realMin(axisNum) + 1; if (p < size) { view.setPosition(p, axis); } } view.update(); } super.update(); }