/** * Same work than {@link AbstractMathTransform#beforeFormat(List, int, boolean)} * but with the knowledge that this transform is an inverse transform. */ @Override int beforeFormat(final List<Object> transforms, final int index, final boolean inverse) { final ContextualParameters parameters = getContextualParameters(); if (parameters != null) { return parameters.beforeFormat(transforms, index, inverse); } else { return AbstractMathTransform.this.beforeFormat(transforms, index, !inverse); } }
/** * Given a transformation chain, replaces the elements around {@code transforms.get(index)} transform by * alternative objects to use when formatting WKT. The replacement is performed in-place in the given list. * * <p>This method shall replace only the previous element and the few next elements that need * to be changed as a result of the previous change. This method is not expected to continue * the iteration after the changes that are of direct concern to this object.</p> * * <p>This method is invoked only by {@link ConcatenatedTransform#getPseudoSteps()} in order to * get the {@link ParameterValueGroup} of a map projection, or to format a {@code PROJCS} WKT.</p> * * @param transforms the full chain of concatenated transforms. * @param index the index of this transform in the {@code transforms} chain. * @param inverse always {@code false}, except if we are formatting the inverse transform. * @return index of this transform in the {@code transforms} chain after processing. * * @see ConcatenatedTransform#getPseudoSteps() */ int beforeFormat(final List<Object> transforms, final int index, final boolean inverse) { assert unwrap(transforms.get(index), inverse) == this; final ContextualParameters parameters = getContextualParameters(); return (parameters != null) ? parameters.beforeFormat(transforms, index, inverse) : index; }
/** * Given a transformation chain, replaces the elements around {@code transforms.get(index)} transform by * alternative objects to use when formatting WKT. The replacement is performed in-place in the given list. * * <p>This method shall replace only the previous element and the few next elements that need * to be changed as a result of the previous change. This method is not expected to continue * the iteration after the changes that are of direct concern to this object.</p> * * <p>This method is invoked only by {@link ConcatenatedTransform#getPseudoSteps()} in order to * get the {@link ParameterValueGroup} of a map projection, or to format a {@code PROJCS} WKT.</p> * * @param transforms the full chain of concatenated transforms. * @param index the index of this transform in the {@code transforms} chain. * @param inverse always {@code false}, except if we are formatting the inverse transform. * @return index of this transform in the {@code transforms} chain after processing. * * @see ConcatenatedTransform#getPseudoSteps() */ int beforeFormat(final List<Object> transforms, final int index, final boolean inverse) { assert unwrap(transforms.get(index), inverse) == this; final ContextualParameters parameters = getContextualParameters(); return (parameters != null) ? parameters.beforeFormat(transforms, index, inverse) : index; }
/** * Same work than {@link AbstractMathTransform#beforeFormat(List, int, boolean)} * but with the knowledge that this transform is an inverse transform. */ @Override int beforeFormat(final List<Object> transforms, final int index, final boolean inverse) { final ContextualParameters parameters = getContextualParameters(); if (parameters != null) { return parameters.beforeFormat(transforms, index, inverse); } else { final MathTransform inv = inverse(); if (inv instanceof AbstractMathTransform) { return ((AbstractMathTransform) inv).beforeFormat(transforms, index, !inverse); } else { return index; } } }