Problem with connectors, newGeneralizationRelationship
Ned Konz
ned at bike-nomad.com
Wed Jun 25 00:00:15 UTC 2003
On Tuesday 24 June 2003 06:49 am, dsiegel at acm.org wrote:
> I downloaded a 3.5-5180 image and loaded the connectors package.
>
> Here's my test case:
>
> NCClassHierarchyDiagrammer new
> draw: Object;
> draw: NCClassHierarchyDiagrammer.
>
> The connector morph comes up in the upper left corner
> of the World, and isn't visually connected to the TextRectangles.
Yes, this is something that I've fixed recently. I will have a new
version of Connectors available soon.
However, for now you can just fix the offending methods in
NCConnectorMorph:
connectFinishTo: aMorph
| old |
old _ constraints last input.
constraints last attachTo: aMorph at: aMorph center.
fsm trigger: #connectEndTo with: aMorph.
^old
connectStartTo: aMorph
| old |
old _ constraints first input.
constraints first attachTo: aMorph at: aMorph center.
fsm trigger: #connectEndTo with: aMorph.
^old
> Is the morph constraint system documented anywhere?
> I feel like I'm just starting a steep learning curve.
It's not much of a constraint system. However, it's also not
documented.
Each NCConstraintMorph has a MessageSend that it evaluates to find its
new position (which it then uses to set its end of its connector).
How it sets up that message send depends on how you do the
attachment. Both the end and the thing it's attached to (its input)
can have preferences as to how this attachment happens, possibly
depending on where the attachment is going to occur. So for instance
we might want to permanently attach to a fixed point on the morph, or
have some other policy (like the nearest point along a line from the
center of the input to the next vertex of the connector, for
instance).
Look at NCConstraintMorph>>attachTo:at: to see what happens when this
attachment happens.
> Notwithstanding this little problem, connectors looks like
> an impressive piece of work. Thanks, ned.
Glad you like it!
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|