com.sun.j3d.utils.scenegraph.transparency

## Class TransparencySortController

- java.lang.Object
- - com.sun.j3d.utils.scenegraph.transparency.TransparencySortController

-     public class TransparencySortController
      extends java.lang.Object

  This class controls the Transparency Sorting scheme used by Java 3D when rendering transparent objects. By default (and in all previous versions of Java 3D) objects are sorted depending on the distance from the viewer of the centroid of their bounds. By supplying a different Comparator for a view using the static setComparator method the user can provide their own sorting scheme. The Comparator provided will be called with 2 objects of class TransparencySortGeom.
  Since:
    Java 3D 1.4

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TransparencySortController()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.Comparator` | `getComparator(View view)` Returns the comparator for the specified view
    `static void` | `setComparator(View view, java.util.Comparator comparator)` Set the comparator for the specified view.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TransparencySortController

          public TransparencySortController()

  - ### Method Detail

    - #### setComparator

          public static void setComparator(View view,
                           java.util.Comparator comparator)

      Set the comparator for the specified view. The comparators compare method will be called with 2 objects of type TransparencySortGeom and it's result should indicate which object is closer to the viewer. Object1 < Object2 if it is to be considered closer and rendered after.
      Parameters:
        `view` - the view to which the comparator applies
        `comparator` - the comparator to call

    - #### getComparator

          public static java.util.Comparator getComparator(View view)

      Returns the comparator for the specified view
      Returns:
        the comparator for the specified view, or null if there is no comparator for the view or the view is unknown.

Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.