Class ZoomLevel

java.lang.Object
com.teamdev.jxbrowser.zoom.ZoomLevel

public final class ZoomLevel extends Object
A zoom level of a web page.

The class provides a set of predefined constants. Each constant name consists of the "P_" prefix followed by a number, representing the zoom level as a percentage. For example, P_25 corresponds to a 25% zoom level, and P_110 corresponds to a 110% zoom level.

  • Field Details

  • Method Details

    • of

      public static ZoomLevel of(double value)
      Returns a ZoomLevel instance for the given double value.
      Parameters:
      value - the level as a double value. For a 100% zoom level, the value should be 1.0; for 25% it should be 0.25, and so on. See the P_ zoom level constants for reference.
      Returns:
      a ZoomLevel instance for the given double value
      Throws:
      IllegalArgumentException - when value is negative
      See Also:
    • values

      public static List<ZoomLevel> values()
      Returns an immutable list of the pre-defined zoom levels.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • value

      public double value()
      Returns double representation of the current zoom level.