Example usage for com.vaadin.ui GridLayout GridLayout

List of usage examples for com.vaadin.ui GridLayout GridLayout

Introduction

In this page you can find the example usage for com.vaadin.ui GridLayout GridLayout.

Prototype

public GridLayout() 

Source Link

Document

Constructs an empty (1x1) grid layout that is extended as needed.

Usage

From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.GroupSwichBtn.java

public GroupSwichBtn(final QuantCentralManager Quant_Central_Manager,
        List<QuantProtein> searchQuantificationProtList) {
    this.Quant_Central_Manager = Quant_Central_Manager;
    this.searchQuantificationProtList = searchQuantificationProtList;
    updatedComparisonList = new ArrayList<QuantDiseaseGroupsComparison>();
    this.setWidth("24px");
    this.setHeight("24px");
    this.setDescription("Switch protein groups");
    this.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {

        @Override/*  www . jav  a2s . com*/
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            updateSelectionList();
            popupWindow.setVisible(true);
        }
    });
    this.setStyleName("switchicon");

    popupBody = new VerticalLayout();

    popupBody.setHeightUndefined();
    popupBody.setStyleName(Reindeer.LAYOUT_WHITE);

    popupWindow = new Window() {

        @Override
        public void close() {

            popupWindow.setVisible(false);
            Quant_Central_Manager.setDiseaseGroupsComparisonSelection(
                    new LinkedHashSet<QuantDiseaseGroupsComparison>(updatedComparisonList));
        }

    };
    popupWindow.setCaption(
            "<font color='gray' style='font-weight: bold;!important'>&nbsp;&nbsp;Switch  disease groups</font>");
    popupWindow.setContent(popupBody);
    popupWindow.setWindowMode(WindowMode.NORMAL);

    popupWindow.setVisible(false);
    popupWindow.setResizable(false);
    popupWindow.setStyleName(Reindeer.WINDOW_LIGHT);
    popupWindow.setModal(true);
    popupWindow.setDraggable(true);

    UI.getCurrent().addWindow(popupWindow);
    //        popupWindow.center();
    //        popupWindow.setPositionX(popupWindow.getPositionX());
    popupWindow.setPositionY(100);

    popupWindow.setCaptionAsHtml(true);
    popupWindow.setClosable(true);

    popupBody.setMargin(true);
    popupBody.setSpacing(true);

    //init table
    table = new GridLayout();
    table.setStyleName("switchtable");
    table.setWidth("100%");
    table.setSpacing(true);
    table.setColumns(3);
    table.setRows(1000);
    table.setHeightUndefined();
    table.setHideEmptyRowsAndColumns(true);
    table.setMargin(new MarginInfo(false, false, true, false));

    headerI = new Label("<center><b>Numerator</b></center>");
    headerI.setWidth("100%");
    headerI.setContentMode(ContentMode.HTML);
    headerII = new Label("<center><b>Denominator</b></center>");
    headerII.setContentMode(ContentMode.HTML);
    headerII.setWidth("100%");

    //        comparisonList = new OptionGroup(null);
    //
    //        comparisonList.setMultiSelect(true);
    //        comparisonList.setNullSelectionAllowed(true);
    //        comparisonList.setHtmlContentAllowed(true);
    //        comparisonList.setImmediate(true);
    //        comparisonList.setWidth("80%");
    //        comparisonList.setHeight("80%");
    popupBody.addComponent(table);

    Button applyFilters = new Button("Apply");
    applyFilters.setDescription("Apply the selected filters");
    applyFilters.setPrimaryStyleName("resetbtn");
    applyFilters.setWidth("76px");
    applyFilters.setHeight("24px");

    //        popupBody.addComponent(applyFilters);
    //        popupBody.setComponentAlignment(applyFilters, Alignment.TOP_RIGHT);
    applyFilters.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            popupWindow.close();
        }
    });
    btnWrapper = new HorizontalLayout();
    btnWrapper.setWidth("100%");
    btnWrapper.setHeight("50px");
    btnWrapper.addComponent(applyFilters);
    btnWrapper.setComponentAlignment(applyFilters, Alignment.BOTTOM_CENTER);

    table.addLayoutClickListener(GroupSwichBtn.this);

}

From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.heatmap.HeatMapComponent.java

/**
 * @param heatmapCellWidth//  w  ww.  j a  va  2 s.co  m
 * @param heatmapHeaderCellWidth
 * @param diseaseStyleMap
 */
public HeatMapComponent(int heatmapCellWidth, int heatmapHeaderCellWidth, Map<String, String> diseaseStyleMap) {

    this.diseaseStyleMap = diseaseStyleMap;

    this.setMargin(false);
    this.setSpacing(true);
    this.setWidth("100%");
    this.heatmapCellWidth = heatmapCellWidth;
    this.heatmapHeaderCellWidth = heatmapHeaderCellWidth;

    columnContainer = new VerticalLayout();
    columnContainer.setWidth("100%");
    columnContainer.setSpacing(true);

    diseaseGroupsColumnsLabels = new HorizontalLayout();
    diseaseGroupsColumnsLabels.setWidth("10px");
    diseaseGroupsColumnsLabels.setHeight("20px");
    diseaseGroupsColumnsLabels.setStyleName(Reindeer.LAYOUT_BLUE);
    columnContainer.addComponent(diseaseGroupsColumnsLabels);

    this.columnHeader = new GridLayout();
    columnContainer.addComponent(columnHeader);
    columnContainer.setComponentAlignment(columnHeader, Alignment.TOP_LEFT);
    this.rowHeader = new GridLayout();
    this.heatmapBody = new GridLayout();
    heatmapBody.setStyleName("hmbackground");

    topLayout = new HorizontalLayout();
    topLayout.setHeight((heatmapHeaderCellWidth + 24) + "px");
    topLayout.setSpacing(false);
    spacer = new VerticalLayout();
    spacer.setWidth((heatmapHeaderCellWidth + 25) + "px");
    spacer.setHeight((heatmapHeaderCellWidth + 24) + "px");
    spacer.setStyleName(Reindeer.LAYOUT_WHITE);

    hideCompBtn = new VerticalLayout();
    hideCompBtn.setSpacing(true);
    hideCompBtn.setWidth((heatmapHeaderCellWidth + 25) + "px");
    //        hideCompBtn.setHeight((heatmapHeaderCellWidth) + "px");
    hideCompBtn.setStyleName("matrixbtn");

    icon = new Image();
    defaultResource = new ThemeResource("img/logo.png");

    icon.setSource(defaultResource);
    hideCompBtn.setDescription("Expand chart and hide comparisons table");
    hideCompBtn.addComponent(icon);
    hideCompBtn.setComponentAlignment(icon, Alignment.MIDDLE_CENTER);
    icon.setHeight((heatmapHeaderCellWidth - 20 + 10) + "px");
    hideShowBtnLabel = new Label("Expand Chart");
    hideShowBtnLabel.setHeight((20) + "px");
    hideCompBtn.addComponent(hideShowBtnLabel);
    hideCompBtn.setComponentAlignment(hideShowBtnLabel, Alignment.BOTTOM_CENTER);

    spacer.addComponent(hideCompBtn);
    spacer.setComponentAlignment(hideCompBtn, Alignment.MIDDLE_CENTER);
    hideCompBtn.setEnabled(false);

    topLayout.addComponent(spacer);
    topLayout.setComponentAlignment(spacer, Alignment.BOTTOM_LEFT);
    topLayout.setSpacing(true);
    topLayout.addComponent(columnContainer);
    topLayout.setComponentAlignment(columnContainer, Alignment.TOP_LEFT);
    this.addComponent(topLayout);

    bottomLayout = new HorizontalLayout();
    diseaseGroupsRowsLabels = new VerticalLayout();
    diseaseGroupsRowsLabels.setHeight("10px");
    diseaseGroupsRowsLabels.setWidth("20px");
    diseaseGroupsRowsLabels.setStyleName(Reindeer.LAYOUT_BLUE);
    bottomLayout.addComponent(diseaseGroupsRowsLabels);

    rowHeader.setWidth(heatmapHeaderCellWidth + "px");
    rowHeader.setHeight("100%");
    bottomLayout.addComponent(rowHeader);
    bottomLayout.addComponent(heatmapBody);
    bottomLayout.setSpacing(true);
    bottomLayout.setComponentAlignment(heatmapBody, Alignment.MIDDLE_LEFT);
    this.addComponent(bottomLayout);

}