[GOODIE] NK-ConnectorsDemo.049.pr on Bob's Super Swiki

Ned Konz ned at bike-nomad.com
Wed Apr 4 19:11:00 UTC 2001


On Wednesday 04 April 2001 11:37, Brian Rice wrote:
> Okay, here's a decent-size list of comments:
Thanks, Brian!

> - Please add an option to the yellow-button menu to force
> proportional (circular) dimensions for NCEllipseMorph. I think it
> would be very convenient to allow it to be resized smaller without
> having to think about the proportions.

Good idea. Meanwhile, you can hold down the Shift key while using the yellow 
resizing morph halo to get this effect.

> - There's a memory-related problem in NCScrolledCompositeState.
> Setting the scaling using the yellow menu option results in *very
> quickly* overflowing my squeak-allocated memory if I have less than
> about 7MB free (this is MacOS 9 where memory allocation is still
> static :P). With more memory, everything works fine and the memory
> usage goes back to normal once the playing is done.

Hmm... try the attached change to NCScrolledCompositeStateMorph>>setScale: 
that does a garbageCollectMost. Who knows, it could help...

> - Since you're developing this with UML in mind, I assume that there
> should be some way to attach symbols over your connectorMorphs, like
> diamonds and directed triangles and such. Because UML isn't my only
> intended use for these, some kind of pluggability for these symbols
> would be desirable.
> Obviously there would need to be a way to specify
> whether some symbolic morph would stay aligned with the connector's
> direction or not, and of course it would follow the attachment
> policies. But then, you probably have this planned already.

The current limitation on arrowheads comes from PolygonMorph. It would be 
nice if PolygonMorph could have pluggable arrowheads, but right now it just 
has a Point as an arrowSpec. So you get various sizes of four kinds of 
arrowheads.

Attaching shapes to plain line ends programmatically using NCConstraintMorphs 
is possible (I've done it and it's worked), though it would take 
a bit of sophistication to get positioning right as the line was moved, as 
you point out.

This is on my list, anyway. I'll probably provide an API (and some UI 
support) for attaching arbitrary shapes to line ends. Or I could attach 
PolygonMorph and give it really pluggable line ends.

Note that this is probably needed to get Fabrik working with these connectors 
(having the special line ending symbols would be easier than putting them on 
the shapes).

Other attachments can be made easily by embedding arbitrary shapes in an 
NCConstraintMorph. But I'd like the relative offset logic from the 
NCLabelMorph to be available for these (so, for instance, you could attach an 
arbitrary shape at an arbitrary offset from the middle of a line). I think 
I'll refactor this (the NCLabelMorph adds its local offset to its target 
point, making it so you can easily move it and still keep it anchored).

> - Resizing images on the MakerButton results in divide-by-zero
> errors. This is probably just an unaddressed bug somewhere in WarpBlt
> allowing for 0.0 coordinate values in the scaling vector.

Hmm, I thought I fixed that. No, I fixed another similar problem.
Oh well, the attached method fixes that.

> - Thanks for the feature of having MakerButtons return objects
> instead of new class instances.

You're welcome. It seemed more in the spirit of Morphic to use a prototype 
object.

> Incidentally, using Genie to create UML morphs with Squeak on a
> touchpad seems like a killer UI for developers, especially since it
> could be made into an interactive editor for actual class
> relationships. Definitely a good whiteboard-style idea.

I thought so too...

> Now I need to keep reading my Squeak book until I grok what the
> easiest way is to take a diagram and put it on a canvas-type morph. I
> guess I should mention that the UI I am working on would take state
> diagrams of a certain kind and allow the user to manipulate each
> diagram in a separate plane, and allow multiple planes and their
> elements to interact between planes. Any ideas out there on what's a
> good way to start on this?

Well, you can look at the NCCompositeStateMorph and 
NCScrolledCompositeStateMorph classes, which actually contain PasteUpMorphs.

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com
-------------- next part --------------
'From Squeak3.1alpha of 7 March 2001 [latest update: #3848] on 4 April 2001 at 11:56:18 am'!

!NCScrolledCompositeStateMorph methodsFor: 'menus' stamp: 'nk 4/4/2001 11:55'!
setScale: aNumber
	self transformMorph scale: ((aNumber max: 0.1) min: 100).
	Smalltalk garbageCollectMost.! !
-------------- next part --------------
'From Squeak3.1alpha of 7 March 2001 [latest update: #3848] on 4 April 2001 at 12:09:33 pm'!

!SketchMorph methodsFor: 'geometry' stamp: 'nk 4/4/2001 12:08'!
extent: newExtent
	"Change my scale to fit myself into the given extent."
	(newExtent y = 0 or: [ newExtent x = 0 ]) ifTrue: [ ^self ].
	self extent = newExtent ifTrue:[^self].
	scalePoint _ newExtent asFloatPoint / originalForm extent.
	self layoutChanged.
! !


More information about the Squeak-dev mailing list