Interface Viewport

All Known Subinterfaces:
Viewport

public interface Viewport
Represents a viewport defined as per the CSS specifications.

The Viewport, together with the CSSCanvas, has a similar role to the W3C's Screen, with the big difference that some of the information that Screen provides is in fact available from the StyleDatabase.

  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Gets the width of the scrollbar that appears when a box overflows with scroll.
    int
    The viewport height, in natural units.
    int
    The viewport width, in natural units.
    boolean
    Tests whether the device is currently landscape or portrait.
  • Method Details

    • getViewportHeight

      int getViewportHeight()
      The viewport height, in natural units.
      Returns:
      the viewport height.
    • getViewportWidth

      int getViewportWidth()
      The viewport width, in natural units.
      Returns:
      the viewport width.
    • isLandscape

      boolean isLandscape()
      Tests whether the device is currently landscape or portrait.
      Returns:
      true if the device is currently landscape, false otherwise.
    • getScrollbarWidth

      float getScrollbarWidth()
      Gets the width of the scrollbar that appears when a box overflows with scroll.
      Returns:
      the width of the scrollbar.