Klasse BreakpointCondition

Alle implementierten Schnittstellen:
PointerInterface

public class BreakpointCondition extends Record
  • Konstruktordetails

  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • newAndBreakpointCondition

      public static BreakpointCondition newAndBreakpointCondition(@Nonnull BreakpointCondition condition_1, @Nonnull BreakpointCondition condition_2)
      Creates a condition that triggers when @condition_1 and @condition_2 are both
      true.
      Parameter:
      condition_1 - first condition
      condition_2 - second condition
      Gibt zurück:
      the newly created condition
    • newLengthBreakpointCondition

      public static BreakpointCondition newLengthBreakpointCondition(int type, double value, int unit)
      Creates a condition that triggers on length changes.
      Parameter:
      type - the length type
      value - the length value
      unit - the length unit
      Gibt zurück:
      the newly created condition
    • newOrBreakpointCondition

      public static BreakpointCondition newOrBreakpointCondition(@Nonnull BreakpointCondition condition_1, @Nonnull BreakpointCondition condition_2)
      Creates a condition that triggers when either @condition_1 or @condition_2 is
      true.
      Parameter:
      condition_1 - first condition
      condition_2 - second condition
      Gibt zurück:
      the newly created condition
    • newRatioBreakpointCondition

      public static BreakpointCondition newRatioBreakpointCondition(int type, int width, int height)
      Creates a condition that triggers on ratio changes.

      The ratio is represented as @width divided by @height.
      Parameter:
      type - the ratio type
      width - ratio width
      height - ratio height
      Gibt zurück:
      the newly created condition
    • copy

      public BreakpointCondition copy()
      Copies @self.
      Gibt zurück:
      a copy of @self
    • free

      public void free()
      Frees @self.
    • toStr

      public Str toStr()
      Returns a textual representation of @self.

      The returned string can be parsed by [func@BreakpointCondition.parse].
      Gibt zurück:
      A newly allocated text string
    • parse

      public static BreakpointCondition parse(@Nonnull Str str)
      Parses a condition from a string.

      Length conditions are specified as `<type>: <value>[<unit>]`, where:

      - `<type>` can be `min-width`, `max-width`, `min-height` or `max-height`
      - `<value>` is a fractional number
      - `<unit>` can be `px`, `pt` or `sp`

      If the unit is omitted, `px` is assumed.

      See [ctor@BreakpointCondition.new_length].

      Examples:

      - `min-width: 500px`
      - `min-height: 400pt`
      - `max-width: 100sp`
      - `max-height: 500`

      Ratio conditions are specified as `<type>: <width>[/<height>]`, where:

      - `<type>` can be `min-aspect-ratio` or `max-aspect-ratio`
      - `<width>` and `<height>` are integer numbers

      See [ctor@BreakpointCondition.new_ratio].

      The ratio is represented as `<width>` divided by `<height>`.

      If `<height>` is omitted, it's assumed to be 1.

      Examples:

      - `min-aspect-ratio: 4/3`
      - `max-aspect-ratio: 1`

      The logical operators `and`, `or` can be used to compose a complex condition
      as follows:

      - `<condition> and <condition>`: the condition is true when both
      `<condition>`s are true, same as when using
      [ctor@BreakpointCondition.new_and]
      - `<condition> or <condition>`: the condition is true when either of the
      `<condition>`s is true, same as when using
      [ctor@BreakpointCondition.new_or]

      Examples:

      - `min-width: 400px and max-aspect-ratio: 4/3`
      - `max-width: 360sp or max-width: 360px`

      Conditions can be further nested using parentheses, for example:

      - `min-width: 400px and (max-aspect-ratio: 4/3 or max-height: 400px)`

      If parentheses are omitted, the first operator takes priority.
      Parameter:
      str - the string specifying the condition
      Gibt zurück:
      the parsed condition
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()