Setting Diagram Viewport by Natalia Balatskova


In a previous post, we described how to create a layout for the Diagram component.  In this post, we’ll focus specifically on how to control the initial position and zoom level of the Diagram.

By default, the Diagram content will be zoomed to fit and placed at the component center. This is done to allow users to see the Diagram as a whole. However, in some cases you might want to display the Diagram using a specific zoom level or pan the Diagram to a position to emphasize one of the nodes. You should be able to achieve this by calling setViewport() method in your layout. The setViewport() method is available on DvtDiagramLayoutContext object that is passed to the layout. The method expects an object with x, y, w, h properties that describes the visible viewport in layout coordinates.

Here is how it works. Let’s assume that you have only one 50×50 px node that is positioned by the layout at (0,0) and the following component binding: Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Technorati Tags: PaaS,Cloud,Middleware Update,WebLogic,WebLogic Community,Oracle,OPN,Jürgen Kress


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.