Package qupath.lib.gui
Class SelectableItem<T>
java.lang.Object
qupath.lib.gui.SelectableItem<T>
- Type Parameters:
T
-
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 Summary
TypePropertyDescriptionProperty representing the item that has been selected (which may or may not be the same asgetItem()
). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetItem()
Get the current item.boolean
Returns true if the value of the selected property equalsgetItem()
.Property representing the item that has been selected (which may or may not be the same asgetItem()
).void
setSelected
(boolean selected) Set the item to be selected.
-
Property Details
-
selected
Property representing the item that has been selected (which may or may not be the same asgetItem()
).- See Also:
-
-
Constructor Details
-
SelectableItem
Constructor.- Parameters:
selected
- the property that identifies which item is currently selecteditem
- 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 equalsgetItem()
.- Returns:
-
setSelected
public void setSelected(boolean selected) Set the item to be selected.- Parameters:
selected
-
-
selectedProperty
Property representing the item that has been selected (which may or may not be the same asgetItem()
).- Returns:
- See Also:
-
getItem
Get the current item.- Returns:
-