|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.desy.acop.displayers.tools.AcopChartConsumer
public class AcopChartConsumer
AcopChartConsumer is an implementation of DoubleSeqConsumer
which can be used in connection with AcopChart. AcopChartConsumer
receives updates from the DataSource and updates the chart accordingly.
One consumer can only handle connection to one specific channel.
AcopChart| Field Summary | |
|---|---|
protected AcopChart |
acop
|
protected int |
arraySize
|
protected java.awt.Color |
color
|
protected java.lang.Object |
disable
|
protected int |
displayHandle
|
protected long |
lastTimestamp
|
protected int |
maxNumber
|
protected java.lang.String |
name
|
static java.lang.String[] |
SUPPORTED_CHARACTERISTICS
|
static java.lang.Class[] |
SUPPORTED_CONSUMER_TYPES
|
protected int |
textHandle
|
protected double[] |
xData
|
protected java.lang.String[] |
xLabels
|
protected double[] |
yData
|
| Constructor Summary | |
|---|---|
AcopChartConsumer(AcopChart acop,
java.lang.String name)
Constructs new AcopChartConsumer object with the given name. |
|
| Method Summary | |
|---|---|
void |
destroy()
Destroys this consumer. |
double[][] |
dumpData()
Returns all data from chart. |
AcopChart |
getAcop()
Returns the parent chart of this consumer. |
int |
getArraySize()
Returns the size of the array that this consumer shows. |
java.awt.Color |
getColor()
Returns the color that shows data of this consumer in the chart. |
DataConsumer |
getDataConsumer(java.lang.Class type)
Returns data consumer for requested data consumer type. |
DataConsumer |
getDefaultDataConsumer()
Returns the implementation of default consumer type supported by this data consumer. |
AcopGraphParameters |
getDisplayerParameters()
Returns the AcopGraphParameters associated with this consumer. |
long |
getLastTimestamp()
Returns the last timestamp when value was updated. |
java.lang.String |
getName()
Returns name of this data consumer. |
double |
getPreferredYMax()
Returns the preferred maximum vertical value for this graph. |
double |
getPreferredYMin()
Returns the preferred minimum vertical value for this graph. |
java.lang.String[] |
getSupportedCharacteristics()
Resturns array with names of supported characteristics. |
java.lang.Class<DataConsumer>[] |
getSupportedConsumerTypes()
Returns array of supported data consumer types, which can be used as parameter and returnned with getDataCosnumer(Class)
method. |
double[] |
getXData()
Returns the horizontal values. |
java.lang.String[] |
getXLabels()
Returns the labels of horizontal values. |
double[] |
getYData()
Returns the vertical values. |
boolean |
isTrendChart()
Returns true if this consumer shows a trend graph. |
void |
setArraySize(int arraySize)
Sets the size of the array that this consumer handles with. |
void |
setCharacteristics(java.util.Map characteristics)
Sets new dynamic value characteristics to this data consumer. |
void |
setColor(java.awt.Color color)
Sets the color that shows data of this consumer in the chart. |
void |
setDisplayerParameters(AcopGraphParameters displayerParameters)
Sets the AcopGraphParameters which describes the visual appearance of the data in the chart. |
void |
setPreferredYMax(double preferredYMax)
Sets the preferred maximum vertical value for this graph. |
void |
setPreferredYMin(double preferredYMin)
Sets the preferred minimum vertical value for this graph. |
void |
setTrendChart(boolean isTrendChart)
Sets the trend mode for this consumer. |
void |
setXData(double[] xdata)
Sets the horizontal values. |
void |
setXLabels(java.lang.String[] labels)
Sets the labels of horizontal values. |
void |
setYData(double[] data)
Sets new vertical values. |
void |
updateDataState(DataState state)
Push data state (quality) update change for dynamic value. |
void |
updateValue(long timestamp,
double[] value)
Notifys this consumer about new dynamic value update. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.Class[] SUPPORTED_CONSUMER_TYPES
public static final java.lang.String[] SUPPORTED_CHARACTERISTICS
protected java.lang.String name
protected AcopChart acop
protected double[] xData
protected double[] yData
protected int displayHandle
protected int textHandle
protected long lastTimestamp
protected java.awt.Color color
protected java.lang.String[] xLabels
protected java.lang.Object disable
protected int arraySize
protected int maxNumber
| Constructor Detail |
|---|
public AcopChartConsumer(AcopChart acop,
java.lang.String name)
acop - parent chartname - the name of the consumer| Method Detail |
|---|
public DataConsumer getDataConsumer(java.lang.Class type)
DataConsumer
Returns data consumer for requested data consumer type. If this data
consumer does not support required data consumer, null is
returned.
If this data cosnumer does not support specific data consumer type, then it means, that it is not desirable to cast data of that type to any by this consumer supported data consumer types.
getDataConsumer in interface DataConsumertype - Class of specific data consumer (e.g. DoubleConsumer)
null if
not supportedpublic DataConsumer getDefaultDataConsumer()
DataConsumer
getDefaultDataConsumer in interface DataConsumerpublic void updateDataState(DataState state)
DataConsumer
updateDataState in interface DataConsumerstate - new data state(quality) descriptorpublic void setCharacteristics(java.util.Map characteristics)
DataConsumer
setCharacteristics in interface DataConsumercharacteristics - the Map with attripublic java.lang.String getName()
DataConsumer
getName in interface DataConsumerpublic java.lang.String[] getSupportedCharacteristics()
DataConsumernull is returned, than
consumer expect all existing characteristics from data source.
getSupportedCharacteristics in interface DataConsumerpublic java.lang.Class<DataConsumer>[] getSupportedConsumerTypes()
DataConsumergetDataCosnumer(Class)
method.
getSupportedConsumerTypes in interface DataConsumerpublic double[][] dumpData()
public void destroy()
public void updateValue(long timestamp,
double[] value)
throws CommonException
DoubleSeqConsumer
updateValue in interface DoubleSeqConsumertimestamp - the time of dynamic value eventvalue - new value
CommonExceptionpublic double[] getXData()
public void setXData(double[] xdata)
xdata - new horizontal valuespublic double[] getYData()
public void setYData(double[] data)
data - new y valuespublic AcopChart getAcop()
public long getLastTimestamp()
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
color - new colorpublic java.lang.String[] getXLabels()
public void setXLabels(java.lang.String[] labels)
labels - new labelspublic int getArraySize()
public void setArraySize(int arraySize)
arraySize - new array sizepublic double getPreferredYMax()
public void setPreferredYMax(double preferredYMax)
preferredYMax - new preferred maximum valuepublic double getPreferredYMin()
public void setPreferredYMin(double preferredYMin)
preferredYMin - new preferred minimum valuepublic AcopGraphParameters getDisplayerParameters()
public void setDisplayerParameters(AcopGraphParameters displayerParameters)
displayerParameters - the displayer parameterspublic boolean isTrendChart()
public void setTrendChart(boolean isTrendChart)
isTrendChart - trend mode flag
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||