// Add data source listeners if necessery
// Listen to datasource changes if possible
if (dataSource instanceof ItemSetChangeNotifier) {
getLogger().finest(
"Attaching ItemSetChangeListener to graph datasource");
ItemSetChangeNotifier isn = (ItemSetChangeNotifier) dataSource;
// Ensure we not already are listening to the events
isn.removeListener(dataSourceListener);
// Add listener
isn.addListener(dataSourceListener);
}
if (dataSource instanceof PropertySetChangeNotifier) {
getLogger()
.finest("Attaching PropertySetChangeListener to graph datasource");
PropertySetChangeNotifier pscn = (PropertySetChangeNotifier) dataSource;
// Ensure we not already are listening to the events
pscn.removeListener(dataSourceListener);
// Add listener
pscn.addListener(dataSourceListener);
}
if (dataSource instanceof ValueChangeNotifier) {
getLogger().finest(
"Attaching ValueChangeListener to graph datasource");
ValueChangeNotifier vcn = (ValueChangeNotifier) dataSource;
// Ensure we not already are listening to the events
vcn.removeListener(dataSourceListener);
// Add listener
vcn.addListener(dataSourceListener);
}
}
if (markers instanceof ItemSetChangeNotifier) {
getLogger().finest(
"Attaching ItemSetChangeListener to marker datasource");
ItemSetChangeNotifier isn = (ItemSetChangeNotifier) markers;
// Ensure we not already are listening to the events
isn.removeListener(markerEventListener);
// Add listener
isn.addListener(markerEventListener);
}
if (markers instanceof PropertySetChangeNotifier) {
getLogger().finest(
"Attaching PropertySetChangeListener to marker datasource");
PropertySetChangeNotifier pscn = (PropertySetChangeNotifier) markers;
// Ensure we not already are listening to the events
pscn.removeListener(markerEventListener);
// Add listener
pscn.addListener(markerEventListener);
}
if (markers instanceof ValueChangeNotifier) {
getLogger().finest(
"Attaching ValueChangeListener to marker datasource");
ValueChangeNotifier vcn = (ValueChangeNotifier) markers;
// Ensure we not already are listening to the events
vcn.removeListener(markerEventListener);
// Add listener
vcn.addListener(markerEventListener);
}
if (events instanceof ItemSetChangeNotifier) {
getLogger().finest(
"Attaching ValueChangeListener to marker datasource");
ItemSetChangeNotifier isn = (ItemSetChangeNotifier) events;
// Ensure we not already are listening to the events
isn.removeListener(markerEventListener);
// Add listener
isn.addListener(markerEventListener);
}
if (events instanceof PropertySetChangeNotifier) {
getLogger().finest(
"Attaching ValueChangeListener to marker datasource");
PropertySetChangeNotifier pscn = (PropertySetChangeNotifier) events;