Class BrowserController
java.lang.Object
xal.service.pvlogger.apputils.browser.BrowserController
- All Implemented Interfaces:
BrowserModelListener
,KeyValueRecordListener<KeyValueFilteredTableModel<PVRecord>,
PVRecord>
public class BrowserController
extends Object
implements BrowserModelListener, KeyValueRecordListener<KeyValueFilteredTableModel<PVRecord>,PVRecord>
BrowserController manages the selection state of the browser window.
- Author:
- tap
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BrowserModel
browser modelprotected MachineSnapshot
selected Machine snapshot * -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a listener of controller events from this controllervoid
connectionChanged
(BrowserModel model) The model's connection has changedprotected static String[]
convertToPVs
(ChannelWrapper[] wrappers) Convert the array of channel wrappers to an array of signals.filterSnapshots
(ChannelSnapshot[] snapshots) Filter each channel snapshot based on whether its signal is selectedget the table model of channel snapshotsget the table model of machine snapshotsgetModel()
Get the main modelget the table model of PVsget the list of selected signalsvoid
machineSnapshotsFetched
(BrowserModel model, MachineSnapshot[] snapshots) Handle the "machine snapshot fetched" event.void
recordModified
(KeyValueFilteredTableModel<PVRecord> tableModel, PVRecord pvRecord, String keyPath, Object value) forward message that table record changedvoid
Remove the listener from receiving controller events from this controllervoid
selectedChannelGroupChanged
(BrowserModel model, ChannelGroup newGroup) Update the channel wrappers for the newly selected channel group and forward this event to the browser controller listeners.void
selectSignals
(boolean select) Select or deselect the collection of signals without affecting the selection status of other signals.void
setSelectedSnapshot
(MachineSnapshot snapshot) Set the snapshot which is selected by the user
-
Field Details
-
model
browser model -
selectedSnapshot
selected Machine snapshot *
-
-
Constructor Details
-
BrowserController
Constructor
-
-
Method Details
-
addBrowserControllerListener
Add a listener of controller events from this controller- Parameters:
listener
- the listener to add
-
removeBrowserControllerListener
Remove the listener from receiving controller events from this controller- Parameters:
listener
- the listener to remove
-
getPVTableModel
get the table model of PVs -
getMachineSnapshotTableModel
get the table model of machine snapshots -
getChannelSnapshotTableModel
get the table model of channel snapshots -
convertToPVs
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
get the list of selected signals -
filterSnapshots
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
Get the main model- Returns:
- the main model
-
setSelectedSnapshot
Set the snapshot which is selected by the user- Parameters:
snapshot
- the machine snapshot to select
-
connectionChanged
The model's connection has changed- Specified by:
connectionChanged
in interfaceBrowserModelListener
- Parameters:
model
- The model whose connection changed
-
selectedChannelGroupChanged
Update the channel wrappers for the newly selected channel group and forward this event to the browser controller listeners.- Specified by:
selectedChannelGroupChanged
in interfaceBrowserModelListener
- Parameters:
model
- the source of the eventnewGroup
- the newly selected channel group
-
machineSnapshotsFetched
Handle the "machine snapshot fetched" event. Does nothing.- Specified by:
machineSnapshotsFetched
in interfaceBrowserModelListener
- Parameters:
model
- the model providing the eventsnapshots
- 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 interfaceKeyValueRecordListener<KeyValueFilteredTableModel<PVRecord>,
PVRecord> - Parameters:
tableModel
- the source posting the modification eventpvRecord
- the record which was modifiedkeyPath
- the key path to the modified valuevalue
- the new value
-