Class AbstractStyleablePropertyBean

java.lang.Object
org.jhotdraw8.fxbase.styleable.AbstractStyleablePropertyBean
All Implemented Interfaces:
PropertyBean, StyleableBean, StyleablePropertyBean

public abstract class AbstractStyleablePropertyBean extends Object implements StyleablePropertyBean
AbstractStyleablePropertyBean.
Author:
Werner Randelshofer
  • Field Details

  • Constructor Details

    • AbstractStyleablePropertyBean

      public AbstractStyleablePropertyBean()
  • Method Details

    • createKeyMap

      protected Map<Key<?>,Integer> createKeyMap()
      Creates a key map for the SimpleStyleableMap that is used to store the properties of this object.

      This implementation creates one key map for this class, and shares it with all instances of this class.

      Returns:
      a new map
    • getProperties

      public final javafx.collections.ObservableMap<Key<?>,Object> getProperties()
      Returns the user properties.
      Specified by:
      getProperties in interface PropertyBean
      Returns:
      the map
    • getStyleableMap

      protected StyleableMap<Key<?>,Object> getStyleableMap()
    • getStyled

      public <T> @Nullable T getStyled(MapAccessor<T> key)
      Returns the style value.
      Specified by:
      getStyled in interface StyleablePropertyBean
      Type Parameters:
      T - The value type
      Parameters:
      key - The property key
      Returns:
      The styled value.
    • getStyled

      public <T> T getStyled(@Nullable javafx.css.StyleOrigin origin, MapAccessor<T> key)
      Description copied from interface: StyleablePropertyBean
      Returns the styled value.
      Specified by:
      getStyled in interface StyleablePropertyBean
      Type Parameters:
      T - The value type
      Parameters:
      origin - The style origin
      key - The property key
      Returns:
      The styled value.
    • containsMapAccessor

      public <T> boolean containsMapAccessor(javafx.css.StyleOrigin origin, MapAccessor<T> key)
      Description copied from interface: StyleablePropertyBean
      Returns if a key is present for that style origin.
      Specified by:
      containsMapAccessor in interface StyleablePropertyBean
      Type Parameters:
      T - The value type
      Parameters:
      origin - The style origin
      key - The property key
      Returns:
      True if a value is present.
    • setStyled

      public <T> @Nullable T setStyled(javafx.css.StyleOrigin origin, MapAccessor<T> key, T newValue)
      Sets the style value.
      Specified by:
      setStyled in interface StyleablePropertyBean
      Type Parameters:
      T - The value type
      Parameters:
      origin - The style origin
      key - The property key
      newValue - The new value
      Returns:
      The old value of that origin
    • remove

      public <T> @Nullable T remove(javafx.css.StyleOrigin origin, MapAccessor<T> key)
      Description copied from interface: StyleablePropertyBean
      Removes a value.
      Specified by:
      remove in interface StyleablePropertyBean
      Type Parameters:
      T - The value type
      Parameters:
      origin - The origin.
      key - The property key.
      Returns:
      The removed value.
    • removeAll

      public void removeAll(javafx.css.StyleOrigin origin)
      Description copied from interface: StyleablePropertyBean
      Removes all values of that style origin.
      Specified by:
      removeAll in interface StyleablePropertyBean
      Parameters:
      origin - The origin.
    • onPropertyChanged

      protected <T> void onPropertyChanged(Key<T> key, T oldValue, T newValue, boolean wasAdded, boolean wasRemoved)
      This method is invoked just before listeners are notified. This implementation is empty.
      Type Parameters:
      T - the type
      Parameters:
      key - the changed key
      oldValue - the old value
      newValue - the new value
      wasAdded -
      wasRemoved -
    • callObservers

      protected void callObservers(javafx.css.StyleOrigin origin, boolean willChange, javafx.collections.MapChangeListener.Change<Key<?>,Object> change)
      This method is invoked just before listeners are notified. This implementation is empty.
      Parameters:
      origin - the style origin
      willChange - true if the change is about to be performed, false if the change happened
      change - the change
    • resetStyledValues

      public void resetStyledValues()
      Description copied from interface: StyleablePropertyBean
      Removes all styled values on all origins except on the USER origin.
      Specified by:
      resetStyledValues in interface StyleablePropertyBean