public class MonitorFormat extends Object
| Modifier and Type | Field and Description |
|---|---|
static Color |
COLOR_BG |
static Color |
COLOR_CHANGED |
static Color |
COLOR_ERR |
static Color |
COLOR_FG |
static Color |
COLOR_GOOD |
static Color |
COLOR_MULTI |
static Color |
COLOR_NA |
static Color |
COLOR_OFF |
static Color |
COLOR_POPUP |
static EnumMap<org.lsst.ccs.bus.states.DataProviderState,Color> |
COLOR_STATE |
static Color |
COLOR_WARN |
static MonitorFormat |
DEFAULT |
protected String |
DEFAULT_FLOAT_FORMAT |
protected String |
DEFAULT_INT_FORMAT |
static int |
HA_MULTI |
static String |
TEXT_MULTI |
| Constructor and Description |
|---|
MonitorFormat() |
| Modifier and Type | Method and Description |
|---|---|
FormattedValue |
format(FormattedValue fv)
Completes formatting of a partially formatted value.
|
boolean |
format(MonitorCell cell)
Convenience method that updates
FormattedValue associated with the specified cell. |
boolean |
format(MonitorCell cell,
ChannelHandle channelHandle)
Convenience method that updates
FormattedValue associated with the specified cell,
assuming that the only possible reason for a change are changes in the specified channel. |
FormattedValue |
format(MonitorField field,
AgentChannel channel)
Produces formatted value, given the monitored field and the data channel whose value needs to be formatted.
|
FormattedValue |
format(MonitorField field,
ChannelHandle channelHandle)
Convenience method that produces formatted value, given the field and the channel handle.
|
FormattedValue |
format(MonitorField field,
List<AgentChannel> channels)
Produces formatted value, given the field and the list of contributing channels.
|
Object |
getValue(MonitorField field,
AgentChannel channel)
Extracts unformatted value corresponding to the specified field from a channel.
|
static void |
main(String... arg) |
FormattedValue |
merge(MonitorField field,
List<FormattedValue> values)
Merges zero or more formatted values.
|
Color |
mergeConfigColor(Color c1,
Color c2)
Merges colors used to indicate a state of a configurable parameter.
|
Color |
mergeStateColor(Color c1,
Color c2)
Merges colors used to indicate the channel state.
|
public static final MonitorFormat DEFAULT
public static final Color COLOR_FG
public static final Color COLOR_BG
public static final Color COLOR_CHANGED
public static final Color COLOR_GOOD
public static final Color COLOR_WARN
public static final Color COLOR_ERR
public static final Color COLOR_OFF
public static final Color COLOR_POPUP
public static final Color COLOR_MULTI
public static final Color COLOR_NA
public static final EnumMap<org.lsst.ccs.bus.states.DataProviderState,Color> COLOR_STATE
public static final String TEXT_MULTI
public static final int HA_MULTI
protected String DEFAULT_FLOAT_FORMAT
protected String DEFAULT_INT_FORMAT
public boolean format(MonitorCell cell)
FormattedValue associated with the specified cell. format(MonitorField field, List channels).cell - Cell to be formatted.public boolean format(MonitorCell cell, ChannelHandle channelHandle)
FormattedValue associated with the specified cell,
assuming that the only possible reason for a change are changes in the specified channel. format(MonitorCell cell),
ignoring the channelHandle argument. Subclasses might implement more efficient formatting
for cells that depend on multiple channels.cell - Cell to be formatted.channelHandle - Handle of the data channel that might have changed.public FormattedValue format(MonitorField field, ChannelHandle channelHandle)
format(MonitorField field, AgentChannel channel).field - Monitored field.channelHandle - Handle of a data channel whose value needs to be formatted.public FormattedValue format(MonitorField field, List<AgentChannel> channels)
format(MonitorField field, AgentChannel channel)
for each channel, then merges the results using merge(MonitorField field, List formattedValues).field - Monitored field.channels - Contributing channels.public FormattedValue format(MonitorField field, AgentChannel channel)
MonitorField.format(AgentChannel channel).
If null is returned, it extracts the unformatted value with a call to
getValue(MonitorField field, AgentChannel channel), then formats it with
format(Object unformattedValue, MonitorField field, AgentChannel channel).field - Monitored field.channel - Data channel.public FormattedValue format(FormattedValue fv)
value and optionally format
fields set to the unformatted value and the suggested format string, respectively.fv - Partially formatted value.public FormattedValue merge(MonitorField field, List<FormattedValue> values)
field - Monitored field.values - Formatted values to merge.public Color mergeConfigColor(Color c1, Color c2)
merge(MonitorField field, List formattedValues).c1 - First color.c2 - Second color.public Color mergeStateColor(Color c1, Color c2)
merge(MonitorField field, List formattedValues).c1 - First color.c2 - Second color.public Object getValue(MonitorField field, AgentChannel channel)
fielf.getValue(AgentChannel channel).field - Monitored field.channel - Data channel.null if the value cannot be extracted.public static void main(String... arg)
Copyright © 2018 LSST. All rights reserved.