Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.media.nativewindow
Class DefaultCapabilitiesChooser

    java.lang.Object
      javax.media.nativewindow.DefaultCapabilitiesChooser

All Implemented Interfaces:
  CapabilitiesChooser

    public class DefaultCapabilitiesChooser

extends Object
implements CapabilitiesChooser

The default implementation of the `CapabilitiesChooser` interface, which provides consistent visual selection behavior across platforms. The precise algorithm is deliberately left loosely specified. Some properties are:

- Attempts to match as closely as possible the given Capabilities, but will select one with fewer capabilities (i.e., lower color depth) if necessary.
- If there is no exact match, prefers a more-capable visual to a less-capable one.
- If there is more than one exact match, chooses an arbitrary one.
- If a valid windowSystemRecommendedChoice parameter is supplied, chooses that instead of using the cross-platform code.

  Constructor Summary
  `DefaultCapabilitiesChooser()`

  Method Summary
  `int` | `chooseCapabilities(Capabilities desired, Capabilities[] available, int windowSystemRecommendedChoice)` Chooses the index (0..available.length - 1) of the `Capabilities` most closely matching the desired one from the list of all supported.

  Methods inherited from class java.lang.Object
  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  Constructor Detail

  ### DefaultCapabilitiesChooser

      public DefaultCapabilitiesChooser()

  Method Detail

  ### chooseCapabilities

      public int chooseCapabilities(Capabilities desired,
                                    Capabilities[] available,
                                    int windowSystemRecommendedChoice)

    Description copied from interface: `CapabilitiesChooser`
    Chooses the index (0..available.length - 1) of the `Capabilities` most closely matching the desired one from the list of all supported. Some of the entries in the `available` array may be null; the chooser must ignore these. The windowSystemRecommendedChoice parameter may be provided to the chooser by the underlying window system; if this index is valid, it is recommended, but not necessarily required, that the chooser select that entry.

    Note: this method is called automatically by the `GraphicsConfigurationFactory.chooseGraphicsConfiguration(javax.media.nativewindow.Capabilities, javax.media.nativewindow.CapabilitiesChooser, javax.media.nativewindow.AbstractGraphicsScreen)` method when an instance of this class is passed in to it. It should generally not be invoked by users directly, unless it is desired to delegate the choice to some other CapabilitiesChooser object.

    Specified by:
      `chooseCapabilities` in interface `CapabilitiesChooser`

  Overview | Package | Class | Tree | Deprecated | Index | Help
  PREV CLASS NEXT CLASS | FRAMES NO FRAMES
  SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

  Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.