<commit_before>package com.drone.ui;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.vaadin.spring.UIScope;
import org.vaadin.spring.VaadinComponent;
import org.vaadin.spring.events.EventBus;
import org.vaadin.spring.events.EventBusListenerMethod;

import com.drone.Drone;
import com.drone.event.DroneBatteryEvent;
import com.drone.ui.charts.BatteryLevelGauge;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.HorizontalLayout;

@VaadinComponent
@UIScope
@Lazy
public class GaugePanel extends CustomComponent implements InitializingBean {
	private static final long serialVersionUID = 4035048387445957610L;

	@Autowired
	private Drone drone;

	private BatteryLevelGauge battery;

	private HorizontalLayout layout;

	@Autowired
	private EventBus eventBus;

	public GaugePanel() {
		layout = new HorizontalLayout();
		layout.setWidth(100, Unit.PERCENTAGE);

		battery = new BatteryLevelGauge();
		layout.addComponent(battery);
		layout.setExpandRatio(battery, 1);

		layout.setComponentAlignment(battery, Alignment.TOP_RIGHT);

		addStyleName("gauge-panel");

		setCompositionRoot(layout);
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		eventBus.subscribe(this);
	}

	@EventBusListenerMethod
	protected void onBatteryLevelEvent(DroneBatteryEvent event) {
		System.out.println(this + " got event " + event);
	}
}
<commit_msg>push value all the way to power gauge<commit_after>package com.drone.ui;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.vaadin.spring.UIScope;
import org.vaadin.spring.VaadinComponent;
import org.vaadin.spring.events.EventBus;
import org.vaadin.spring.events.EventBusListenerMethod;

import com.drone.Drone;
import com.drone.event.DroneBatteryEvent;
import com.drone.ui.charts.BatteryLevelGauge;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.HorizontalLayout;

@VaadinComponent
@UIScope
public class GaugePanel extends CustomComponent implements InitializingBean {
	private static final long serialVersionUID = 4035048387445957610L;

	@Autowired
	private Drone drone;

	private BatteryLevelGauge battery;

	private HorizontalLayout layout;

	@Autowired
	private EventBus eventBus;

	public GaugePanel() {
		layout = new HorizontalLayout();
		layout.setWidth(100, Unit.PERCENTAGE);

		battery = new BatteryLevelGauge();
		layout.addComponent(battery);
		layout.setExpandRatio(battery, 1);

		layout.setComponentAlignment(battery, Alignment.TOP_RIGHT);

		addStyleName("gauge-panel");

		setCompositionRoot(layout);
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		eventBus.subscribe(this);
	}

	@EventBusListenerMethod
	protected void onBatteryLevelEvent(DroneBatteryEvent event) {
		battery.setBatteryLevel(event.getBatteryLevel());
	}
}

{'fraction_non_alphanumeric': 0.09159061277705345, 'fraction_numerical': 0.01499348109517601, 'mean_word_length': 6.238207547169812, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7050360', 'n_tokens_mistral': 1036, 'n_tokens_neox': 943, 'n_words': 185}