Class BrowserController

java.lang.Object
xal.service.pvlogger.apputils.browser.BrowserController
All Implemented Interfaces:
BrowserModelListener, KeyValueRecordListener<KeyValueFilteredTableModel<PVRecord>,PVRecord>

BrowserController manages the selection state of the browser window.
Author:
tap
  • Field Details

    • model

      protected BrowserModel model
      browser model
    • selectedSnapshot

      protected MachineSnapshot selectedSnapshot
      selected Machine snapshot *
  • Constructor Details

    • BrowserController

      public BrowserController(BrowserModel model)
      Constructor
  • Method Details

    • addBrowserControllerListener

      public void addBrowserControllerListener(BrowserControllerListener listener)
      Add a listener of controller events from this controller
      Parameters:
      listener - the listener to add
    • removeBrowserControllerListener

      public void removeBrowserControllerListener(BrowserControllerListener listener)
      Remove the listener from receiving controller events from this controller
      Parameters:
      listener - the listener to remove
    • getPVTableModel

      public KeyValueFilteredTableModel<PVRecord> getPVTableModel()
      get the table model of PVs
    • getMachineSnapshotTableModel

      public KeyValueTableModel<MachineSnapshot> getMachineSnapshotTableModel()
      get the table model of machine snapshots
    • getChannelSnapshotTableModel

      public KeyValueTableModel<ChannelSnapshot> getChannelSnapshotTableModel()
      get the table model of channel snapshots
    • convertToPVs

      protected static String[] convertToPVs(ChannelWrapper[] wrappers)
      Convert the array of channel wrappers to an array of signals.
      Parameters:
      wrappers - the array of channel wrappers
      Returns:
      the corresponding array of signals
    • selectSignals

      public void selectSignals(boolean select)
      Select or deselect the collection of signals without affecting the selection status of other signals.
      Parameters:
      select - true to select signals and false to deselect signals
    • getSelectedSignals

      public List<String> getSelectedSignals()
      get the list of selected signals
    • filterSnapshots

      public ChannelSnapshot[] filterSnapshots(ChannelSnapshot[] snapshots)
      Filter each channel snapshot based on whether its signal is selected
      Parameters:
      snapshots - The snapshots to filter
      Returns:
      the array of filtered snapshots corresponding to selected signals
    • getModel

      public BrowserModel getModel()
      Get the main model
      Returns:
      the main model
    • setSelectedSnapshot

      public void setSelectedSnapshot(MachineSnapshot snapshot)
      Set the snapshot which is selected by the user
      Parameters:
      snapshot - the machine snapshot to select
    • connectionChanged

      public void connectionChanged(BrowserModel model)
      The model's connection has changed
      Specified by:
      connectionChanged in interface BrowserModelListener
      Parameters:
      model - The model whose connection changed
    • selectedChannelGroupChanged

      public void selectedChannelGroupChanged(BrowserModel model, ChannelGroup newGroup)
      Update the channel wrappers for the newly selected channel group and forward this event to the browser controller listeners.
      Specified by:
      selectedChannelGroupChanged in interface BrowserModelListener
      Parameters:
      model - the source of the event
      newGroup - the newly selected channel group
    • machineSnapshotsFetched

      public void machineSnapshotsFetched(BrowserModel model, MachineSnapshot[] snapshots)
      Handle the "machine snapshot fetched" event. Does nothing.
      Specified by:
      machineSnapshotsFetched in interface BrowserModelListener
      Parameters:
      model - the model providing the event
      snapshots - the new snapshots that have been fetched
    • recordModified

      public void recordModified(KeyValueFilteredTableModel<PVRecord> tableModel, PVRecord pvRecord, String keyPath, Object value)
      forward message that table record changed
      Specified by:
      recordModified in interface KeyValueRecordListener<KeyValueFilteredTableModel<PVRecord>,PVRecord>
      Parameters:
      tableModel - the source posting the modification event
      pvRecord - the record which was modified
      keyPath - the key path to the modified value
      value - the new value