public abstract class AbstractMonitorView2 extends AbstractMonitorView1
Classes extending AbstractMonitorView2 should implement resetChannels()
and, optionally,createChannelHandle(String, AgentChannel, Updatable),
AbstractMonitorView1.connect(AgentInfo), and AbstractMonitorView1.disconnect(AgentInfo) methods.
As long as implementations of AgentStatusListener methods,
addChannels(AgentInfo agent, Map), removeChannels(AgentInfo, List),
and updateChannels(AgentInfo, Map) provided by this adapter are left unchanged,
the view will be updated automatically in response to status aggregator events.
AbstractMonitorView1.Descriptor| Modifier and Type | Field and Description |
|---|---|
protected LinkedHashMap<String,ChannelHandle> |
path2data |
descriptor, filter| Constructor and Description |
|---|
AbstractMonitorView2() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addChannels(org.lsst.ccs.bus.data.AgentInfo agent,
Map<String,AgentChannel> channels)
Adds channels to display.
|
protected ChannelHandle |
createChannelHandle(String path,
AgentChannel channel,
Updatable view)
Creates a new instance of
ChannelHandle. |
boolean |
isEmpty()
Returns
true if this view has no content to display at the moment. |
protected void |
removeChannels(org.lsst.ccs.bus.data.AgentInfo agent,
List<String> paths)
Removes a channels from this view.
|
protected abstract void |
resetChannels()
Should be implemented to completely rebuild the view based on
path2data field. |
protected void |
updateChannels(org.lsst.ccs.bus.data.AgentInfo agent,
Map<String,Map.Entry<AgentChannel,List<String>>> channels)
Called to notify this view that the specified channels have been updated.
|
configure, connect, connect, disconnect, disconnect, getDescriptor, getFilter, isChannelListFixed, restore, save, setFilter, statusChangedprotected final LinkedHashMap<String,ChannelHandle> path2data
public boolean isEmpty()
MonitorViewtrue if this view has no content to display at the moment.
This can be used report that the view can be closed, for example.
The default implementation returns false.protected final void addChannels(org.lsst.ccs.bus.data.AgentInfo agent,
Map<String,AgentChannel> channels)
addChannels in class AbstractMonitorView1agent - Source agent.channels - Map of paths to channels.protected final void removeChannels(org.lsst.ccs.bus.data.AgentInfo agent,
List<String> paths)
removeChannels in class AbstractMonitorView1agent - Source agent.paths - Paths to remove.protected final void updateChannels(org.lsst.ccs.bus.data.AgentInfo agent,
Map<String,Map.Entry<AgentChannel,List<String>>> channels)
updateChannels in class AbstractMonitorView1agent - Source agent.channels - Map of paths to key-value pairs, where the key is as AgentChannel object
and the value is a list of changed attributes.protected abstract void resetChannels()
path2data field.
Called on EDT whenever channels have been added or removed.protected ChannelHandle createChannelHandle(String path, AgentChannel channel, Updatable view)
ChannelHandle.
Called on EDT whenever channels are being added. Handles created by this method are put into path2data map.
The default implementation provided by this class creates an instance of DefaultChannelHandle.
Subclasses may override this method to return a different implementation of ChannelHandle.
path - Display path.channel - Agent channel.view - View displaying the channel.ChannelHandle.Copyright © 2018 LSST. All rights reserved.