Package
Class
Use
Tree
Deprecated
Index
All Classes
Help
Prev Class
Next Class
VAppearances – Release 5
Class org.violetlib.vappearances.VAppearances
Inherited members: ShowHide
Deprecated: ShowHide
org.violetlib.vappearances

Class VAppearances

  • Object
    • VAppearances
  • public class VAppearances extends Object
    This class keeps track of macOS appearances and provides access to their attributes. The attributes of an appearance of interest to Java applications are the values of system colors, which are context dependent.

    On macOS 10.14 and later, there are four standard appearances, but only two appear to be used: one for light mode and one for dark mode. Previously, there was just one standard appearance. The standard appearances are identified using standard names.

    The system color values depend upon the selected appearance. Some system color values also depend on the selected accent color option, the selected highlight color option, and whether the increase contrast accessibility option is enabled. This context is represented as an instance of AppearanceSettings.

    AppKit applications are notified of changes to system colors in two ways. Some changes use a system color change notification or an accessibility option change notification. Others invoke the viewDidChangeEffectiveAppearance method on NSView instances. To ensure that this class has the current data, the implementation of this NSView method should provide the NSAppearance object to the native function VAppearances_updateAppearance(NSAppearance *).

    AppKit uses instances of NSAppearance in a tricky way. At any one time, there is a current NSAppearance object for each of the standard appearance names. However, at various times, new instances are created that replace the previous instances. This trickery is not important to Java, as Java identifies appearances by their standard names. The current NSAppearance is determined as needed using the name.

    • Nested Classes 
      Modifier and Type Class and Description
      Ordinary member indicator AppearanceChangeEvent Reveal DetailHide Detail
      static class AppearanceChangeEvent
      A change event that identifies a newly available appearance.
      static class AppearanceChangeEvent
      A change event that identifies a newly available appearance.
      See Also:
      Serialized Form
    • Fields 
      Modifier and Type Field and Description
      Ordinary member indicator aquaAppearance Reveal DetailHide Detail
      static String aquaAppearance
      The name of the light Aqua appearance
      public static final String aquaAppearance
      The name of the light Aqua appearance
      See Also:
      Constant Field Values
      Ordinary member indicator darkAquaAppearance Reveal DetailHide Detail
      static String darkAquaAppearance
      The name of the dark Aqua appearance
      public static final String darkAquaAppearance
      The name of the dark Aqua appearance
      See Also:
      Constant Field Values
      Ordinary member indicator vibrantDarkAppearance Reveal DetailHide Detail
      static String vibrantDarkAppearance
      The name of the vibrant dark appearance
      public static final String vibrantDarkAppearance
      The name of the vibrant dark appearance
      See Also:
      Constant Field Values
      Ordinary member indicator vibrantLightAppearance Reveal DetailHide Detail
      static String vibrantLightAppearance
      The name of the vibrant light appearance
      public static final String vibrantLightAppearance
      The name of the vibrant light appearance
      See Also:
      Constant Field Values
    • Static Methods 
      Modifier and Type Static Method and Description
      Ordinary member indicator addChangeListener Reveal DetailHide Detail
      static void addChangeListener(ChangeListener listener)
      Register a change listener to be called when an appearance with a new name becomes known.
      public static void addChangeListener(ChangeListener listener)
      Register a change listener to be called when an appearance with a new name becomes known. All invocations of the listener are performed on the AWT event dispatching thread. The event, an instance of VAppearances.AppearanceChangeEvent, provides the object representing the appearance.
      Parameters:
      listener - The listener to be registered.
      Ordinary member indicator addEffectiveAppearanceChangeListener Reveal DetailHide Detail
      static void addEffectiveAppearanceChangeListener(ChangeListener listener)
      Register a change listener to be called when the application effective appearance is changed, for example, from light to dark or vice versa.
      public static void addEffectiveAppearanceChangeListener(ChangeListener listener)
      Register a change listener to be called when the application effective appearance is changed, for example, from light to dark or vice versa. The concept of an application effective appearance was introduced in macOS 10.14.

      This listener is also called when a system property changes that may affect the appearance system colors, such as the user specified accent color or highlight color.

      All invocations of the listener are performed on the AWT event dispatching thread.

      Parameters:
      listener - The listener to be registered.
      Ordinary member indicator addEffectiveAppearanceChangeRunner Reveal DetailHide Detail
      static void addEffectiveAppearanceChangeRunner(Runnable r)
      Register a handler to be called when the application effective appearance is changed, for example, from light to dark or vice versa.
      public static void addEffectiveAppearanceChangeRunner(Runnable r)
      Register a handler to be called when the application effective appearance is changed, for example, from light to dark or vice versa. The concept of an application effective appearance was introduced in macOS 10.14.

      The handler is also called when a system property changes that may affect the appearance system colors, such as the user specified accent color or highlight color.

      All invocations of the handler are performed on the AWT event dispatching thread.

      Parameters:
      r - The listener to be registered.
      Ordinary member indicator getAppearance Reveal DetailHide Detail
      static VAppearance getAppearance(String appearanceName)
      Return an object representing the specified appearance.
      public static VAppearance getAppearance(String appearanceName) throws IOException
      Return an object representing the specified appearance.
      Parameters:
      appearanceName - The appearance name.
      Returns:
      an object representing the associated appearance.
      Throws:
      IOException - if the appearance is not defined or not available.
      Ordinary member indicator getAppearanceSettings Reveal DetailHide Detail
      static AppearanceSettings getAppearanceSettings()
      Return the current appearance settings.
      public static AppearanceSettings getAppearanceSettings() throws IOException
      Return the current appearance settings. Appearance settings are settings whose values may influence the system colors.
      Throws:
      IOException
      Ordinary member indicator getApplicationEffectiveAppearance Reveal DetailHide Detail
      static VAppearance getApplicationEffectiveAppearance()
      Return an object representing the current effective appearance of the application and providing access to its attributes.
      public static VAppearance getApplicationEffectiveAppearance() throws IOException
      Return an object representing the current effective appearance of the application and providing access to its attributes.
      Returns:
      an object representing the associated appearance.
      Throws:
      IOException - if the appearance is not defined or not available, or if the data could not be obtained.
      Ordinary member indicator removeChangeListener Reveal DetailHide Detail
      static void removeChangeListener(ChangeListener listener)
      Unregister a previously registered change listener.
      public static void removeChangeListener(ChangeListener listener)
      Unregister a previously registered change listener.
      Parameters:
      listener - The listener to be unregistered.
      Ordinary member indicator removeEffectiveAppearanceChangeListener Reveal DetailHide Detail
      static void removeEffectiveAppearanceChangeListener(ChangeListener listener)
      Unregister a previously registered change listener.
      public static void removeEffectiveAppearanceChangeListener(ChangeListener listener)
      Unregister a previously registered change listener.
      Parameters:
      listener - The listener to be unregistered.
      Ordinary member indicator removeEffectiveAppearanceChangeRunner Reveal DetailHide Detail
      static void removeEffectiveAppearanceChangeRunner(Runnable r)
      Unregister a previously registered change handler.
      public static void removeEffectiveAppearanceChangeRunner(Runnable r)
      Unregister a previously registered change handler.
      Parameters:
      r - The handler to be unregistered.
      Ordinary member indicator setApplicationAppearance Reveal DetailHide Detail
      static void setApplicationAppearance(String appearanceName)
      Set the application appearance.
      public static void setApplicationAppearance(String appearanceName) throws IOException
      Set the application appearance. If not null, the application appearance supersedes the system appearance in determining the application effective appearance.
      Parameters:
      appearanceName - The name of the appearance, or null to cause the application to inherit its appearance from the system appearance.
      Throws:
      IOException - if the appearance is not defined.
      Ordinary member indicator setDebugFlag Reveal DetailHide Detail
      static void setDebugFlag(boolean b)
       
      public static void setDebugFlag(boolean b)
      • Methods inherited from class Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait