swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: drawHistogramWithDouble ()


From: Paul E Johnson
Subject: Re: drawHistogramWithDouble ()
Date: Wed, 06 Feb 2002 13:50:36 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7) Gecko/20020104

This thread has me interested.

Maybe this is something we can talk over at Swarmfest. I'm often wishing Swarm had better graph things and don't know if the current design can accomplish them. I want scatterplots and bar charts and currently have to use addon things to get them.

I'm willing to try to fix up the Histogram class to work in a java compatible way. Is there a recommended JNI/Obj-C manual to explain about rewriting Obj-C code so that it can be accessed from Java?

Or, in the alternative, can I please ask.

1. Is this the problem: any Obj-C method that requires a pointer as input is not Java compatible?

Examples in Histogram.m:
- (void)drawHistogramWithDouble: (double *)points
- (void)drawHistogramWithInt: (int *)points



2. Is fixing the problem as easy as writing new methods that accept arrays rather than pointers??????

I mean does this fix it, even though the contents of the method do not change at all?

- drawHistogramWithDouble: (double[]) points
{
  unsigned i;

  for (i = 0; i < binCount; i++)
    [globalTkInterp eval: "%s element configure %s -data { %g %g }",
                    widgetName, elements[i], locations[i], points[i]];
}

Or I can leave the old method and name this:

- drawHistogramWithDoubleArray: (double[]) points

So I'd just systematically have to go through Histogram and make sure all methods we want exposed to the Java layer do not use pointers?

Then, after we make some change in the files that control the way Swarm compiles, then these methods would work in Java?


3. What the heck does this declaration mean and what is to be done about it?

- (void)setLabels: (const char * const *)l count: (unsigned)labelCount

I think this wants to receive from Java an array of Strings, which C sees as a two dimensional array of char. Is there any existing Obj-C example of how to pass through an array of Strings that I could learn from.


Marcus G. Daniels wrote:

"JM" == Marshall, James A R <address@hidden> writes:


JM> I'll be looking at this with interest as I'm moving over to
JM> Java from Objective-C...  I hope there's not too much missing!

Hmm, the wrong reason to switch to some other plotting toolkit is just
because of things that are "missing".  By adding a few methods to
Swarm it is usually possible to add pointer-free alternatives for the
sake of Java.  (And no, I'm not volunteering to do this for people
that just `identify the problem'.)

                  ==================================

--
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700


                 ==================================
  Swarm-Support is for discussion of the technical details of the day
  to day usage of Swarm.  For list administration needs (esp.
  [un]subscribing), please send a message to <address@hidden>
  with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]