LinkComp, LinkView, PSLink - component subject, view, and
PostScript external representation for lines with connectable endpoints
#include <Unidraw/Components/link.h>
LinkComp is a GraphicComp defining a line with two pins on each
end. The line's endpoints will always coincide with the pins, even if they
are moved, thereby maintaining a graphical link between the objects to which
it is connected. LinkComp uses an Line graphic to define its initial
geometry and graphical attributes. LinkView is a GraphicView for displaying
the link. PSLink is a PostScriptView that externalizes the subject's
information in PostScript form.
- LinkView(LinkComp*
= nil)
- Create an LinkView, optionally supplying the subject.
- virtual
Manipulator* CreateManipulator(
- Viewer*,
Event&, Transformer*, Tool*
- )
- virtual void
InterpretManipulator(Manipulator*)
- LinkView redefines its response to manipulation with a GraphicCompTool.
The user clicks to specify the first endpoint of the link and then drags
to position the remaining endpoint. (Up)clicking on an existing connector
will establish a connection between it and the LinkComp's first (second)
pin. LinkView uses a ConnectManip to produce a gravitational attraction
between existing connectors and the second pin as the user drags to
position it. The endpoints will not be constrained by gravity.
LinkView will use ConnectCmds to connect the pin(s) to their target(s).
Pin(s) connected in this way will receive floating mobility; unconnected
pin(s) will be fixed.
- virtual void
First(Iterator&)
- virtual void
Last(Iterator&)
- virtual void
Next(Iterator&)
- virtual void
Prev(Iterator&)
- virtual boolean
Done(Iterator)
- GraphicView*
GetView(Iterator)
- void
SetView(GraphicView*, Iterator&)
- LinkView redefines GraphicView's traversal operations to make its pins
accessible to the Unidraw library. Thus Unidraw can determine the
connectors that belong to the component, for example, to support
ConnectManip's gravitational attraction effect.
- virtual void
GetEndpoints(Coord&, Coord&, Coord&, Coord&)
- Return the link's endpoints, in canvas coordinates.
- LinkComp*
GetLinkComp()
- Return the subject.
Event(3I), Graphic(3U), GraphicComp(3U), GraphicCompTool(3U),
GraphicView(3U), Grid(3U), PinComp(3U), PostScriptView(3U), Transformer(3I),
align(3U), edit(3U), manips(3U)