NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: ScalarType: name cannot contain space

Bill Hibbard wrote:
> 
> Hi Doug,
> 
> > Is there a (good) reason why a ScalarType name "cannot contain space . (
> > or )"? I'd like to create RealTypes with nice names for display purposes
> > (e.g. "Wind Direction") but:
> > . . .
> 
> There are a number of places where VisAD parses MathType
> strings, and there may be applications out there that depend
> in some way on the fact that ScalarType names do not contain
> spaces.  However, I have added a method to ScalarMap:
> 
>   public void setUnderscoreToBlank(boolean u2b);
> 
> If you call it with u2b = true, then "_" will be replaced
> by " " in the name of the ScalarMap's ScalarType, in display
> axis labels, and in widgets.  See Test26.java and Test66.java
> in the visad/examples directory for demos of how to use this.
> 
> I hope this addresses your needs.
> 

That should work. 

Or I supose I could extend RealType and override validateName(). Don't
even think about making it "final". :-) (Part of me is still with the C
school of thought that allows the programmer to get himself into as much
trouble as he wants.)

Thanks,
Doug

-- 
*----------------------------------------------------------------------*
| Doug Lindholm, Software Engineer          |  E-mail: lind@xxxxxxxx   |
| Research Applications Program             |   Phone: 303-497-8374    |
| National Center for Atmospheric Research  |                          |
| P.O. Box 3000                             |     There's no place     |
| Boulder, Colorado 80307-3000              |        like $HOME        |
*----------------------------------------------------------------------*


  • 2000 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: