VisualLink

VisualLink contains a VisualComponent and a HyperComponent. VisualComponent decides how VisualLink looks. HyperComponent is part of the stream of HyperComponents created by StreamFilters. Remember, HyperRenderer renders each HyperComponent, from the outputStream of StreamFilter, one by one by assigning it a RenderPolicy. RenderPolicy creates a VisualLink and put a VisualComponent in it. The structural component in that VisualLink is actually the same HyperComponent used by RenderPolicy to create the VisualLink.

CompositeLink and StructuredTextLink are two concrete subclasses of VisualLinks that comes with HyperTalk package.VisualLink doesn't make any assumptions on its visual and structural components. However, its subclasses make different assumptions on its visual components and structural components. These affect how they retrieve these components at run time. They are relfected in the method such as #charAt:, #textAt:, #structuralComponentAt:, and #allStructuralComponentAt:.

Several methods of VisualLinks are frequently used by LinkResolvers and Controllers:

#visualComponent
Returns the visualComponent of the VisualLink.

#structuralComponent
Returns the structuralComponent, such as WebComposite or WebComponent.

#structualComponent:at:
Returns the structuralComponent related to a point. For StructuredText, it may contain more than one structuralComponent at a given point. Currently, the first one in the collection is returned. If that is not the one inteneded, #allStructuralComponentsAt: should be used.

#allStructuralComponents:at:
Returns a collection of all the structuralComponents related to a given point.