SE401:Group19:Feature:Zoom

From Marks Wiki
Revision as of 05:21, 3 November 2008 by Mark (Sọ̀rọ̀ | contribs) (3 revision(s))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.