Using Advanced Features > Laying Out Graphs with Nonzoomable Graphic Objects > Specifying a Reference Transformer
 
Specifying a Reference Transformer
A reference transformer can be specified explicitly using the method:
void setReferenceTransformer(IlvTransformer transformer)
The current reference transformer is returned by the method:
IlvTransformer getReferenceTransformer()
In most cases, it is not necessary to specify a reference transformer because the last method automatically chooses it according to the following rules:
*If a reference transformer is specified, the specified transformer is returned.
*If a reference view has been specified, the transformer of the reference view is returned.
*If the IlvGrapher attached to the IlvGrapherAdapter has at least one manager view, the transformer of the first manager (as returned by the method IlvManager::getViews()) is returned.
The only cases when you may need to specify a reference transformer or a reference view are the following:
*The IlvGrapher contains nonzoomable objects (that is, the layout cannot be correctly computed independently of the transformer used for drawing the graph) and more than one manager view is attached to the grapher.
*The IlvGrapher contains nonzoomable objects and you want to perform the layout without attaching a manager view to the grapher. (Therefore, the default rule for choosing the current transformer of the first manager view as the reference transformer cannot be applied.)
If a grapher containing nonzoomable objects is displayed simultaneously in several views, you can use the setReferenceView method to indicate the view for which you want the drawing of the graph to be optimal.
If you specified a reference transformer but want to reset this setting and go back to the default behavior, call the method setReferenceTransformer with a null argument.
Note that if you override the setReferenceTransformer method, you must call IlvGrapherAdapter::setReferenceTransformer of the super class to notify the IlvGrapherAdapter that the reference transformer has changed.
Note also that a call to the IlvGrapherAdapter::setReferenceView method overrides the effect of a call to the IlvGrapherAdapter::setReferenceTransformer method. In the same way, a call to the IlvGrapherAdapter::setReferenceTransformer method overrides the effect of a call to the IlvGrapherAdapter::setReferenceView method.

Version 5.7
Copyright © 2013, Rogue Wave Software, Inc. All Rights Reserved.