Creating an AxisMorph units of length & tick marks? 
Author Message
 Creating an AxisMorph units of length & tick marks?

I'm stuck on the drawing ( implementation of drawOn: ).

In backtracing method calls in Canvas and related classes to try to figure
out how basic Morph drawing works, I've become overwhelmed.

Can somebody put me back on course by:

Pointing me to any good sources of information  on the interplay of Canvas
and related classes and the drawing methods used.

Give me a couple ideas on how they would implement such AxisMorph.  I
considered inhereting from LineMorph particularly trying to reuse
borderDashSpec.

Sven



Tue, 19 Oct 2004 04:01:46 GMT  
 Creating an AxisMorph units of length & tick marks?

Quote:

> I'm stuck on the drawing ( implementation of drawOn: ).

> In backtracing method calls in Canvas and related classes to try to figure
> out how basic Morph drawing works, I've become overwhelmed.

Yes, Morphic can be like that.

Basically, you could look at implementors of drawOn: and get a feel for
what's going on.

The Canvas methods are pretty simple.

Quote:
> Can somebody put me back on course by:

> Pointing me to any good sources of information  on the interplay of Canvas
> and related classes and the drawing methods used.

* implementors of drawOn:

* browse the Canvas hierarchy, looking at the various drawing methods.
In your case, you can probably get by with just the #line:to: family of
methods.

Quote:
> Give me a couple ideas on how they would implement such AxisMorph.  I
> considered inhereting from LineMorph particularly trying to reuse
> borderDashSpec.

That's going to give you a headache. Especially since LineMorph doesn't
actually exist as such (i.e. there are no instances of it possible). It's
just a wrapper around PolygonMorph. Which has a lot of functionality that
you don't want or need.

You want to inherit directly from Morph, I'd think.
I can't see re-using anything from anywhere else.
Override the drawOn: method. Use the Canvas>>line:to: methods. And the
drawString: methods.
Override containsPoint: and possibly the event handling if you want any user
interaction (or if you want to stay out of the way of the user).
Set a morphic layer number possibly if you want to stay below other things.



Sun, 24 Oct 2004 23:13:32 GMT  
 Creating an AxisMorph units of length & tick marks?
Hi Ned.  Thanks for the helpful tips.

In the time between my initial post and your reply, I found the already
existing ScaleMorph which provides most of the functionality I need.  It
also provides good examples of making tick marks. etc in it's drawOn:
method.

Appreciatively,
Sven


Quote:

> > I'm stuck on the drawing ( implementation of drawOn: ).

> > In backtracing method calls in Canvas and related classes to try to
figure
> > out how basic Morph drawing works, I've become overwhelmed.

> Yes, Morphic can be like that.

> Basically, you could look at implementors of drawOn: and get a feel for
> what's going on.

> The Canvas methods are pretty simple.

> > Can somebody put me back on course by:

> > Pointing me to any good sources of information  on the interplay of
Canvas
> > and related classes and the drawing methods used.

> * implementors of drawOn:

> * browse the Canvas hierarchy, looking at the various drawing methods.
> In your case, you can probably get by with just the #line:to: family of
> methods.

> > Give me a couple ideas on how they would implement such AxisMorph.  I
> > considered inhereting from LineMorph particularly trying to reuse
> > borderDashSpec.

> That's going to give you a headache. Especially since LineMorph doesn't
> actually exist as such (i.e. there are no instances of it possible). It's
> just a wrapper around PolygonMorph. Which has a lot of functionality that
> you don't want or need.

> You want to inherit directly from Morph, I'd think.
> I can't see re-using anything from anywhere else.
> Override the drawOn: method. Use the Canvas>>line:to: methods. And the
> drawString: methods.
> Override containsPoint: and possibly the event handling if you want any
user
> interaction (or if you want to stay out of the way of the user).
> Set a morphic layer number possibly if you want to stay below other
things.



Tue, 02 Nov 2004 03:19:38 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Tick Tick Tick Tick Tick Tick

2. In Back - Tick Tick Tick

3. C5.5 Release Candidate - Tick, Tick, Tick...

4. mark(Mark) and cut(Mark) primitives in prolog standard

5. mark(Mark) and cut(Mark) in prolog standard

6. Proposed reference words TICKS TICKS-PER-SECOND PAST?

7. capacitance per unit length

8. inifinity recursion && test/unit

9. Sliders & Ticks

10. Usage of compile ?compile >mark <mark <resolve >resolve

11. Creating fixed length text file

12. How to create a variable length constant?

 

 
Powered by phpBB® Forum Software