Morphic questions

Ned Konz ned at squeakland.org
Wed Dec 22 06:45:20 UTC 2004


On Tuesday 21 December 2004 9:43 pm, Michael Latta wrote:

> Thanks for your many answers, and for Connectors.  I have loaded the
> 2.0 version and I am starting to get to know it.  I like what I see so
> far.  If I get my project off the ground, Connectors will be integral
> to using Squeak.

I'm glad to hear it.

> A few more questions:
>
> 1) Is there documentation I should be looking at for using/programming
> Connectors?

Um... There have been articles and pieces thereof from time to time. I have 
threatened to make "documentation" but so far have not seemed to have done 
so.

If there's something you'd like to do, best bet might be to ask here and I or 
another Connectors user might be able to answer.

Connectors should be quite easy from a programmer's point of view (at least 
for doing the common kinds of things, or those things that I thought of). If 
it's not, it can probably be made to be so. And from a user's point of view, 
it's also potentially simple.

> 2) How does the Attachment Point Adjuster work?  I can drag one out,
> and turn the grid on and off, but the other buttons do not do anything.
>   How do I add/adjust the attachment points for shapes?

You should probably be trying Connectors using the Squeakland image. Sorry to 
say that, but I haven't gotten all the enhancements and bug fixes back into 
3.8 (much less the 3.7 versions).

That said, though:

* when you drop a shape onto the AP adjuster tool, its attachment points 
should appear as little red circles.

* You can drag those circles to position them, or you can drag them out of the 
window to dispose of them. To make new ones, just hit "Add" and you will get 
a new one in hand to drop on the shape.

* When you're finished adjusting the APs, just drag your shape out of the 
window. You can make the attachment policy such that connectors will stay 
anchored to the AP that they were initially attached to by using the "Make 
non-movable" button.

* Add Array adds more than one AP.

* The joystick moves the shape around with respect to the APs.

> 3) The performance is pretty good on my 1Ghz PowerBook.  Was another
> comment correct that no hardware acceleration is involved?

That's correct.

> 4) Is there some place I can set the default font 

Default font of what? If you mean the various shapes-with-text that come with 
Connectors, the idea is that you customize prototypes of your favorite 
shapes, instead of being forced to use the pre-existing shapes in the flaps, 
or in the button bars, or in the Objects tool. The MakerButton and the 
ButtonBar that come with Connectors are designed to make this easy for you. 
Just customize a shape the way you want it, and program a MakerButton 
(perhaps in a ButtonBar) with it. Now clicking the MakerButton will generate 
copies of that shape.

> so morphs default to 
> a true type font?  One of the biggest things that jumps out at me is
> the quality of the fonts on my Mac vs. Windows or default Squeak fonts.

Try loading the "Freetype2 Fonts Demo" package if you'd like to see some nicer 
looking font rendering.

> 5) When I copy some Connectors morphs (states) as PostScript the
> rounded corners become square corners.  I presume this is some method
> that is not getting overridden?

Yes, it's because neither I nor anyone else has made RoundRects work right 
with Postscript.

> 6) Have you experimented with large sets of morphs?  Say a diagram with
> 1000s of morphs on it with connectors?

Ted Kaehler says that this gets slow for even 450 or so Connectors. I haven't 
looked into the problem. I can suggest that if you're going to have lots of 
connectors, then you would be much better off not making them curves 
(smooth), since those take longer to draw.

I can imagine that this could be a problem, because each connector has a 
couple of live ends that are re-calculating their attachment points from time 
to time. I've tried to minimize the re-calculation, but they still need some 
time every tick to determine that they couldn't possibly have moved.

This is an architectural problem, probably; what is needed for big interactive 
drawings may well be a single global handler for user interaction that can 
limit redrawing and recalculation to possibly affected areas.

Connectors wasn't really designed for the kind of output-only stuff that (say) 
graphviz was; it was designed for user interaction. And that's a different 
problem. I was focused on trying to make the user interaction with a single 
connector as smooth as possible; the performance for really big drawings just 
was not a priority of mine.

-- 
Ned Konz
http://bike-nomad.com/squeak/



More information about the Squeak-dev mailing list