SE401:Group19:Feature:Zoom

From Marks Wiki
Jump to navigation Jump to search

◄ Back

Description

The zoom feature (as one might expect) allows the user to zoom in and out on the current visible graph. This is valuable for aiding in the editing of large and complex diagrams. The user can quickly get an overall view of the system, then zoom in on an area of interest.

Development

Action

The main action of the zoom feature is to change the default font size for the elements of the graph. Zooming in increases the font size, and vice versa. FBench scales its graphs according to font size, so when the graph is redrawn, elements grow/shrink to reflect the new size.

Implementation

We wanted to provide a number of ways to access the zoom functionality. As such, two Actions were created for zooming in, and for zooming out. These actions call the zoom() method on the currently active GraphView object. We added two ways to access these actions, but more could potentially added if the need arose:

  • Zoom in/out toolbar buttons.
  • Mousewheel action.

Within the GraphView.zoom() method, the default font size is changed, and the graph redrawn.