public interface Widget extends Component, Sourced
data sources
and has the ability to
modify that data. It is up to the widget implementation to modify the backing data; some widgets
(for example, a graph widget) may be read-only. Simple widgets can display singular data points
(eg some text, a number, a boolean value, etc); composite widgets display complex data like
subsystems or sensors.
Widget subclasses should have the @Description
annotation that specifies
the name, summary, and supported data types. Additionally, subclasses that are FXML controllers
must have the @ParametrizedController
annotation that specifies
the location of the FXML file relative to that class.
Widgets have a few important properties:
The name of a widget should be unique much like a class or package name. It's a human-readable identifier that allows users to easily understand what widgets are being displayed, and which widgets can display which data types.
All widgets can display some arbitrary amount and combination of data types
.
By specifying these data types, the widget declares that it can always handle that kind of
data. For example, a "Text Display" widget could hypothetically support String, Number, and
Boolean. This means that any data of type String, Number, or Boolean could be displayed with a
"Text Display" widget.
The data source provides an easy way for a widget to get information about the data it
handles. More information about data sources can be found here
.
titleProperty
Modifier and Type | Method and Description |
---|---|
default java.util.stream.Stream<Component> |
allComponents()
All of the components contained by or represented by this one, if any.
|
java.util.List<? extends javafx.beans.property.Property<?>> |
getProperties()
Gets the user-configurable properties for this widget.
|
getName, getTitle, getView, setTitle, titleProperty
addSource, getDataTypes, getSources, removeAllSources, removeSource
java.util.List<? extends javafx.beans.property.Property<?>> getProperties()
default java.util.stream.Stream<Component> allComponents()
Component
allComponents
in interface Component