Class BreakpointCondition
-
Constructor Summary
ConstructorsConstructorDescriptionBreakpointCondition(MemorySegment address) Create a BreakpointCondition proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic BreakpointConditionand(BreakpointCondition condition1, BreakpointCondition condition2) Creates a condition that triggers whencondition1andcondition2are both true.copy()Copiesself.voidfree()Freesself.static @Nullable TypegetType()Get the GType of the BreakpointCondition classstatic BreakpointConditionlength(BreakpointConditionLengthType type, double value, LengthUnit unit) Creates a condition that triggers on length changes.static BreakpointConditionor(BreakpointCondition condition1, BreakpointCondition condition2) Creates a condition that triggers when eithercondition1orcondition2is true.static BreakpointConditionParses a condition from a string.static BreakpointConditionratio(BreakpointConditionRatioType type, int width, int height) Creates a condition that triggers on ratio changes.toString()Returns a textual representation ofself.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
BreakpointCondition
Create a BreakpointCondition proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
-
Method Details
-
getType
Get the GType of the BreakpointCondition class- Returns:
- the GType
-
and
public static BreakpointCondition and(BreakpointCondition condition1, BreakpointCondition condition2) Creates a condition that triggers whencondition1andcondition2are both true.- Parameters:
condition1- first conditioncondition2- second condition- Returns:
- the newly created condition
- Since:
- 1.4
-
length
public static BreakpointCondition length(BreakpointConditionLengthType type, double value, LengthUnit unit) Creates a condition that triggers on length changes.- Parameters:
type- the length typevalue- the length valueunit- the length unit- Returns:
- the newly created condition
- Since:
- 1.4
-
or
public static BreakpointCondition or(BreakpointCondition condition1, BreakpointCondition condition2) Creates a condition that triggers when eithercondition1orcondition2is true.- Parameters:
condition1- first conditioncondition2- second condition- Returns:
- the newly created condition
- Since:
- 1.4
-
ratio
Creates a condition that triggers on ratio changes.The ratio is represented as
widthdivided byheight.- Parameters:
type- the ratio typewidth- ratio widthheight- ratio height- Returns:
- the newly created condition
- Since:
- 1.4
-
parse
Parses a condition from a string.Length conditions are specified as
<type>: <value>[<unit>], where:<type>can bemin-width,max-width,min-heightormax-height<value>is a fractional number<unit>can bepx,ptorsp
If the unit is omitted,
pxis assumed.See
length(org.gnome.adw.BreakpointConditionLengthType, double, org.gnome.adw.LengthUnit).Examples:
min-width: 500pxmin-height: 400ptmax-width: 100spmax-height: 500
Ratio conditions are specified as
<type>: <width>[/<height>], where:<type>can bemin-aspect-ratioormax-aspect-ratio<width>and<height>are integer numbers
See
ratio(org.gnome.adw.BreakpointConditionRatioType, int, int).The ratio is represented as
<width>divided by<height>.If
<height>is omitted, it's assumed to be 1.Examples:
min-aspect-ratio: 4/3max-aspect-ratio: 1
The logical operators
and,orcan 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 usingand(org.gnome.adw.BreakpointCondition, org.gnome.adw.BreakpointCondition)<condition> or <condition>: the condition is true when either of the<condition>s is true, same as when usingor(org.gnome.adw.BreakpointCondition, org.gnome.adw.BreakpointCondition)
Examples:
min-width: 400px and max-aspect-ratio: 4/3max-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.
- Parameters:
str- the string specifying the condition- Returns:
- the parsed condition
- Since:
- 1.4
-
copy
Copiesself.- Returns:
- a copy of this BreakpointCondition
- Since:
- 1.4
-
free
public void free()Freesself.- Since:
- 1.4
-
toString
Returns a textual representation ofself.The returned string can be parsed by
parse(java.lang.String).
-