[Grace-core] Cross platform graphics library

Kim Bruce kim at cs.pomona.edu
Tue Jan 28 14:39:48 PST 2014


Let's try not to get too upset here.  It's easy to miss affect with e-mails.  We are all trying to figure out what is happening with this model.  We will all make mistakes in interpretation.  We are trying to make this better.

Let me explain why I thought the fill was only set in the canvas.  As you point out all of the drawables have a method:
   fill -> Boolean
As I read it, that tells me whether an object is filled or not.  As far as I can tell there is no method
   fill:=(val:Boolean) -> Done
to set the fill of an object.  I must admit that I misread the fill method on the Canvas as allowing resetting of the fill component, but looking back it appears to also simply return a Boolean.

So how do I create a filled vs framed rectangle?  I assume there is a switch somewhere, but i couldn't see it.

Because of my experience in using objectdraw, I'm happiest with having separate constructors for filled and framed rectangles, but I can also understand wanting a design that allows one to flip the fill state.

Again, for me the bottom line is whether or not objectdraw (or something very close to it) can be encoded with this library.

Kim



On Jan 28, 2014, at 12:58 PM, Alex Sandilands <sandilands.alex at gmail.com> wrote:

> 
> On Wed, Jan 29, 2014 at 4:22 AM, Andrew P. Black <black at cs.pdx.edu> wrote:
> I didn’t notice this — but then, as I said, I don’ understand the overall model.  But I think that its a disaster!  The kind of object you get should depend on the arguments to the factory that creates it, not on what canvas it is eventually pasted onto.
> 
> O_o
> Did you read actually read it? Every basic shape other than line and image has:
> 
> // Defines whether this shape should be filled
> fill -> Boolean
> 
> // If not filled, this is the width of the outline
> lineWidth -> Number
> 
> 
> As for the comments about it being non-OO, I thought I made it pretty clear that both options are available. I didn't want to restrict anything.
> I like being able to use the Java style canvas.draw.... methods, but I also like being able to do things like
> 
> def r = g.createRectangle( ... )
> canvas.add(r)
> 
> which is the OO style you are looking for. You can do that. Have a look at some of the test programs
> _______________________________________________
> Grace-core mailing list
> Grace-core at cecs.pdx.edu
> https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20140128/6c83778c/attachment.html>


More information about the Grace-core mailing list