Class SelectableItem<T>

java.lang.Object
qupath.lib.gui.SelectableItem<T>
Type Parameters:
T -

public class SelectableItem<T> extends Object
Helper class for managing items when only one of them may be selected. This is similar to a ToggleGroup, but without a dependency on any GUI components.
  • Property Details

  • Constructor Details

    • SelectableItem

      public SelectableItem(ObjectProperty<T> selected, T item)
      Constructor.
      Parameters:
      selected - the property that identifies which item is currently selected
      item - the current item to be wrapped within this class, and which may or may not be selected
  • Method Details

    • isSelected

      public boolean isSelected()
      Returns true if the value of the selected property equals getItem().
      Returns:
    • setSelected

      public void setSelected(boolean selected)
      Set the item to be selected.
      Parameters:
      selected -
    • selectedProperty

      public BooleanProperty selectedProperty()
      Property representing the item that has been selected (which may or may not be the same as getItem()).
      Returns:
      See Also:
    • getItem

      public T getItem()
      Get the current item.
      Returns: