Specifying the mode for labeling coordinates

The default labeling model provides several coordinates mode values. The coordinates mode can be specified on the default labeling model and on the layout instance. The coordinates mode of the layout instance is used during layout, while the coordinates mode specified for the default labeling model is used on operations of the labeling model when layout is not currently performed.
To specify the coordinates mode, use the following method, available in the classes IlvDefaultLabelingModel and IlvLabelLayout:
void setCoordinatesMode(int mode)  
Valid options of the coordinates mode are:
  • IlvLabelLayout.MANAGER_COORDINATES - The geometry of obstacles and labels is computed using the coordinate space of the manager without applying any transformation. This mode is suitable if the manager does not contain any nonzoomable labels.
  • IlvLabelLayout.VIEW_COORDINATES - The geometry of obstacles and labels is computed in the coordinate space of the reference manager view. This mode is suitable if the manager contains nonzoomable objects. The layout will be correct with respect to the reference view but not correct with respect to any other view. Dimensional layout parameters (such as the label offset) are specified in the coordinate space of the reference view.
  • IlvLabelLayout.INVERSE_VIEW_COORDINATES - This is the default. The geometry of the graph is computed using the coordinate space of the reference manager view and then applying the inverse transformation. This simulates the manager coordinate space. This mode is also suitable if the manager contains nonzoomable objects. The layout will be correct only with respect to the reference view. Dimensional layout parameters (such as the label offset) are specified in the coordinate space of the manager.
To make sure that manager coordinates are used during layout, call:
layout.setCoordinatesMode(IlvLabelLayout.MANAGER_COORDINATES);
This does not change the coordinates mode of the labeling model until layout is started. Most of the time, however, it is recommended that you use the same coordinates mode for the default labeling model and the layout instance, so you call it twice:
defaultLabelingModel.setCoordinatesMode(IlvLabelLayout.MANAGER_COORDINATES);
layout.setCoordinatesMode(IlvLabelLayout.MANAGER_COORDINATES);