use of com.vaadin.flow.component.charts.events.internal.AxisRescaledEvent in project flow-components by vaadin.
the class ConfigurationJSONSerializationTest method configurationJSONSerialization_configurationSerializedWithChangeListener_changeListenerNotSerialized.
@Test
public void configurationJSONSerialization_configurationSerializedWithChangeListener_changeListenerNotSerialized() {
Configuration conf = new Configuration();
conf.addChangeListener(new ConfigurationChangeListener() {
@Override
public void dataAdded(DataAddedEvent event) {
// TODO Auto-generated method stub
}
@Override
public void dataRemoved(DataRemovedEvent event) {
// TODO Auto-generated method stub
}
@Override
public void dataUpdated(DataUpdatedEvent event) {
// TODO Auto-generated method stub
}
@Override
public void itemSliced(ItemSlicedEvent event) {
// TODO Auto-generated method stub
}
@Override
public void seriesStateChanged(SeriesStateEvent event) {
// TODO Auto-generated method stub
}
@Override
public void seriesAdded(SeriesAddedEvent event) {
// TODO Auto-generated method stub
}
@Override
public void seriesChanged(SeriesChangedEvent event) {
// TODO Auto-generated method stub
}
@Override
public void axisRescaled(AxisRescaledEvent event) {
// TODO Auto-generated method stub
}
@Override
public void resetZoom(boolean redraw, boolean animate) {
// TODO Auto-generated method stub
}
});
assertEquals("{\"chart\":{\"styledMode\":false},\"plotOptions\":{},\"series\":[],\"exporting\":{\"enabled\":false}}", toJSON(conf));
}
use of com.vaadin.flow.component.charts.events.internal.AxisRescaledEvent in project flow-components by vaadin.
the class Configuration method fireAxesRescaled.
/**
* Fires axis rescaled event.
*
* @param axis
* Axis that is the source of the event.
* @param minimum
* New minimum.
* @param maximum
* New maximum.
* @param redraw
* Whether or not to redraw.
* @param animate
* Whether or not to animate.
*/
@Override
public void fireAxesRescaled(Axis axis, Number minimum, Number maximum, boolean redraw, boolean animate) {
// determine the dimension of the axis, either x or y
AxisDimension axisType = getAxisDimension(axis);
if (axisType != null) {
int axisIndex = getAxisIndex(axisType, axis);
AxisRescaledEvent event = new AxisRescaledEvent(axisType.getIndex(), axisIndex, minimum, maximum, redraw, animate);
for (ConfigurationChangeListener listener : changeListeners) {
listener.axisRescaled(event);
}
}
}
Aggregations