Class ZoomLevel

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

public final class ZoomLevel extends Object
A zoom level of a web page. Provides a set of the pre-defined constants. Each constant name consists of the "P_" prefix followed by a number. The number represents a zoom level in percents. For example, the P_25 and P_110 values represent the 25% and 110% zoom levels accordingly.
  • Field Details

  • Method Details

    • of

      public static ZoomLevel of(double value)
      Returns a ZoomLevel instance for the given double value.
      Parameters:
      value - double representation of the zoom level. For 100% zoom level the double value should be 1.0, for 25% – 0.25, etc. See the P_ zoom level constants.
      Returns:
      a ZoomLevel instance for the given double value
      Throws:
      IllegalArgumentException - when value is negative
    • 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.