Class CbusFilterFrame

All Implemented Interfaces:
ComponentListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, BeanInterface, ModifiedFlag, WindowInterface

public class CbusFilterFrame
extends JmriJFrame
Frame to control an instance of CBUS filter to filter events. Currently used in CBUS Console + Event capture tool
See Also:
Serialized Form
  • Constructor Details

  • Method Details

    • updateListeners

      protected void updateListeners​(String text)
      Pass text to a CbusConsole instance.
      Parameters:
      text - to include in the Console Log.2
    • title

      @Nonnull protected String title()
      Get Filter Title.
      Returns:
      Title incorporating CbusConsole or Event Capture Instance.
    • initComponents

      public void initComponents()
      By default, Swing components should be created an installed in this method, rather than in the ctor itself.
      Overrides:
      initComponents in class JmriJFrame
    • addPaneToMap

      public void addPaneToMap​(JPanel fPane, CbusFilterPanel panel)
      Add Pane.
      Parameters:
      fPane - main Pane to add to
      panel - CbusFilterPanel to add
    • addNode

      public void addNode​(int nodenum, int position)
      Add Node to empty node Panel.
      Parameters:
      nodenum - Node Number
      position - Position in main Filter list
    • checkBoxChanged

      protected void checkBoxChanged​(int id, boolean newselected, @Nonnull CbusFilterType changedFilter)
      Change which categories are filtered.
      Parameters:
      id - Filter ID, includes the Node filters.
      newselected - If the category is now visible
      changedFilter - ENUM value of Category
    • showFiltersChanged

      protected void showFiltersChanged​(int id, boolean newselected, @Nonnull CbusFilterType categoryType)
      Change which categories are displayed following button click.
      Parameters:
      id - Filter ID, includes the Node filters.
      newselected - If the category is now visible
      categoryType - ENUM value of Category
    • passIncrement

      public void passIncrement​(int id)
      Increment a filter panel pass value
      Parameters:
      id - Panel ID
    • setMinMax

      protected void setMinMax​(@Nonnull CbusFilterType filter, int value)
      Set the event or node min and max values.
      Parameters:
      filter - CFEVENTMIN, CFEVENTMAX, CFNODEMIN or CFNODEMAX
      value - min or max value
    • filter

      public boolean filter​(@Nonnull AbstractMessage m)
      Filter a CanReply or CanMessage.
      Parameters:
      m - CanMessage or CanReply
      Returns:
      true when to apply filter, false to not filter.