Class TLspCustomizableStyle

java.lang.Object
com.luciad.view.lightspeed.style.styler.TLspCustomizableStyle
All Implemented Interfaces:
ILcdPropertyChangeSource

public final class TLspCustomizableStyle extends Object implements ILcdPropertyChangeSource
A customizable container for ALspStyle. In combination with ILspStyledLayer and TLspCustomizableStyler, it enables interactive style customization of existing layers in a view.

The contained ALspStyle can be inspected, disabled, or replaced. Refer to ALspStyle.asBuilder() to conveniently create style copies with cherry-picked changes.

Most default layer configurations come with customizable styles out of the box.

Since:
2012.0
See Also:
  • Constructor Details

    • TLspCustomizableStyle

      public TLspCustomizableStyle(ALspStyle aStyle, boolean aEnabled)
      Create a new, nameless TLspCustomizableStyle for aStyle
      Parameters:
      aStyle - The style for this container. Must not be null
      aEnabled - true when the style is enabled, false when the style is disabled
    • TLspCustomizableStyle

      public TLspCustomizableStyle(ALspStyle aStyle, boolean aEnabled, String aIdentifier, String aDisplayName)
      Create a new, named TLspCustomizableStyle for aStyle
      Parameters:
      aStyle - The style for this container. Must not be null
      aEnabled - true when the style is enabled, false when the style
      aIdentifier - The identifier for this style. May be null. See getIdentifier().
      aDisplayName - The display name for this style. May be null. See getDisplayName().
  • Method Details

    • getIdentifier

      public String getIdentifier()
      Returns the identifier associated with this style container. This identifier does not need to be unique and can be used for multiple purposes. An example use-case is styling a layer representing cities, where one wants to have separate styling for 'big' cities and 'small' cities. In this case this identifier can be used to mark the style which will be used for the 'big' cities and which will be used for 'small' cities.
      Returns:
      the name associated with this container. Can be null
    • getDisplayName

      public String getDisplayName()
      Returns a name for this style container which can be presented to the user and can be used in the UI.
      Returns:
      a name for this style container which can be presented to the user and can be used in the UI. Can be null
    • getStyle

      public ALspStyle getStyle()
      Returns the style contained in this container
      Returns:
      the style contained in this container. Will never be null
    • setStyle

      public void setStyle(ALspStyle aStyle)
      Set the new style for this container.
      Parameters:
      aStyle - the new style. Must not be null
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
      Description copied from interface: ILcdPropertyChangeSource

      Registers the given PropertyChangeListener to be notified when this object's properties change.

      In case you need to register a listener which keeps a reference to an object with a shorter life-time than this change source, you can use a ALcdWeakPropertyChangeListener instance as property change listener.

      Specified by:
      addPropertyChangeListener in interface ILcdPropertyChangeSource
      Parameters:
      aPropertyChangeListener - The listener to be notified
      See Also:
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
      Description copied from interface: ILcdPropertyChangeSource

      De-registers the given PropertyChangeListener from receiving property change events for this object.

      If the listener was added more than once, it will be notified one less time after being removed. If the listener is null, or was never added, no exception is thrown and no action is taken.

      Specified by:
      removePropertyChangeListener in interface ILcdPropertyChangeSource
      Parameters:
      aPropertyChangeListener - the listener that should no longer be notified of changes of this object's properties
      See Also:
    • isEnabled

      public boolean isEnabled()

      Returns whether this style is enabled or not. Disable styles will not be set by the TLspCustomizableStyler.

      When using a TLspCustomizableStyler, toggling this setting allows to switch a style on/off without the need to add/remove it from the list of styles in the styler.

      Returns:
      true when this style is enabled, false when the style is disabled.
    • setEnabled

      public void setEnabled(boolean aEnabled)
      Set the enabled state of this style
      Parameters:
      aEnabled - true to enable this style, false to disable
      See Also: