Class SelectableLabel

All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, Component, LabelComponent, Displayable, InfoModel, LabelModel, Model, Selectable, PresentationModel, DepictedObject

public class SelectableLabel extends Label implements Selectable
A label component that is able to indicate a selected state. This component has no facility for interacting with the user.
Author:
Garret Wilson
  • Field Details

    • SELECTED_BACKGROUND_COLOR_PROPERTY

      public static final String SELECTED_BACKGROUND_COLOR_PROPERTY
      The bound property of the selected background color.
  • Constructor Details

    • SelectableLabel

      public SelectableLabel()
      Default constructor with a default info model.
    • SelectableLabel

      public SelectableLabel(InfoModel infoModel)
      Info model constructor.
      Parameters:
      infoModel - The component info model.
      Throws:
      NullPointerException - if the given info model is null.
  • Method Details

    • isSelected

      public boolean isSelected()
      Specified by:
      isSelected in interface Selectable
      Returns:
      Whether the object is selected.
    • setSelected

      public void setSelected(boolean newSelected)
      Description copied from interface: Selectable
      Sets whether the object is selected. This is a bound property of type Boolean.
      Specified by:
      setSelected in interface Selectable
      Parameters:
      newSelected - true if the object should be selected, else false.
      See Also:
    • getSelectedBackgroundColor

      public Color getSelectedBackgroundColor()
      Returns the selected background color of the component. The default value is Theme.COLOR_SELECTED_BACKGROUND.
      Returns:
      The selected background color of the component, or null if no selected background color is specified for this component.
    • setSelectedBackgroundColor

      public void setSelectedBackgroundColor(Color newSelectedBackgroundColor)
      Sets the selected background color of the component. This is a bound property.
      Parameters:
      newSelectedBackgroundColor - The selected background color of the component, or null if the default selected background color should be used.
      See Also: