DESY ACOP Beans Home

com.cosylab.gui.adapters
Class OnApplyDispatcher

java.lang.Object
  extended by com.cosylab.gui.displayers.DataSourceSupport
      extended by com.cosylab.gui.adapters.DataConsumerDispatcher
          extended by com.cosylab.gui.adapters.OnApplyDispatcher
All Implemented Interfaces:
DataConsumer, DataSource, DoubleConsumer, LongConsumer, java.io.Serializable

public class OnApplyDispatcher
extends DataConsumerDispatcher
implements DoubleConsumer, LongConsumer

See Also:
Serialized Form

Field Summary
protected  java.lang.Number valueToSet
           
 
Fields inherited from class com.cosylab.gui.adapters.DataConsumerDispatcher
name
 
Fields inherited from class com.cosylab.gui.displayers.DataSourceSupport
types
 
Constructor Summary
OnApplyDispatcher()
          Creates a new OnApplyDispatcher object.
 
Method Summary
 void addConsumer(DataConsumer consumer)
          In this method we investigate the following cases: if consumer is NonblockingNumberConsumer, the it comes from peer data source and wants to receive notifications from peer cosnumer about user change requests.
 void applyValue()
          DOCUMENT ME!
protected  void cacheLastCharacteristics(java.util.Map characteristics)
          If converter implementation decides to change characteristics it is very advisable to cache unmodified characteristics.
 void clear()
          Releases all consumers and goes into initial state.
protected  java.util.Map getLastCharacteristics()
          Returnes characcteristics whic was last time used on this data converter.
protected  NonblockingNumberDispatcher getNonblDisplatecher()
           
 boolean isOnApply()
          DOCUMENT ME!
 void setCharacteristics(java.util.Map characteristics)
          This is called by peer data source.
 void setOnApply(boolean onApply)
          DOCUMENT ME!
 void updateDataState(DataState state)
          Push data state (quality) update change for dynamic value.
 void updateValue(long timestamp, double value)
          This is called by peer data source.
 void updateValue(long timestamp, long value)
          This is called by peer data source.
 
Methods inherited from class com.cosylab.gui.adapters.DataConsumerDispatcher
getDataConsumer, getDefaultDataConsumer, getName, getSupportedCharacteristics, getSupportedConsumerTypes
 
Methods inherited from class com.cosylab.gui.displayers.DataSourceSupport
clone, extractSupportedCharacteristics, getAcceptableConsumerTypes, getConsumers, removeAllConsumers, removeConsumer
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cosylab.gui.displayers.DataConsumer
getDataConsumer, getDefaultDataConsumer, getName, getSupportedCharacteristics, getSupportedConsumerTypes
 

Field Detail

valueToSet

protected java.lang.Number valueToSet
Constructor Detail

OnApplyDispatcher

public OnApplyDispatcher()
Creates a new OnApplyDispatcher object.

Method Detail

getNonblDisplatecher

protected NonblockingNumberDispatcher getNonblDisplatecher()

applyValue

public void applyValue()
DOCUMENT ME!


isOnApply

public boolean isOnApply()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setOnApply

public void setOnApply(boolean onApply)
DOCUMENT ME!

Parameters:
onApply - DOCUMENT ME!

addConsumer

public void addConsumer(DataConsumer consumer)
                 throws java.beans.PropertyVetoException
In this method we investigate the following cases:

Specified by:
addConsumer in interface DataSource
Overrides:
addConsumer in class DataSourceSupport
Parameters:
consumer - the data consumer to be regitered at this data source
Throws:
java.beans.PropertyVetoException
See Also:
DataSource.addConsumer(com.cosylab.gui.displayers.DataConsumer)

cacheLastCharacteristics

protected void cacheLastCharacteristics(java.util.Map characteristics)
If converter implementation decides to change characteristics it is very advisable to cache unmodified characteristics. This chached characteristics are used to initialized new consumers. They can be also used by implementation to reinitialize consumers if transformation function has changed.

If implementation does not change characteristic, than this method doesen't have to be used.

Parameters:
characteristics - the unmodified characcteristics before transformation

clear

public void clear()
Description copied from class: DataSourceSupport
Releases all consumers and goes into initial state.

Overrides:
clear in class DataSourceSupport

getLastCharacteristics

protected java.util.Map getLastCharacteristics()
Returnes characcteristics whic was last time used on this data converter. Use cacheLastCharacteristics(Map) to store them.

Returns:
last used characcteristics from internal chache
See Also:
cacheLastCharacteristics(Map)

setCharacteristics

public void setCharacteristics(java.util.Map characteristics)
This is called by peer data source. Call is delegated to contained consumers. In the process it is modified with transformation function.

Specified by:
setCharacteristics in interface DataConsumer
Overrides:
setCharacteristics in class DataConsumerDispatcher
Parameters:
characteristics - the Map with attri
See Also:
DataConsumer.setCharacteristics(java.util.Map)

updateDataState

public void updateDataState(DataState state)
Description copied from interface: DataConsumer
Push data state (quality) update change for dynamic value. Usually called by data source.

Specified by:
updateDataState in interface DataConsumer
Overrides:
updateDataState in class DataConsumerDispatcher
Parameters:
state - new data state(quality) descriptor

updateValue

public void updateValue(long timestamp,
                        double value)
                 throws CommonException
This is called by peer data source. Call is delegated to contained consumers.

Specified by:
updateValue in interface DoubleConsumer
Parameters:
timestamp - the time of dynamic value event
value - new value
Throws:
CommonException
See Also:
DoubleConsumer.updateValue(long, double)

updateValue

public void updateValue(long timestamp,
                        long value)
                 throws CommonException
This is called by peer data source. Call is delegated to contained consumers.

Specified by:
updateValue in interface LongConsumer
Parameters:
timestamp - the time of dynamic value event
value - new value
Throws:
CommonException
See Also:
DoubleConsumer.updateValue(long, double)


Copyright © 2010. All Rights Reserved.