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.
display.getDisplayRenderer().setBackgroundColor( Color.red );Even if it is a platform specific bug, do you suppose there is a workaround we could put in VisAD. This is a major blemish in a highly visible app I'm developing.
BTW, I see the same problem when I use a map to SelectRange to cut off my data at some threshhold.
Thanks, Doug Don Murray wrote:
Bill/Doug- Bill Hibbard wrote:Thanks for the test program and the image. However, when I run your test program I don't get the white border shown in your image. For me, the image is quite similar with or without texture mapping. I'm running JDK 1.4.1_01 and Java3D 1.3.1 on Sparc Solaris. Maybe someone else can try?Under Linux with JDK 1.4.2 and Java 3D 1.3, I see the white edge, but under Windows, using Java 3D with OpenGL gives the white edge, but the Direct X version does not. Don ************************************************************* Don Murray UCAR Unidata Program dmurray@xxxxxxxxxxxxxxxx P.O. Box 3000 (303) 497-8628 Boulder, CO 80307 http://www.unidata.ucar.edu/staff/donm *************************************************************
-- *----------------------------------------------------------------------* | 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 | *----------------------------------------------------------------------*
import visad.*; import visad.util.DataUtility; import java.rmi.RemoteException; import java.io.IOException; import java.awt.*; import javax.swing.*; public class TestBug { public static void main(String args[]) throws VisADException, RemoteException, IOException { RealType range = RealType.getRealType( "foo" ); RealTupleType domain = RealTupleType.SpatialEarth2DTuple; FunctionType ftype = new FunctionType( domain, range ); int n = 100; Set set = new Linear2DSet(domain,1,n,n,1,n,n); float[][] samples = new float[1][n*n]; int ii=0; for ( int i=0; i<n; i++ ) { for ( int j=0; j<n; j++ ) { samples[0][ii]=(float)(Math.sin(3.14*i/n) * Math.sin(3.14*j/n)); if (samples[0][ii] < 0.2) samples[0][ii] = Float.NaN; ii++; } } FlatField field = new FlatField( ftype, set ); field.setSamples( samples ); DisplayImpl display = DataUtility.makeSimpleDisplay(field); display.getGraphicsModeControl().setTextureEnable( false ); display.getDisplayRenderer().setBackgroundColor( Color.red ); JFrame frame = new JFrame(); frame.getContentPane().add(display.getComponent()); frame.setSize(400, 400); frame.setVisible(true); } }
visad
archives: