Package snap.view

Class ViewStyle

java.lang.Object
snap.view.ViewStyle
All Implemented Interfaces:
Cloneable

public class ViewStyle extends Object implements Cloneable
This class provides values for view style properties.
  • Field Details

    • _align

      protected Pos _align
    • _margin

      protected Insets _margin
    • _padding

      protected Insets _padding
    • _spacing

      protected double _spacing
    • _fill

      protected Paint _fill
    • _border

      protected Border _border
    • _borderRadius

      protected double _borderRadius
    • _font

      protected Font _font
    • _textColor

      protected Color _textColor
  • Constructor Details

    • ViewStyle

      public ViewStyle(ViewTheme viewTheme)
      Constructor.
  • Method Details

    • getAlign

      public Pos getAlign()
      Returns the alignment.
    • getMargin

      public Insets getMargin()
      Returns the margin.
    • getPadding

      public Insets getPadding()
      Returns the padding.
    • getSpacing

      public double getSpacing()
      Returns the spacing.
    • getFill

      public Paint getFill()
      Returns fill paint.
    • getBorder

      public Border getBorder()
      Returns the border.
    • getBorderRadius

      public double getBorderRadius()
      Returns the radius for border rounded corners.
    • getFont

      public Font getFont()
      Returns the font.
    • getTextColor

      public Color getTextColor()
      Returns the text color.
    • getPropValue

      public Object getPropValue(String propName)
      Returns value for given property name.
    • setPropValue

      public void setPropValue(String propName, Object aValue)
      Sets value for given property name.
    • getPropDefaultForView

      public Object getPropDefaultForView(View aView, String propName)
      Returns the default prop value for view.
    • setStyleDefaultsForViewAndOldStyle

      protected void setStyleDefaultsForViewAndOldStyle(View aView, ViewStyle oldViewStyle)
      Sets the style property values for given view if they were previously set to default of given old style.
    • clone

      public ViewStyle clone()
      Standard clone implementation.
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class Object
    • getViewStyleForClassMapAndClass

      protected static ViewStyle getViewStyleForClassMapAndClass(Map<Class<?>,ViewStyle> viewStyles, Class<? extends View> viewClass)
      Returns the ViewStyle for given class.