Zooming

JViews TGO supports three different zooming modes, as described below:
  • Physical zoom. In this display mode, the sizes and coordinates of all objects change proportionally with the zoom factor. JViews TGO supports this zoom mode only for zoom factors less than one, that is, for zoom-out, not zoom-in. This mode is implemented by the IltPhysicalZoomPolicy class.
  • Logical zoom. In this display mode, the following changes occur: the coordinates of network elements change proportionally but their sizes remain constant; the sizes of groups change proportionally; the link layout is recalculated according to the new coordinates and sizes. The application can define additional actions in the framework of logical zooming, for example groups being replaced with subnetworks when the user zooms in. This mode is implemented by the IltLogicalZoomPolicy class.
  • Mixed zoom. In this display mode, physical zoom is used for zoom factors less than one, that is, for zoom-out, and logical zoom is used for zoom-in. The IltMixedZoomPolicy class implements this mode.
To summarize, physical zoom provides a fast miniaturized view of a network, whereas logical zoom keeps the graphical quality of the displayed objects.
Zoom support is implemented by the IlpZoomPolicy instances. By default, an IlpNetworkView instance has the physical zoom support set. However, the user can modify this configuration through the following method:
  • IlpNetworkView.setZoomPolicy installs the specified zoom policy in the given view.
  • IlpNetworkView.setZoomPolicy with parameter set to null, uninstalls the zoom policy from the view.

The two coordinate systems

This section assumes that you are familiar with the Rogue Wave JViews class IlvTransformer and with the difference between manager coordinates and view coordinates (see the method getTransformer in the class IlvManagerView).
Because of the possibility of a logical zoom (where the coordinates of the objects are changed according to the zoom level), there are two coordinate systems in use in JViews TGO:
  • Stationary coordinates. Coordinates passed in this coordinate system do not change over time. This is the coordinate system used to set the position of an object through the method setPosition.
  • View coordinates. Coordinates given in this coordinate system change when the transformer of the view changes; for example, in the case of a scrollable view, when the user moves one of the scrollbars. This is the coordinate system seen by the layout optimizers and by the connection to the Rogue Wave JViews graph layout.
Depending on the method you use, it may be necessary to convert from one coordinate system to another.
To convert from stationary coordinates to view coordinates, apply network.getManagerView().getTransformer() . This rule holds good only for objects in the top-level network. It cannot be applied to subnetworks.
To convert back, apply the inverse transformer. (See the methods inverse and computeInverse in the class IlvTransformer.)

Physical zoom

Graphic representations of telecom objects make intensive use of labels and icons. Therefore, some graphic objects cannot be resized without deteriorating their aspect when the physical zoom mechanism is used. This effect is even more visible when unzooming. While some JViews TGO objects, like groups, can be resized, other objects, such as network elements, have been intentionally designed to have an optimal size depending on the quantity of information they hold. Resizing these objects impairs the readability and compactness of their graphic representation.
For these reasons, the physical zoom mode was implemented to hide the decorations of telecom objects according to a certain configurable zoom factor. This factor is called the visibility threshold and represents the absolute value of the determinant of the view transformer. When the value of this determinant is lower than the decoration visibility threshold, decorations of the affected type are no longer displayed.
The visibility threshold for each decoration type can be configured locally to a network component through the methods:
or through the CSS properties:
  • decorationNames
  • visibilityThresholds

How to set the visibility threshold for decorations in a specific network component

The following example describes a network component configuration that sets a physical zoom policy to the component, and defines visibility thresholds for the decorations Name , AlarmBalloon , AlarmCount and Plinth . Refer to Configuring a network component through a CSS file for more information.
Zooming {
  type: "Physical";
  decorationNames[0]: Name;
  decorationNames[1]: AlarmBalloon;
  decorationNames[2]: AlarmCount;
  decorationNames[3]: Plinth;
  visibilityThresholds[0]: 0.5;
  visibilityThresholds[1]: 0.8;
  visibilityThresholds[2]: 0.5;
  visibilityThresholds[3]: 0.5;
}
Visibility thresholds can also be configured globally for all network components through the methods:
  • IltrZoom. SetVisibilityThreshold. This method sets the value of the visibility threshold for the specified element name. This method defines, for a specific type of decoration, the threshold above which the decoration will disappear when the view is zoomed.

How to set the visibility threshold of decorations for all network components

The following example shows how you can customize the visibility threshold of specific decorations globally, so that all network components created in the application have the same configuration:
IltrZoom.SetVisibilityThreshold (IltGraphicElementName.Name, 0.5);
IltrZoom.SetVisibilityThreshold (IltGraphicElementName.AlarmBalloon, 0.8);
IltrZoom.SetVisibilityThreshold (IltGraphicElementName.AlarmCount, 0.5);
IltrZoom.SetVisibilityThreshold (IltGraphicElementName.Plinth, 0.5);

Logical zoom

The logical zoom effectively transforms the proportional zoom mechanism of Rogue Wave® JViews in such a way that the coordinates of JViews TGO objects in the manager are modified when the zoom factor changes. The effect of this operation is that network elements are not resized and the layout of the links is recalculated to correspond to the new coordinates of the nodes in the manager.
Only the main view of an IlpNetwork can hold the logical zoom support.

Combining physical and logical zoom (mixed zoom)

JViews TGO provides a mechanism that combines the physical and logical zoom policies. This mechanism is implemented by the class IltMixedZoomPolicy and uses physical zoom for zoom factors less than one and logical zoom for zoom factors greater than one, in the same view.
You can configure the zoom policy in the CSS file through the zooming property. For more information, see The Zooming rule.