Working with Shapes Gluing

Get the Connectors Glued to a Particular Shape

Add and Connect Visio Shapes explains how to add a shape and connect it to other shapes in Microsoft Visio diagrams using Aspose.Diagram for Java. It is also possible to find connectors that are glued to this shape.

Getting Glued Shapes

The GluedShapes method exposed by the Shape class can be used to get a list of the IDs of all the connectors glued to a shape, or, if the shape in question is a connector, the IDs of the shapes it’s connected to.The GetShape method, exposed by the ShapeCollection class, can then be used to find a shape by its ID.

The code below shows how to:

  1. Load a sample file.
  2. Access a particular shape.
  3. Get a list of IDs of all the connectors glued to this shape.

Get Connectors Glued Programming Sample

Use the following code in your Java application to find all the connectors glued to a shape using Aspose.Diagram for Java.

Glue Visio Shapes Together with Connection Point

Aspose.Diagram for Java allows developers glue shapes together through the connection points.

Glue Shapes

The GlueShapes method exposed by the Page class can be used.

Input diagram

todo:image_alt_text

The diagram after gluing the shapes

todo:image_alt_text

The code below shows how to:
  1. Load a sample file.
  2. Glue shapes.
  3. Save diagram.

Glue Visio Shapes Programming Sample

Use the following code in your Java application to glue shapes through the connection points:

Glue Shapes Inside the Container

Aspose.Diagram for Java enables developers to glue group shapes inside a container.

Glue Group Shape

The GlueShapesInContainer method exposed by the Page class can be used.

Input diagram

todo:image_alt_text

The diagram after gluing the group shapes

todo:image_alt_text

The code below shows how to:
  1. Load a sample file.
  2. Glue group shapes.
  3. Save diagram.

Glue Shapes Inside Programming Sample

Use the following code in your Java application to glue group shape inside a container: