Package snap.view

Class ViewTheme

java.lang.Object
snap.view.ViewTheme

public class ViewTheme extends Object
A class to provide view area classes to define UI look.
  • Field Details

    • BACK_FILL

      protected Color BACK_FILL
    • GUTTER_FILL

      protected Color GUTTER_FILL
    • CONTENT_COLOR

      protected Color CONTENT_COLOR
    • CONTENT_ALT_COLOR

      protected Color CONTENT_ALT_COLOR
    • SEL_FILL

      protected Color SEL_FILL
    • TARG_FILL

      protected Color TARG_FILL
    • TEXT_COLOR

      protected Color TEXT_COLOR
    • TEXT_SEL_COLOR

      protected Color TEXT_SEL_COLOR
    • TEXT_TARG_COLOR

      protected Color TEXT_TARG_COLOR
    • BUTTON_COLOR

      protected Color BUTTON_COLOR
    • BUTTON_OVER_COLOR

      protected Color BUTTON_OVER_COLOR
    • BUTTON_PRESSED_COLOR

      protected Color BUTTON_PRESSED_COLOR
    • BUTTON_BORDER_COLOR

      protected Color BUTTON_BORDER_COLOR
    • BUTTON_BORDER_PRESSED_COLOR

      protected Color BUTTON_BORDER_PRESSED_COLOR
    • CONTENT_BORDER

      protected Border CONTENT_BORDER
  • Constructor Details

    • ViewTheme

      public ViewTheme()
      Constructor.
  • Method Details

    • initColors

      protected void initColors()
      Initialize colors.
    • getBackFill

      public Paint getBackFill()
      Returns the background fill.
    • getGutterFill

      public Paint getGutterFill()
      Returns the fill for gutter areas like scrollbar background or tabview button bar background.
    • getContentColor

      public Color getContentColor()
      Returns the color for content like text fields, text areas, list areas.
    • getContentAltColor

      public Color getContentAltColor()
      Returns the color for alternate content, like list area alternate rows.
    • getSelectedFill

      public Paint getSelectedFill()
      Returns the selection color.
    • getTargetedFill

      public Paint getTargetedFill()
      Returns the targeted color.
    • getTextColor

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

      public Color getTextSelectedColor()
      Returns the text color when in selected item.
    • getTextTargetedColor

      public Color getTextTargetedColor()
      Returns the text color when in targeted item.
    • getButtonColor

      public Color getButtonColor()
      Returns the button color.
    • getButtonOverColor

      public Color getButtonOverColor()
      Returns the button over color.
    • getButtonPressedColor

      public Color getButtonPressedColor()
      Returns the button pressed color.
    • getButtonBorderColor

      public Color getButtonBorderColor()
      Returns the button border color.
    • getButtonBorderPressedColor

      public Color getButtonBorderPressedColor()
      Returns the button border pressed color.
    • getContentBorder

      public Border getContentBorder()
      Returns the border for distinct content areas like Scrollview, Splitview, TableView, TreeView.
    • getButtonPainter

      public ButtonPainter getButtonPainter()
      Returns the button painter.
    • createButtonPainter

      protected ButtonPainter createButtonPainter()
      Creates the button painter.
    • initViewStyles

      protected void initViewStyles()
      Initialize ViewStyles.
    • getViewStyleForClass

      public ViewStyle getViewStyleForClass(Class<? extends View> viewClass)
      Returns the ViewStyle for given class.
    • setViewStylePropValue

      public void setViewStylePropValue(Class<? extends View> viewClass, String propName, Object aValue)
      Sets a View property value for given class, property name and value.
    • get

      public static ViewTheme get()
      Returns the current theme.
    • getLight

      public static ViewTheme getLight()
      Returns the light theme.
    • getDark

      public static ViewTheme getDark()
      Returns the dark theme.
    • getClassic

      public static ViewTheme getClassic()
      Returns the classic theme.
    • setThemeStyleDefaultsForViewAndOldTheme

      protected void setThemeStyleDefaultsForViewAndOldTheme(View aView, ViewTheme oldTheme)
      Sets the style property values for given view if they were previously set to default of given old theme.
    • setThemeForName

      public static void setThemeForName(String aName)
      Sets the theme to theme for given name.
    • setTheme

      public static void setTheme(ViewTheme newTheme)
      Sets the theme.