[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: [Fwd: AnimationControl - turning animation string on/off.]
Bill-
Bill Hibbard wrote:
> The visad-renderer and visad-list mailing lists have 40 KB
> limits. Rather than sending attachments, please put files
> on ftp or http servers and just send the URLs, unless they
> are very short files.
>
> I have put your modifed AnimationControl.java,
> AnimationControlJ2D.java and AnimationControlJ3D.java in
> the Jar files at:
>
> ftp://ftp.ssec.wisc.edu/pub/visad-2.0/untested/
>
> Thank you for this work.
What do these mods do? Jim's note didn't say. I noticed you
checked in some other changes to change the way single
time fields were handled, but couldn't figure out how to
use them.
> By the way, does anyone recall is there is already a way to
> disable display of Animation Strings? It seems to me there
> may be, but I couldn't find it.
The way I do it in the IDV is to have a customized
DisplayRenderer which overrides setAnimationString():
/**
* Sets the animation string. Do nothing if toggled off
* in the NavigatedDisplay.
* @see NavigatedDisplay#setAnimationStringOn(boolean)
*/
public void setAnimationString(String[] animation) {
if (navDisplay != null && !navDisplay.getAnimationStringOn()) {
animation = new String[] {null, null};
}
super.setAnimationString(animation);
}
(full source is attached, should make the 40k limit). Maybe this
could be rolled into DisplayRenderer somehow with a
set/getAnimationStringOn() method just like we have
set/getCursorStringOn()? At one point, this was the only
reason I needed a custom DisplayRenderer for these classes which
seemed a lot of work to go through just to turn off the
animation string.
Actually, looking at the code for setCursorStringOn, it looks
like all it might take is adding this to DisplayRenderer?:
private boolean aniStringVisible = true;
/**
* Set whether the animation info should be visible in the display
* or not.
* @param visible true to show the animation info
*/
public void setAnimationStringVisible(boolean visible) {
aniStringOn = visible;
}
/**
* Return whether the animation info should be visible in the display
* or not.
* @return true if the animation info should be shown
*/
public void getAnimationStringVisible() {
return aniStringVisible;
}
/**
* Return Array of <CODE>String</CODE>s describing the
* animation sequence
* @return The animation description
*/
public String[] getAnimationString() {
if (aniStringVisible) {
return animationString;
}
else {
return new String[] { null, null };
}
}
If it's that simple, maybe we should do it.
Don
*************************************************************
Don Murray UCAR Unidata Program
dmurray@unidata.ucar.edu P.O. Box 3000
(303) 497-8628 Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************
/*******************************************************************************
$Id: NavigatedDisplayRendererJ3D.java,v 1.2 2003/02/24 18:15:54 dmurray Exp $
Copyright © 1997-2002 Unidata Program Center/University Corporation for
Atmospheric Research, P.O. Box 3000, Boulder, CO 80307,
support@unidata.ucar.edu.
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*******************************************************************************/
package ucar.unidata.view.geoloc;
/**
* Provides a 3D renderer for a NavigatedDisplay in Java 3D
*
* @author MetApps Development Team
* @version $Revision: 1.2 $ $Date: 2003/02/24 18:15:54 $
*/
public class NavigatedDisplayRendererJ3D
extends visad.java3d.DefaultDisplayRendererJ3D
implements NavigatedDisplayRenderer
{
/**
* The associated display.
*/
private NavigatedDisplay navDisplay;
public void destroy () {
super.destroy ();
navDisplay = null;
}
/**
* Set the NavigatedDisplay associated with this instance
* @param navDisplay associated NavigatedDisplay
*/
public void setNavigatedDisplay(NavigatedDisplay navDisplay)
{
this.navDisplay = navDisplay;
}
/**
* Sets the animation string. Do nothing if toggled off
* in the NavigatedDisplay.
* @see NavigatedDisplay#setAnimationStringOn(boolean)
*/
public void setAnimationString(String[] animation) {
if (navDisplay != null && !navDisplay.getAnimationStringOn()) {
animation = new String[] {null, null};
}
super.setAnimationString(animation);
}
/**
* See if this is a 2D or 3D display
* @return display mode for this display (MODE_3D, MODE_2D, MODE_2Din3D)
*/
public int getDisplayMode() {
return NavigatedDisplay.MODE_3D;
}
}