eu.fp7.eagle.portal.ui.dashboard.design.impl.BadgesDesignImpl.java Source code

Java tutorial

Introduction

Here is the source code for eu.fp7.eagle.portal.ui.dashboard.design.impl.BadgesDesignImpl.java

Source

/**
 * Copyright (c) 2016-2017  Luxembourg Institute of Science and Technology (LIST).
 * 
 * This software is licensed under the Apache License, Version 2.0 (the "License") ; you
 * may not use this file except in compliance with the License. You may obtain a copy of the License
 * at : http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 * 
 * for more information about the software, please contact info@list.lu
 */
package eu.fp7.eagle.portal.ui.dashboard.design.impl;

import java.io.File;
import java.util.Map;

import com.vaadin.annotations.AutoGenerated;

import com.vaadin.server.FileResource;
import com.vaadin.server.VaadinService;
import com.vaadin.shared.ui.label.ContentMode;

import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Image;
import com.vaadin.ui.Label;
import com.vaadin.ui.PopupView;
import com.vaadin.ui.ProgressBar;
import com.vaadin.ui.Table;

import com.vaadin.ui.VerticalLayout;

import eu.fp7.eagle.portal.ui.dashboard.design.BadgesDesign;
import eu.fp7.eagle.portal.ui.i18n.Localizable;

/**
 * @author Kheira Acem [kheira.acem@list.lu]
 * @since Sep 20, 2016 (1.0.0)
 * @version 1.0.0
 */
public class BadgesDesignImpl extends CustomComponent implements BadgesDesign {

    @AutoGenerated
    private VerticalLayout mainLayout;

    @AutoGenerated
    private VerticalLayout badgesLayout;

    @AutoGenerated
    @Localizable
    private Label labelTitle;

    @AutoGenerated
    @Localizable
    private Label labelLevelNoviceOC;

    @AutoGenerated
    @Localizable
    private Label labelLevelInterOC;

    @AutoGenerated
    @Localizable
    private Label labelLevelAdvOC;

    @AutoGenerated
    @Localizable
    private Label labelLevelExpOC;

    @AutoGenerated
    private HorizontalLayout levelLayoutOERCreator;

    @AutoGenerated
    private HorizontalLayout badgeLayoutOERCreator;

    @AutoGenerated
    private VerticalLayout imageLayoutOERCreator;

    @AutoGenerated
    private HorizontalLayout starLayoutOERCreator;

    @AutoGenerated
    private VerticalLayout barLayoutOERCreator;

    @AutoGenerated
    @Localizable
    private Label labelBadgeOERCreator;

    @AutoGenerated
    @Localizable
    private Image imageBadgeOC;

    @AutoGenerated
    @Localizable
    private PopupView popupViewAchOERCreator;

    @AutoGenerated
    @Localizable
    private Table tableAchOERCreator;

    @AutoGenerated
    @Localizable
    private PopupView popupViewTasksOERCreator;

    @AutoGenerated
    @Localizable
    private Table tableTasksOERCreator;

    @AutoGenerated
    @Localizable
    private Image imageBadgeStar1OC;

    @AutoGenerated
    @Localizable
    private Image imageBadgeStar2OC;

    @AutoGenerated
    @Localizable
    private Image imageBadgeStar3OC;

    @AutoGenerated
    @Localizable
    private Image imageBadgeFlagOC;

    @AutoGenerated
    @Localizable
    private ProgressBar progressBarOERCreator;

    @AutoGenerated
    @Localizable
    private Label labelLevelNoviceRev;

    @AutoGenerated
    @Localizable
    private Label labelLevelInterRev;

    @AutoGenerated
    @Localizable
    private Label labelLevelAdvRev;

    @AutoGenerated
    @Localizable
    private Label labelLevelExpRev;

    @AutoGenerated
    private HorizontalLayout levelLayoutReviewer;

    @AutoGenerated
    private HorizontalLayout badgeLayoutReviewer;

    @AutoGenerated
    private VerticalLayout imageLayoutReviewer;

    @AutoGenerated
    private HorizontalLayout starLayoutReviewer;

    @AutoGenerated
    private VerticalLayout barLayoutReviewer;

    @AutoGenerated
    @Localizable
    private Label labelBadgeReviewer;

    @AutoGenerated
    @Localizable
    private Image imageBadgeRev;

    @AutoGenerated
    @Localizable
    private PopupView popupViewAchReviewer;

    @AutoGenerated
    @Localizable
    private Table tableAchReviewer;

    @AutoGenerated
    @Localizable
    private PopupView popupViewTasksReviewer;

    @AutoGenerated
    @Localizable
    private Table tableTasksReviewer;

    @AutoGenerated
    @Localizable
    private Image imageBadgeStar1Rev;

    @AutoGenerated
    @Localizable
    private Image imageBadgeStar2Rev;

    @AutoGenerated
    @Localizable
    private Image imageBadgeStar3Rev;

    @AutoGenerated
    @Localizable
    private Image imageBadgeFlagRev;

    @AutoGenerated
    @Localizable
    private ProgressBar progressBarReviewer;

    @AutoGenerated
    @Localizable
    private Label labelLevelNoviceNet;

    @AutoGenerated
    @Localizable
    private Label labelLevelInterNet;

    @AutoGenerated
    @Localizable
    private Label labelLevelAdvNet;

    @AutoGenerated
    @Localizable
    private Label labelLevelExpNet;

    @AutoGenerated
    private HorizontalLayout levelLayoutNetworker;

    @AutoGenerated
    private HorizontalLayout badgeLayoutNetworker;

    @AutoGenerated
    private VerticalLayout imageLayoutNetworker;

    @AutoGenerated
    private HorizontalLayout starLayoutNetworker;

    @AutoGenerated
    private VerticalLayout barLayoutNetworker;

    @AutoGenerated
    @Localizable
    private Label labelBadgeNetworker;

    @AutoGenerated
    @Localizable
    private Image imageBadgeNet;

    @AutoGenerated
    @Localizable
    private PopupView popupViewAchNetworker;

    @AutoGenerated
    @Localizable
    private Table tableAchNetworker;

    @AutoGenerated
    @Localizable
    private PopupView popupViewTasksNetworker;

    @AutoGenerated
    @Localizable
    private Table tableTasksNetworker;

    @AutoGenerated
    @Localizable
    private Image imageBadgeStar1Net;

    @AutoGenerated
    @Localizable
    private Image imageBadgeStar2Net;

    @AutoGenerated
    @Localizable
    private Image imageBadgeStar3Net;

    @AutoGenerated
    @Localizable
    private Image imageBadgeFlagNet;

    @AutoGenerated
    @Localizable
    private ProgressBar progressBarNetworker;

    @AutoGenerated
    @Localizable
    private Label labelInfoAch;

    @AutoGenerated
    @Localizable
    private Label labelInfoTasks;

    private String basepath;

    /**
     * 
     */
    private static final long serialVersionUID = -5459783888185794737L;

    /**
     * The constructor should first build the main layout, set the
     * composition root and then do any custom initialization.
     *
     * The constructor will not be automatically regenerated by the
     * visual editor.
     */
    public BadgesDesignImpl(Map<String, Boolean> greyParams) {

        buildMainLayout();

        // user code
        // 1. initialize images depending on greyParams
        initImages(greyParams);

        //Building Layouts
        buildBadgesLayout();
        buildBadgeLayoutReviewer();
        buildBadgeLayoutOERCreator();
        buildBadgeLayoutNetworker();

        // user code
        // 2. add the various styles that would be used
        initStyles(greyParams);

        badgesLayout.addComponent(badgeLayoutReviewer);
        badgesLayout.addComponent(badgeLayoutOERCreator);
        badgesLayout.addComponent(badgeLayoutNetworker);
        badgesLayout.addComponent(labelInfoAch);
        badgesLayout.addComponent(labelInfoTasks);

        mainLayout.addComponent(badgesLayout);
        this.setCompositionRoot(this.mainLayout);

    }

    private void initStyles(Map<String, Boolean> greyParams) {

        labelLevelNoviceOC.addStyleName("labelBadgeLevel");
        labelLevelInterOC.addStyleName("labelBadgeLevel");
        labelLevelAdvOC.addStyleName("labelBadgeLevel");
        labelLevelExpOC.addStyleName("labelBadgeLevel");

        labelLevelNoviceRev.addStyleName("labelBadgeLevel");
        labelLevelInterRev.addStyleName("labelBadgeLevel");
        labelLevelAdvRev.addStyleName("labelBadgeLevel");
        labelLevelExpRev.addStyleName("labelBadgeLevel");

        labelLevelNoviceNet.addStyleName("labelBadgeLevel");
        labelLevelInterNet.addStyleName("labelBadgeLevel");
        labelLevelAdvNet.addStyleName("labelBadgeLevel");
        labelLevelExpNet.addStyleName("labelBadgeLevel");

        imageBadgeStar1OC.addStyleName("imageBadgeStar");
        imageBadgeStar2OC.addStyleName("imageBadgeStar");
        imageBadgeStar3OC.addStyleName("imageBadgeStar");
        imageBadgeFlagOC.addStyleName("imageBadgeStar");

        imageBadgeStar1Rev.addStyleName("imageBadgeStar");
        imageBadgeStar2Rev.addStyleName("imageBadgeStar");
        imageBadgeStar3Rev.addStyleName("imageBadgeStar");
        imageBadgeFlagRev.addStyleName("imageBadgeStar");

        imageBadgeStar1Net.addStyleName("imageBadgeStar");
        imageBadgeStar2Net.addStyleName("imageBadgeStar");
        imageBadgeStar3Net.addStyleName("imageBadgeStar");
        imageBadgeFlagNet.addStyleName("imageBadgeStar");

        tableAchOERCreator.addStyleName("tableAch");
        tableTasksOERCreator.addStyleName("tableTasks");

        tableAchReviewer.addStyleName("tableAch");
        tableTasksReviewer.addStyleName("tableTasks");

        tableAchNetworker.addStyleName("tableAch");
        tableTasksNetworker.addStyleName("tableTasks");

        if (greyParams.get("OER_CREATOR")) {
            labelBadgeOERCreator.addStyleName("labelBadgeTitleGrey");
            progressBarOERCreator.addStyleName("progressBarGrey");
        } else {
            labelBadgeOERCreator.addStyleName("labelBadgeTitleOC");
            progressBarOERCreator.addStyleName("progressBarOC");

        }

        if (greyParams.get("REVIEWER")) {
            labelBadgeReviewer.addStyleName("labelBadgeTitleGrey");
            progressBarReviewer.addStyleName("progressBarGrey");
        } else {
            labelBadgeReviewer.addStyleName("labelBadgeTitleRev");
            progressBarReviewer.addStyleName("progressBarRev");

        }

        if (greyParams.get("NETWORKER")) {
            labelBadgeNetworker.addStyleName("labelBadgeTitleGrey");
            progressBarNetworker.addStyleName("progressBarGrey");
        } else {
            labelBadgeNetworker.addStyleName("labelBadgeTitleNet");
            progressBarNetworker.addStyleName("progressBarNet");

        }

    }

    private void initImages(Map<String, Boolean> greyParams) {

        basepath = VaadinService.getCurrent().getBaseDirectory().getAbsolutePath();
        FileResource resourceImageBadgeOC = null;
        FileResource resourceImageBadgeStar1OC = null;
        FileResource resourceImageBadgeStar2OC = null;
        FileResource resourceImageBadgeStar3OC = null;
        FileResource resourceImageBadgeFlagOC = null;

        FileResource resourceImageBadgeRev = null;
        FileResource resourceImageBadgeStar1Rev = null;
        FileResource resourceImageBadgeStar2Rev = null;
        FileResource resourceImageBadgeStar3Rev = null;
        FileResource resourceImageBadgeFlagRev = null;

        FileResource resourceImageBadgeNet = null;
        FileResource resourceImageBadgeStar1Net = null;
        FileResource resourceImageBadgeStar2Net = null;
        FileResource resourceImageBadgeStar3Net = null;
        FileResource resourceImageBadgeFlagNet = null;

        if (greyParams.get("OER_CREATOR")) {
            resourceImageBadgeOC = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/badge2.png"));
            resourceImageBadgeStar1OC = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/39l38h/1star_orange.png"));
            resourceImageBadgeStar2OC = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/39l38h/2star_orange.png"));
            resourceImageBadgeStar3OC = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/39l38h/3star_orange.png"));
            resourceImageBadgeFlagOC = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/39l38h/orange_flag.png"));
        }

        else {
            resourceImageBadgeOC = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/badge2.png"));
            resourceImageBadgeStar1OC = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/39l38h/1star_green.png"));
            resourceImageBadgeStar2OC = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/39l38h/2star_green.png"));
            resourceImageBadgeStar3OC = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/39l38h/3star_green.png"));
            resourceImageBadgeFlagOC = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/39l38h/green_flag.png"));
        }

        if (greyParams.get("REVIEWER")) {
            resourceImageBadgeRev = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/badge1.png"));
            resourceImageBadgeStar1Rev = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/39l38h/1star_orange.png"));
            resourceImageBadgeStar2Rev = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/39l38h/2star_orange.png"));
            resourceImageBadgeStar3Rev = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/39l38h/3star_orange.png"));
            resourceImageBadgeFlagRev = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/39l38h/orange_flag.png"));
        }

        else {
            resourceImageBadgeRev = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/badge1.png"));
            resourceImageBadgeStar1Rev = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/39l38h/1star_orange.png"));
            resourceImageBadgeStar2Rev = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/39l38h/2star_orange.png"));
            resourceImageBadgeStar3Rev = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/39l38h/3star_orange.png"));
            resourceImageBadgeFlagRev = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/39l38h/orange_flag.png"));
        }

        if (greyParams.get("NETWORKER")) {
            resourceImageBadgeNet = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/badge3.png"));
            resourceImageBadgeStar1Net = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/39l38h/1star_orange.png"));
            resourceImageBadgeStar2Net = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/39l38h/2star_orange.png"));
            resourceImageBadgeStar3Net = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/39l38h/3star_orange.png"));
            resourceImageBadgeFlagNet = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/grey/39l38h/orange_flag.png"));
        }

        else {
            resourceImageBadgeNet = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/badge3.png"));
            resourceImageBadgeStar1Net = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/39l38h/1star_blue.png"));
            resourceImageBadgeStar2Net = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/39l38h/2star_blue.png"));
            resourceImageBadgeStar3Net = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/39l38h/3star_blue.png"));
            resourceImageBadgeFlagNet = new FileResource(
                    new File(basepath + "/VAADIN/themes/eagle/images/color/39l38h/blue_flag.png"));
        }

        imageBadgeOC = new Image(null, resourceImageBadgeOC);
        imageBadgeStar1OC = new Image(null, resourceImageBadgeStar1OC);
        imageBadgeStar2OC = new Image(null, resourceImageBadgeStar2OC);
        imageBadgeStar3OC = new Image(null, resourceImageBadgeStar3OC);
        imageBadgeFlagOC = new Image(null, resourceImageBadgeFlagOC);

        imageBadgeRev = new Image(null, resourceImageBadgeRev);
        imageBadgeStar1Rev = new Image(null, resourceImageBadgeStar1Rev);
        imageBadgeStar2Rev = new Image(null, resourceImageBadgeStar2Rev);
        imageBadgeStar3Rev = new Image(null, resourceImageBadgeStar3Rev);
        imageBadgeFlagRev = new Image(null, resourceImageBadgeFlagRev);

        imageBadgeNet = new Image(null, resourceImageBadgeNet);
        imageBadgeStar1Net = new Image(null, resourceImageBadgeStar1Net);
        imageBadgeStar2Net = new Image(null, resourceImageBadgeStar2Net);
        imageBadgeStar3Net = new Image(null, resourceImageBadgeStar3Net);
        imageBadgeFlagNet = new Image(null, resourceImageBadgeFlagNet);

    }

    @AutoGenerated
    private VerticalLayout buildMainLayout() {
        // common part: create layout
        mainLayout = new VerticalLayout();
        mainLayout.setImmediate(false);
        mainLayout.setWidth("100%");
        mainLayout.setHeight("-1px");
        mainLayout.setMargin(true);
        mainLayout.setSpacing(true);

        // top-level component properties
        setWidth("100.0%");
        setHeight("-1px");

        return mainLayout;
    }

    /**
     * @return badgesLAyout
     */
    private VerticalLayout buildBadgesLayout() {
        // common part: create layout
        badgesLayout = new VerticalLayout();
        badgesLayout.setImmediate(false);
        badgesLayout.setWidth("100%");
        badgesLayout.setHeight("-1px");
        badgesLayout.setMargin(false);
        badgesLayout.setSpacing(false);

        labelTitle = new Label("Personal Achievements");
        labelTitle.addStyleName("labelDashboardTitle");
        badgesLayout.addComponent(labelTitle);
        labelInfoAch = new Label("\u24D8 Click over the Badges to display achievements details");
        labelInfoTasks = new Label("\u24D8 Click over the Progress Bars to display tasks details");
        labelInfoAch.addStyleName("labelInfo");
        labelInfoTasks.addStyleName("labelInfo");
        return badgesLayout;
    }

    /**
     * @return badgeLayoutOERCreator
     */
    private HorizontalLayout buildBadgeLayoutOERCreator() {

        badgeLayoutOERCreator = new HorizontalLayout();
        badgeLayoutOERCreator.setWidth("100%");
        badgeLayoutOERCreator.setMargin(false);
        badgeLayoutOERCreator.setSpacing(false);

        imageLayoutOERCreator = new VerticalLayout();
        imageLayoutOERCreator.setWidth("100%");
        imageLayoutOERCreator.setMargin(false);
        imageLayoutOERCreator.setSpacing(false);
        badgeLayoutOERCreator.addComponent(imageLayoutOERCreator);
        badgeLayoutOERCreator.setExpandRatio(imageLayoutOERCreator, 0.2f);

        labelBadgeOERCreator = new Label("OER Creator");
        imageLayoutOERCreator.addComponent(labelBadgeOERCreator);

        imageBadgeOC.setId("OER_CREATOR");
        imageLayoutOERCreator.addComponent(imageBadgeOC);

        tableAchOERCreator = new Table();
        popupViewAchOERCreator = new PopupView(null, tableAchOERCreator);
        imageLayoutOERCreator.addComponent(popupViewAchOERCreator);

        barLayoutOERCreator = new VerticalLayout();
        barLayoutOERCreator.setId("BL_OER_CREATOR");
        barLayoutOERCreator.setWidth("100%");
        badgeLayoutOERCreator.addComponent(barLayoutOERCreator);
        badgeLayoutOERCreator.setExpandRatio(barLayoutOERCreator, 0.8f);

        starLayoutOERCreator = new HorizontalLayout();
        starLayoutOERCreator.setWidth("100%");
        starLayoutOERCreator.setSpacing(false);
        starLayoutOERCreator.setMargin(false);
        barLayoutOERCreator.addComponent(starLayoutOERCreator);

        starLayoutOERCreator.addComponent(imageBadgeStar1OC);

        starLayoutOERCreator.addComponent(imageBadgeStar2OC);

        starLayoutOERCreator.addComponent(imageBadgeStar3OC);

        starLayoutOERCreator.addComponent(imageBadgeFlagOC);

        progressBarOERCreator = new ProgressBar(0.0f);
        progressBarOERCreator.setId("PB_OER_CREATOR");
        progressBarOERCreator.setWidth("100%");
        progressBarOERCreator.setHeight("100%");
        barLayoutOERCreator.addComponent(progressBarOERCreator);

        levelLayoutOERCreator = new HorizontalLayout();
        levelLayoutOERCreator.setWidth("100%");

        labelLevelNoviceOC = new Label("<div id= level><b>Novice</b></div>", ContentMode.HTML);
        levelLayoutOERCreator.addComponent(labelLevelNoviceOC);

        labelLevelInterOC = new Label("<div id= level><b>Intermediate</b></div>", ContentMode.HTML);
        levelLayoutOERCreator.addComponent(labelLevelInterOC);

        labelLevelAdvOC = new Label("<div id= level><b>Advanced</b></div>", ContentMode.HTML);
        levelLayoutOERCreator.addComponent(labelLevelAdvOC);

        labelLevelExpOC = new Label("<div id= level><b>Expert</b></div>", ContentMode.HTML);
        ;
        levelLayoutOERCreator.addComponent(labelLevelExpOC);

        barLayoutOERCreator.addComponent(levelLayoutOERCreator);

        tableTasksOERCreator = new Table();
        popupViewTasksOERCreator = new PopupView(null, tableTasksOERCreator);
        barLayoutOERCreator.addComponent(popupViewTasksOERCreator);

        return badgeLayoutOERCreator;

    }

    /**
     * @return badgeLayoutReviewer
     */
    private HorizontalLayout buildBadgeLayoutReviewer() {

        badgeLayoutReviewer = new HorizontalLayout();
        badgeLayoutReviewer.setWidth("100%");
        badgeLayoutReviewer.setMargin(false);
        badgeLayoutReviewer.setSpacing(false);

        imageLayoutReviewer = new VerticalLayout();
        imageLayoutReviewer.setWidth("100%");
        imageLayoutReviewer.setMargin(false);
        imageLayoutReviewer.setSpacing(false);
        badgeLayoutReviewer.addComponent(imageLayoutReviewer);
        badgeLayoutReviewer.setExpandRatio(imageLayoutReviewer, 0.2f);

        labelBadgeReviewer = new Label("Reviewer");
        imageLayoutReviewer.addComponent(labelBadgeReviewer);

        imageBadgeRev.setId("REVIEWER");
        imageLayoutReviewer.addComponent(imageBadgeRev);

        tableAchReviewer = new Table();
        popupViewAchReviewer = new PopupView(null, tableAchReviewer);
        imageLayoutReviewer.addComponent(popupViewAchReviewer);

        barLayoutReviewer = new VerticalLayout();
        barLayoutReviewer.setId("BL_REVIEWER");
        barLayoutReviewer.setWidth("100%");
        badgeLayoutReviewer.addComponent(barLayoutReviewer);
        badgeLayoutReviewer.setExpandRatio(barLayoutReviewer, 0.8f);

        starLayoutReviewer = new HorizontalLayout();
        starLayoutReviewer.setWidth("100%");
        starLayoutReviewer.setSpacing(false);
        starLayoutReviewer.setMargin(false);
        barLayoutReviewer.addComponent(starLayoutReviewer);

        starLayoutReviewer.addComponent(imageBadgeStar1Rev);

        starLayoutReviewer.addComponent(imageBadgeStar2Rev);

        starLayoutReviewer.addComponent(imageBadgeStar3Rev);

        starLayoutReviewer.addComponent(imageBadgeFlagRev);

        progressBarReviewer = new ProgressBar(0.0f);
        progressBarReviewer.setId("PB_REVIEWER");
        progressBarReviewer.setWidth("100%");
        progressBarReviewer.setHeight("100%");
        barLayoutReviewer.addComponent(progressBarReviewer);

        levelLayoutReviewer = new HorizontalLayout();
        levelLayoutReviewer.setWidth("100%");

        labelLevelNoviceRev = new Label("<div id= level><b>Novice</b></div>", ContentMode.HTML);
        levelLayoutReviewer.addComponent(labelLevelNoviceRev);

        labelLevelInterRev = new Label("<div id= level><b>Intermediate</b></div>", ContentMode.HTML);
        levelLayoutReviewer.addComponent(labelLevelInterRev);

        labelLevelAdvRev = new Label("<div id= level><b>Advanced</b></div>", ContentMode.HTML);
        levelLayoutReviewer.addComponent(labelLevelAdvRev);

        labelLevelExpRev = new Label("<div id= level><b>Expert</b></div>", ContentMode.HTML);
        ;
        levelLayoutReviewer.addComponent(labelLevelExpRev);

        barLayoutReviewer.addComponent(levelLayoutReviewer);

        tableTasksReviewer = new Table();
        popupViewTasksReviewer = new PopupView(null, tableTasksReviewer);
        barLayoutReviewer.addComponent(popupViewTasksReviewer);

        return badgeLayoutReviewer;

    }

    /**
     * @return badgeLayoutNetworker
     */
    private HorizontalLayout buildBadgeLayoutNetworker() {

        badgeLayoutNetworker = new HorizontalLayout();
        badgeLayoutNetworker.setWidth("100%");
        badgeLayoutNetworker.setMargin(false);
        badgeLayoutNetworker.setSpacing(false);

        imageLayoutNetworker = new VerticalLayout();
        imageLayoutNetworker.setWidth("100%");
        imageLayoutNetworker.setMargin(false);
        imageLayoutNetworker.setSpacing(false);
        badgeLayoutNetworker.addComponent(imageLayoutNetworker);
        badgeLayoutNetworker.setExpandRatio(imageLayoutNetworker, 0.2f);

        labelBadgeNetworker = new Label("Networker");
        imageLayoutNetworker.addComponent(labelBadgeNetworker);

        imageBadgeNet.setId("NETWORKER");
        imageLayoutNetworker.addComponent(imageBadgeNet);

        tableAchNetworker = new Table();
        popupViewAchNetworker = new PopupView(null, tableAchNetworker);
        imageLayoutNetworker.addComponent(popupViewAchNetworker);

        barLayoutNetworker = new VerticalLayout();
        barLayoutNetworker.setId("BL_NETWORKER");
        barLayoutNetworker.setWidth("100%");
        badgeLayoutNetworker.addComponent(barLayoutNetworker);
        badgeLayoutNetworker.setExpandRatio(barLayoutNetworker, 0.8f);

        starLayoutNetworker = new HorizontalLayout();
        starLayoutNetworker.setWidth("100%");
        starLayoutNetworker.setSpacing(false);
        starLayoutNetworker.setMargin(false);
        barLayoutNetworker.addComponent(starLayoutNetworker);

        starLayoutNetworker.addComponent(imageBadgeStar1Net);

        starLayoutNetworker.addComponent(imageBadgeStar2Net);

        starLayoutNetworker.addComponent(imageBadgeStar3Net);

        starLayoutNetworker.addComponent(imageBadgeFlagNet);

        progressBarNetworker = new ProgressBar(0.0f);
        progressBarNetworker.setId("PB_NETWORKER");
        progressBarNetworker.setWidth("100%");
        progressBarNetworker.setHeight("100%");
        barLayoutNetworker.addComponent(progressBarNetworker);

        levelLayoutNetworker = new HorizontalLayout();
        levelLayoutNetworker.setWidth("100%");

        labelLevelNoviceNet = new Label("<div id= level><b>Novice</b></div>", ContentMode.HTML);
        levelLayoutNetworker.addComponent(labelLevelNoviceNet);

        labelLevelInterNet = new Label("<div id= level><b>Intermediate</b></div>", ContentMode.HTML);
        levelLayoutNetworker.addComponent(labelLevelInterNet);

        labelLevelAdvNet = new Label("<div id= level><b>Advanced</b></div>", ContentMode.HTML);
        levelLayoutNetworker.addComponent(labelLevelAdvNet);

        labelLevelExpNet = new Label("<div id= level><b>Expert</b></div>", ContentMode.HTML);
        ;
        levelLayoutNetworker.addComponent(labelLevelExpNet);

        barLayoutNetworker.addComponent(levelLayoutNetworker);

        tableTasksNetworker = new Table();
        popupViewTasksNetworker = new PopupView(null, tableTasksNetworker);
        barLayoutNetworker.addComponent(popupViewTasksNetworker);

        return badgeLayoutNetworker;

    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getBarLayout()
     */
    @Override
    public VerticalLayout getBarLayoutOERCreator() {
        return barLayoutOERCreator;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getPopupViewAchOERCreator()
     */
    @Override
    public PopupView getPopupViewAchOERCreator() {
        return popupViewAchOERCreator;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getPopupViewTasksOERCreator()
     */
    @Override
    public PopupView getPopupViewTasksOERCreator() {
        return popupViewTasksOERCreator;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getTableAchOERCreator()
     */
    @Override
    public Table getTableAchOERCreator() {
        // TODO Auto-generated method stub
        return tableAchOERCreator;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getProgressBarOERCreator()
     */
    @Override
    public ProgressBar getProgressBarOERCreator() {
        return progressBarOERCreator;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getTableTasksOERCreator()
     */
    @Override
    public Table getTableTasksOERCreator() {
        return tableTasksOERCreator;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getImageBadgeOC()
     */
    @Override
    public Image getImageBadgeOC() {
        return imageBadgeOC;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getBarLayout()
     */
    @Override
    public VerticalLayout getBarLayoutReviewer() {
        return barLayoutReviewer;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getPopupViewAchReviewer()
     */
    @Override
    public PopupView getPopupViewAchReviewer() {
        return popupViewAchReviewer;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getPopupViewTasksReviewer()
     */
    @Override
    public PopupView getPopupViewTasksReviewer() {
        return popupViewTasksReviewer;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getTableAchReviewer()
     */
    @Override
    public Table getTableAchReviewer() {
        // TODO Auto-generated method stub
        return tableAchReviewer;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getProgressBarReviewer()
     */
    @Override
    public ProgressBar getProgressBarReviewer() {
        return progressBarReviewer;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getTableTasksReviewer()
     */
    @Override
    public Table getTableTasksReviewer() {
        return tableTasksReviewer;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getImageBadgeRev()
     */
    @Override
    public Image getImageBadgeRev() {
        return imageBadgeRev;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getBarLayout()
     */
    @Override
    public VerticalLayout getBarLayoutNetworker() {
        return barLayoutNetworker;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getPopupViewAchNetworker()
     */
    @Override
    public PopupView getPopupViewAchNetworker() {
        return popupViewAchNetworker;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getPopupViewTasksNetworker()
     */
    @Override
    public PopupView getPopupViewTasksNetworker() {
        return popupViewTasksNetworker;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getTableAchNetworker()
     */
    @Override
    public Table getTableAchNetworker() {
        // TODO Auto-generated method stub
        return tableAchNetworker;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getProgressBarNetworker()
     */
    @Override
    public ProgressBar getProgressBarNetworker() {
        return progressBarNetworker;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getTableTasksNetworker()
     */
    @Override
    public Table getTableTasksNetworker() {
        return tableTasksNetworker;
    }

    /* (non-Javadoc)
     * @see eu.fp7.eagle.portal.ui.dashboard.design.DashboardDesign#getImageBadgeNet()
     */
    @Override
    public Image getImageBadgeNet() {
        return imageBadgeNet;
    }

}