## MASON-INTEREST-L@LISTSERV.GMU.EDU

#### View:

 Message: [ First | Previous | Next | Last ] By Topic: [ First | Previous | Next | Last ] By Author: [ First | Previous | Next | Last ] Font: Monospaced Font

Subject:

Re: MASON-INTEREST-L Digest - 24 Mar 2009 to 3 Apr 2009 (#2009-10)

From:

Mark Coletti <[log in to unmask]>

Reply-To:

MASON Multiagent Simulation Toolkit <[log in to unmask]>

Date:

Sun, 5 Apr 2009 15:38:32 -0400

Content-Type:

text/plain

Parts/Attachments:

 text/plain (32 lines)
 On Sat, Apr 4, 2009 at 8:47 PM, Gabriel Catalin Balan <[log in to unmask]> wrote: > I belive you want Method 2: interpolation: > > public SimpleColorMap(double minLevel, double maxLevel, Color minColor, Color maxColor) > > what you're doing is Method 1: color table. > > public SimpleColorMap(Color[] colorTable) > > Here's the relevant part of the javadoc comment for the SimpleColorMap > class: > >
• Method 1: a color table.  The user can provide an array of Colors; > if the numerical value, cast into an integer, is between 0 and (the > length of this array - 1), then the appropriate Color is returned. > >
• Method 2: color interpolation.  The user can provide a min-level, > min-Color, max-level, and max-Color. If the numerical value is below > min-level, then minColor is provided. If it's above max-level, then > max-Color is provided.  If it's between min-level and max-level, then a > linear interpolation between min-Color and max-Color is provided. It seems to me that the SimpleColorMap is not so simple since it's doing multiple things. It probably should be broken into two subclasses: DiscreteColorMap and ContinuousColorMap. SimpleColorMap means nothing since "simple" is an insufficient descriptor, but the suggested subclasses' respective functionality is apparent from their names. I didn't even think to look at the documentation for the color map because I suspected, incorrectly, the problem was elsewhere. But if those two subclasses were available I would have used the right one from the start.
• #### Search Archives

Advanced Options

#### Options

 Log In Get Password Search Archives Subscribe or Unsubscribe