You can specify a reference transformer
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 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 theIlvGrapherAdapter
has at least one manager view, the transformer of the first manager (as returned by the methodIlvManager.getViews()
) is returned.
The only cases where you may need to specify
a reference transformer or a reference view are:
- 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
super.setReferenceTransformer
to notify the
IlvGrapherAdapter
that the reference transformer has changed.
Note also that a call to the
setReferenceView
method overrides the effect of a call to the setReferenceTransformer method. In the same
way, a call to the setReferenceTransformer method overrides the
effect of a call to the setReferenceView method.