When the process is too complex and the process is too much, the entire flowchart cannot be fully displayed in one screen, and the scroll bar needs to be dragged to display it. This is somewhat inconvenient to understand the general situation of the whole process, Lenovo some look at the zoom function of the software, if you can increase the scale of the process, it can be a good solution to the flow diagram is too complex and inconvenient to see the problem.
Ten, increase the flow chart scaling function
Process scaling takes into account the scaling of activities and rules, and they are scaled slightly differently for activities and rules.
For activities, scaling affects two places, one is the active position, which is relative to the top and left properties of the container. The other is the size of the graph of the activity itself.
For rules, scaling affects only the location of the rule. If a rule is associated with an activity, the position of the rule is not scaled, but the location of the associated activity is changed.
The first step is to add a scaling method to the IElement interface, void Zoom (double zoomdeep), and the parameter Zoomdeep in this method illustrates the scaling scale. This method is implemented separately in the activities and rules below.
10.1 Activity Scaling
As mentioned above, the scaling of activities affects two aspects, one is the location of the activity, the other is the size of the activity. For a given scaling size (zoomdeep), you only need to apply the Zoomdeep to the location and size. But it's very important that zooming refers to the scaling of the original artwork, so you need to record the initial size of the activity, as well as the original location (where each position changes, such as when the activity is dragged, to record the position information).
Use the following method to scale an activity
Picture Original width
double origPictureWidth = 0;
Picture Original High
double origPictureHeight = 0;
Picture Original location
Point origPosition;
Whether the position has changed
boopositionIsChange = true;
public void Zoom(double zoomDeep)
{
if (origPictureWidth == 0)
{
origPictureWidth = sdPicture.PictureWidth;
origPictureHeight = sdPicture.PictureHeight;
}
if (positionIsChange)
{
origPosition = this.Position;
positionIsChange = false;
}
sdPicture.PictureHeight = origPictureHeight * zoomDeep;
sdPicture.PictureWidth = origPictureWidth * zoomDeep;
this.Position = new Point(origPosition.X * zoomDeep, origPosition.Y * zoomDeep);
}