com.thingtrack.konekti.map.ui.LicenseView.java Source code

Java tutorial

Introduction

Here is the source code for com.thingtrack.konekti.map.ui.LicenseView.java

Source

package com.thingtrack.konekti.map.ui;

import com.vaadin.addon.touchkit.ui.HorizontalComponentGroup;
import com.vaadin.addon.touchkit.ui.NavigationView;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.ui.Component;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;

@SuppressWarnings("serial")
public class LicenseView extends NavigationView {
    private Layout mainLayout = new CssLayout();

    @Override
    public void attach() {
        super.attach();
        buildView();
    }

    private void buildView() {
        setCaption("Licencia");

        mainLayout = new CssLayout();
        mainLayout.setWidth("100%");
        mainLayout.setMargin(true);

        mainLayout.addComponent(buildLicenseNodeLayout());

        setContent(mainLayout);
    }

    private Component buildLicenseNodeLayout() {
        HorizontalComponentGroup aboutNodeComponentGroup = new HorizontalComponentGroup();
        aboutNodeComponentGroup.setMargin(true);
        aboutNodeComponentGroup.setWidth("100%");
        aboutNodeComponentGroup.addStyleName("about");

        Resource image = new ThemeResource("nodes/thingtrack_icon.png");

        if (image != null) {
            Embedded embedded = new Embedded(null, image);
            embedded.setWidth("100px");
            aboutNodeComponentGroup.addComponent(embedded);

        }
        aboutNodeComponentGroup.addComponent(
                new Label("<p><b>Konekti Map</b><br/>Localiza todo aquello que quieras</p>", Label.CONTENT_RAW));
        aboutNodeComponentGroup.addComponent(new Label("<b>Versin 1.2.0</b>", Label.CONTENT_RAW));
        aboutNodeComponentGroup.addComponent(new Label(
                "<p>Todo el Contenido de esta Aplicacin,<br/>como as tambin los productos y<br/>servicios comercializados son propiedad intelectual de Edikal Technology S.L.</p>",
                Label.CONTENT_RAW));

        return aboutNodeComponentGroup;
    }
}