Print

Print


Generally if it ends with "-ed", it's meant to display information, not to let the user modify it.  This is the case for OrientedPortrayal2D: it just shows the orientation.  It's a convenience mechanism because drawing object orientation is really, really common and nontrivial compared to, say, changing color.

The primary purpose of Oriented2D (and Scaled2D) is to provide a standard way that agents can indicate their orientation and size, and that such a thing exists, to interested objects.  Not sure why an interface like this would violate MVC, quite to the contrary.

Sean

On Mar 8, 2017, at 4:18 AM, Abrams, Marshall <[log in to unmask]> wrote:

> Not sure if maybe Iím missing something, but thought Iíd ask.  OrientedPortrayal2D seems unusual in that it has no methods for controlling its intended variation, i.e. its orientation.  Instead one makes the agent implement Oriented2D.  By contrast if you want the color of a portrayal to reflect the state of the agent, for example, you can override a method in the portrayal class and set the color based on the state of the agent.  Then the agent doesnít have have any features that reflect whatís going on in the UI.  Maybe thereís a way to control OrientedPortrayal2D that Iím not seeing, though.  Requiring that the agent implement Oriented2D seems like a small violation of the MVC model, but I suppose itís not that different from defining bean methods and other tricks (e.g. implementing Propertied) that one can use to allow Mason to provide object inspectors with almost no work on the modelerís part.  
> 
> Thanks-
> 
> Marshall
> 
> Marshall Abrams, Associate Professor 
> Department of Philosophy, University of Alabama at Birmingham
> Email: [log in to unmask]; Phone: (205) 996-7483;  Fax: (205) 975-6610
> Mail: HB 414A, 900 13th Street South, Birmingham, AL 35294-1260;  Office: HB 418
> Website: http://members.logical.net/~marshall
>