R67 - modelint/flatland-model-diagram-editor GitHub Wiki
R67 / Generalization
Stem is a Floating Stem or Anchored Stem
An Anchored Stem is positioned by the user with an Anchor position. This position is later resolved to diagram coordinates. Anchored Stems are used in all Connector Types.
A Floating Stem is lined up with an opposing Anchored Stem so that a straight line is formed. The pairing of Anchored and Floating Stems is useful in both Binary and Tree Connectors.
With a Straight Binary Connector, there is no need for two user specified anchor positions. Since the Connector is a straight line, only one anchor position is necessary. In fact, there should only be one to ensure that we end up with a non-diagonal line when the coordinates are resolved.
The non-anchored Stem in a Straight Binary Connector is understood to float so that it is level with the opposing Anchored Stem. The position of a Floating Binary Stem is computed for a horizontal line by sharing the x coordinate of the opposing Anchored Stem. This is the y coordinate if the line is vertical.
The same situation can occur in a Tree Connector where one Leaf Stem is anchored while another is lined up with it straight across.
Constraint
ID + Connector in either subclass or ID + Connector + Stem type + Node + Face + Anchor position in the Anchored Stem subclass. Two different ID’s are referenced since the Anchored Stem is enforcing a constraint preventing two Anchored Stems from being placed in the same location on the same Node face.
Note: Will probably change the mechanism formalizing this constraint since the superclass ID references need to be the same