use of org.vaadin.addon.leaflet.util.PointField in project v-leaflet by mstahv.
the class WithoutBeanBindingTest method getTestComponent.
@Override
public Component getTestComponent() {
final PointField pointFieldEmpty = new PointField("empty PointField");
pointFieldEmpty.setSizeFull();
final PointField pointFieldInitialized = new PointField("PointField with value");
pointFieldInitialized.setSizeFull();
pointFieldInitialized.getMap().setZoomLevel(8);
pointFieldInitialized.setValue(getPoint());
Button getValueButton = new Button("Get values");
getValueButton.addClickListener(new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
Point value1 = pointFieldEmpty.getValue();
Point value2 = pointFieldInitialized.getValue();
Notification.show(value1 + "\n" + value2);
}
});
HorizontalLayout fieldLayout = new HorizontalLayout(pointFieldEmpty, pointFieldInitialized);
fieldLayout.setSizeFull();
fieldLayout.setSpacing(true);
VerticalLayout layout = new VerticalLayout(fieldLayout, getValueButton);
layout.setExpandRatio(fieldLayout, 1f);
layout.setSizeFull();
layout.setSpacing(true);
return layout;
}
Aggregations