Class FilterWidget

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class FilterWidget extends JPanel
This class defines a widget for a single BSim filter. At a minimum it will consist of a combobox containing the available filters. It may optionally contain a secondary widget for specifying filter values. This secondary widget is filter-specific; for most filter types it will be a text entry field but as long as it implements the proper interface it is valid.
See Also:
  • Constructor Details

    • FilterWidget

      public FilterWidget(List<BSimFilterType> filterTypes, Consumer<FilterWidget> removeConsumer, Callback changeListener)
      Constructs a new filter widget.
      Parameters:
      filterTypes - The list of filter types that can be chosen
      removeConsumer - the container to be notified that it should delete this object
      changeListener - listener to be notified when filter value changes
  • Method Details

    • setFilters

      public void setFilters(List<BSimFilterType> filters)
    • setFilter

      public void setFilter(BSimFilterType filter, List<String> values)
    • getSelectedFilter

      public BSimFilterType getSelectedFilter()
      Returns the selected filter.
      Returns:
      the filter
    • getValues

      public List<String> getValues()
      Returns all values in the filter as a list. For filters that do not allow multiple entries, this will always return a list of only one item.
      Returns:
      filter values
    • isBlank

      public boolean isBlank()
    • hasValidValue

      public boolean hasValidValue()