Interface Display

All Known Implementing Classes:
AbstractDisplay, UnixDisplay

@PublicApi @Immutable public interface Display
Display refers to the information regarding a video source and monitor identified by the EDID standard.

getDisplayInfo() returns a DisplayInfo exposing the display's decoded attributes — manufacturer ID, product ID, serial number, physical dimensions, preferred resolution, model name, and the raw (or synthesized) EDID byte array.

Example: extracting monitor manufacturer and dimensions:

for (Display display : hal.getDisplays()) {
    DisplayInfo info = display.getDisplayInfo();
    System.out.println("Manufacturer: " + info.getManufacturerID());
    System.out.println("Product ID:   " + info.getProductID());
    System.out.printf("Size: %d cm x %d cm%n", info.getHcm(), info.getVcm());
}
For displays that report their attributes without providing an EDID (such as a built-in macOS Retina panel), DisplayInfo.isEdidSynthetic() returns true and DisplayInfo.getEdid() returns an EDID synthesized from those attributes.
See Also:
  • Method Details

    • getEdid

      @Deprecated byte[] getEdid()
      Deprecated.
      As of 7.4.0, use getDisplayInfo().getEdid() instead; the decoded attributes are also available directly from DisplayInfo. Scheduled for removal in the next major release.
      The EDID byte array.
      Returns:
      The EDID byte array, either reported by the display or, when DisplayInfo.isEdidSynthetic() is true, synthesized from the display's reported attributes.
    • getDisplayInfo

      DisplayInfo getDisplayInfo()
      The decoded display information.
      Returns:
      A DisplayInfo holding the display's decoded attributes.