Class StyleVariantConfig
- java.lang.Object
-
- com.inductiveautomation.perspective.common.config.styles.StyleVariantConfig
-
public class StyleVariantConfig extends java.lang.Object
A style variant is one style or animated style, which might serve as the base style for a Style Class or as a media-query or pseudo-selector variant style.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StyleVariantConfig.GsonAdapter
-
Field Summary
Fields Modifier and Type Field Description AnimationConfig
animation
This is the style block + animation settings for animated styles.MediaQueryConfig
media
This will be non-null if this style variant is a media-query varient.PseudoSelector
pseudo
This will be non-null if this style variant is a pseudo-selector variant.StyleDeclarations
style
This is the style block for this variant for non-animated styles.
-
Constructor Summary
Constructors Constructor Description StyleVariantConfig()
StyleVariantConfig(StyleVariantConfig copy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(java.lang.StringBuilder css, java.lang.String className, java.lang.Integer variantIndex)
Compile this style to CSS format.boolean
equals(java.lang.Object obj)
boolean
isAnimated()
boolean
isDefaultStyle()
-
-
-
Field Detail
-
pseudo
public PseudoSelector pseudo
This will be non-null if this style variant is a pseudo-selector variant.
-
media
public MediaQueryConfig media
This will be non-null if this style variant is a media-query varient.
-
style
public StyleDeclarations style
This is the style block for this variant for non-animated styles.
-
animation
public AnimationConfig animation
This is the style block + animation settings for animated styles.
-
-
Constructor Detail
-
StyleVariantConfig
public StyleVariantConfig()
-
StyleVariantConfig
public StyleVariantConfig(StyleVariantConfig copy)
-
-
Method Detail
-
isDefaultStyle
public boolean isDefaultStyle()
-
isAnimated
public boolean isAnimated()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
append
public void append(@Nonnull java.lang.StringBuilder css, @Nonnull java.lang.String className, @Nullable java.lang.Integer variantIndex)
Compile this style to CSS format.For example, let's say we have the following style represented by its serialized JSON format:
Resource "A":
The output of this method will compile this style to CSS. The CSS class name is equal to the style project resource name prepended with "psc-":{ "declarations": { "paddingTop": "10em", "borderColor": "red" } }
.psc-A:in-range { border-color: red; }
- Parameters:
className
- The name of the CSS class to generatevariantIndex
- The index of this variant in the parent style class, or null if this is the base variant
-
-