The G2 class hierarchy provides the system-defined class
CONNECTION for use in defining connections. This section refers to CONNECTION and any system-defined or user-defined subclass of CONNECTION as a connection class. You can create a connection class that has the properties you need. For example, you may wish to create a connection class that displays as a green stripe with a black border. , and connection posts, both described in this section.
CLASS-DEFINITION whose primary direct superior is CONNECTION or any subclass of CONNECTION, following the directions under:
CLASS-DEFINITION's instantiability attributes when the primary direct superior is a connection class.
Cross-section-pattern
Stub-length
Junction-block
Defining Connection Regions
The Cross-section-pattern attribute lets you define connection regions to which you can assign a width and a color. When connection regions exist, you can refer to them in expressions. For example, during the execution of a KB, you could change the color of one or more connection regions to signal changes in events and status. Cross-section-pattern attribute automatically creates a corresponding DEFAULT-JUNCTION class.
Hint: While it is not a requirement, we recommend that you define connection cross-section patterns with a symmetrical design.
Here is how to specify the cross-section-pattern attribute:
Here is an example of a
Cross-section-pattern attribute value:
![]() |
change the region-name stripe-color of connection-class to color
change the electrical-flow stripe-color of my-connection to red
Stub-length attribute specifies the length of stubs as an integer in workspace units. While an object class definition defines the
class, location, and direction of the connection flow, the Stub-length attribute specifies the default length of the stub on a class instance. The default length is 20 (workspace units).
The
Junction-block attribute defines which junction block a connection will use. Junction-block attribute indicates the class of junction block to use at the intersection of two connections. Here is a junction block:
![]() |
junction-block-for-water-line
DEFAULT-JUNCTION subclass, which is an abstract object class. When G2 creates a new junction-block class automatically, the new class does not appear on the hierarchy of menus, but you can create an instance of it programmatically, or whenever you terminate connections. If a connection class inherits a cross-section-pattern, G2 does not create a new junction block class for the subclass automatically. However, if you edit the
Cross-section-pattern attribute and choose copy inherited path, G2 does two things:
Cross-section-pattern attribute exactly as it was specified in the superior class
DEFAULT-JUNCTION as the Direct-superior-class), we recommend that you do not. G2 creates a a junction-box class dynamically any time you specify a Cross-section-pattern in a connection definition. DEFAULT-JUNCTION as the direct superior class. By default, the icon for a
DEFAULT-JUNCTION subclass is a small grey square.