Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

[Fwd: Re: GraphicsModeControl: Axes scales ?]

Forgot to cc: list

-------- Original Message --------
Subject: Re: GraphicsModeControl: Axes scales ?
Date: Wed, 21 Feb 2001 08:30:15 -0700
From: Don Murray <dmurray@xxxxxxxxxxxxxxxx>
Organization: Unidata/UCAR
To: VSOP User <vsop@xxxxxxxxxxxx>
References: <Pine.LNX.4.21.0102211107140.28532-100000@xxxxxxxxxxxxxxxxxxxxx>

Hi Corne-

VSOP User wrote:
> Is it possible to change a axes interval and to label the
> intervals. I have used the following code to produce
> scales for my display:
> 
> GraphicsModeControl modeDisp
>     =(GraphicsModeControl) display[0].getGraphicsModeControl();
>         modeDisp.setScaleEnable(true);
> 
> This produce the scales for me and I have set the range between
> 0.0 and 1.0. The scales are only labled at 0.0 and 1.0
> but the four intervals are not.
>
> Is there a way put in more intervals and label them with the
> right value?

You can change the interval, but can't add more labels at the current time.  I'm
working on that enhancement, but don't expect to get it completed before the end
of March.  The enhancements will be made to the AxisScale class which is the
controling class for the look of a Scale.  Recent enhancements allow you to set
the major and minor tick spacing.  So in your example, if you only wanted ticks
at 0, .5, and 1.0, you could do something like:

     myScalarMap.getAxisScale().setMajorTickSpacing(.5);

This would still only have labels at 0 and 1.0.  You could also do something
like:

     AxisScale scale = myScalarMap.getAxisScale();
     scale.setMajorTickSpacing(1.0);
     scale.setMinorTickSpacing(.25);

which would give you large ticks at 0 and 1 and smaller ticks at .25, .5 and
.75.

My goal for adding more labels is to use a design similar to JSlider where you
can set the specific labels you want using a Hashtable of values.  This would
allow for Text labels as well as numeric labels.

If you have any suggestions on this implementation, please send them
along.

Don


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690