public class Preferences extends java.lang.Object{ // Fields public final static String COLOR_KEY_BLUE; public final static String COLOR_KEY_GREEN; public final static String COLOR_KEY_RED; public final static String DITHERING; public final static String ENGINE_OPTIMIZATIONS; public final static String FILL_MODE; public final static int FILL_MODE_POINT; public final static int FILL_MODE_SOLID; public final static int FILL_MODE_WIREFRAME; public final static String MAX_FRAMES_PER_SEC; public final static String OVERRIDE_APPLICATION_PREFERENCES; public final static String PERSPECTIVE_CORRECT; public final static String RGB_LIGHTING_MODE; public final static String SHADE_MODE; public final static int SHADE_MODE_FLAT; public final static int SHADE_MODE_GOURAUD; public final static int SHADE_MODE_PHONG; public final static String TEXTURE_QUALITY; public final static int TEXTURE_QUALITY_LINEAR; public final static int TEXTURE_QUALITY_NEAREST; public final static String USE_VIDEOMEM; public final static String USE_3-D_HW; // Constructor public Preferences(); // Methods public boolean getBoolean(String preference); public double getDouble(String preference); public int getInt(String preference); public String getString(String preference); public void propagate(); public void set(String preference, boolean value); public void set(String preference, double value); public void set(String preference, int value); public void set(String preference, String value); }
A Preferences object controls various model qualities (such as texturing and shading) and hardware preferences. The object contains methods both for setting and retrieving these values. Each preference is identified with a string and its value is set by either a boolean, an integer, or a double. Before getting or setting a preference, first obtain the Preference object with the Viewer.getPreferences method.
The first time DirectAnimation is run, it establishes the default preferences in the registry. This means the end-user can control what the default preference settings are. When the Viewer.getPreferences method is invoked, the Preferences object contains these settings. These settings can be overridden by calling the set() methods on the Preferences object.
A preference called OVERRIDE_APPLICATION_PREFERENCES allows the end-user to decide if a canvas or applet can override the other preferences. If it is TRUE, then explicitly setting the Preferences object will have no effect.
Constructs an Preferences object.
public Preferences( );
Returns the value of those preferences that are set by booleans.
public boolean getBoolean(
String preference
);
Returns a boolean. For more information about booleans, consult a Java reference.
Returns the value of those preferences that are set by a double.
public double getDouble(
String preference
);
Returns a double. For more information about doubles, consult a Java reference.
Returns the value of those preferences that are set by an integer.
public int getInt(
String preference
);
Returns an integer. For more information about integers, consult a Java reference.
Returns the name of a preference.
public String getString(
String preference
);
Returns the value of those preferences that are set by a string. For more information about strings, consult a Java reference.
Tells the system to use the new preferences. Use after calling Viewer.getPreferences and the Preference.set() methods but before the model is running.
public void propagate( );
Sets the value of those preferences that are determined by booleans.
public void set(
String preference,
boolean value
);
Sets the value of those preferences that are determined by doubles.
public void set(
String preference,
double value
);
Sets the value of those preferences that are determined by integers.
public void set(
String preference,
int value
);
Sets the value of those preferences that are determined by strings.
public void set(
String preference,
String value
);
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.