Example usage for com.vaadin.ui AbsoluteLayout AbsoluteLayout

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

Introduction

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

Prototype

public AbsoluteLayout() 

Source Link

Document

Creates an AbsoluteLayout with full size.

Usage

From source file:org.opennms.features.vaadin.nodemaps.internal.NodeMapsApplication.java

License:Open Source License

/**
 * Gets a {@link TabSheet} view for all widgets in this manager.
 * //  w  w  w .j a v  a2 s .c o m
 * @return TabSheet
 */
private Component getTabSheet() {
    // Use an absolute layout for the bottom panel
    AbsoluteLayout bottomLayout = new AbsoluteLayout();
    bottomLayout.setSizeFull();

    final TabSheet tabSheet = new TabSheet();
    tabSheet.setSizeFull();

    for (final SelectionAwareTable view : new SelectionAwareTable[] { m_alarmTable, m_nodeTable }) {
        // Icon can be null
        tabSheet.addTab(view, (view == m_alarmTable ? "Alarms" : "Nodes"), null);

        // If the component supports the HasExtraComponents interface, then add the extra 
        // components to the tab bar
        try {
            final Component[] extras = ((HasExtraComponents) view).getExtraComponents();
            if (extras != null && extras.length > 0) {
                // For any extra controls, add a horizontal layout that will float
                // on top of the right side of the tab panel
                final HorizontalLayout extraControls = new HorizontalLayout();
                extraControls.setHeight(32, Unit.PIXELS);
                extraControls.setSpacing(true);

                // Add the extra controls to the layout
                for (final Component component : extras) {
                    extraControls.addComponent(component);
                    extraControls.setComponentAlignment(component, Alignment.MIDDLE_RIGHT);
                }

                // Add a TabSheet.SelectedTabChangeListener to show or hide the extra controls
                tabSheet.addSelectedTabChangeListener(new SelectedTabChangeListener() {
                    @Override
                    public void selectedTabChange(final SelectedTabChangeEvent event) {
                        final TabSheet source = (TabSheet) event.getSource();
                        if (source == tabSheet) {
                            // Bizarrely enough, getSelectedTab() returns the contained
                            // Component, not the Tab itself.
                            //
                            // If the first tab was selected...
                            if (source.getSelectedTab() == view) {
                                extraControls.setVisible(true);
                            } else {
                                extraControls.setVisible(false);
                            }
                        }
                    }
                });

                // Place the extra controls on the absolute layout
                bottomLayout.addComponent(extraControls, "top:0px;right:5px;z-index:100");
            }
        } catch (ClassCastException e) {
        }
        view.setSizeFull();
    }

    // Add the tabsheet to the layout
    bottomLayout.addComponent(tabSheet, "top: 0; left: 0; bottom: 0; right: 0;");

    return bottomLayout;
}

From source file:org.vaadin.tltv.vprocjs.component.Processing.java

License:Apache License

private void buildMainLayout() {
    mainLayout = new AbsoluteLayout();
}

From source file:probe.com.view.body.quantdatasetsoverview.quantproteinstabsheet.peptidescontainer.PeptidesOverviewPanel.java

/**
 *
 * @param width//from   ww w .  ja  v a 2 s . c o  m
 * @param height
 */
public PeptidesOverviewPanel(int width, int height) {
    this.setWidth(width + "px");
    this.setHeight(height + "px");
    this.setStyleName(Reindeer.LAYOUT_BLUE);
    this.setMargin(true);

    HorizontalLayout topLayout = new HorizontalLayout();
    topLayout.setHeight("20px");
    topLayout.setWidth((width) + "px");
    topLayout.setStyleName(Reindeer.LAYOUT_WHITE);
    topLayout.setMargin(false);
    this.addComponent(topLayout);

    authorLabel = new Label();
    topLayout.addComponent(authorLabel);
    topLayout.setComponentAlignment(authorLabel, Alignment.TOP_LEFT);
    authorLabel.setStyleName("filterShowLabel");

    peptidesChartLayout = new AbsoluteLayout();
    peptidesChartLayout.setWidth(width + "px");
    peptidesChartLayout.setHeight((height - 20) + "px");

}

From source file:probe.com.view.body.quantdatasetsoverview.quantproteinstabsheet.peptidescontainer.popupcomponents.PeptideSequenceContainer.java

public PeptideSequenceContainer(int width,
        LinkedHashSet<StackedBarPeptideComponent> allPeptidesStackedBarComponentsMap) {
    this.allPeptidesStackedBarComponentsMap = allPeptidesStackedBarComponentsMap;
    this.setVisible(true);
    this.setStyleName(Reindeer.LAYOUT_WHITE);
    this.setWidth((width) + "px");

    highPeptidesSequencesBar = new AbsoluteLayout();
    highPeptidesSequencesBar.setWidth(width - 40 + "px");

    highPeptidesSequencesBar.setStyleName("flipvertically");
    this.addComponent(highPeptidesSequencesBar, "left: " + (20) + "px; top: " + (0) + "px;");

    coveragePeptidesSequencesBar = new AbsoluteLayout();
    coveragePeptidesSequencesBar.setWidth(width - 40 + "px");
    coveragePeptidesSequencesBar.setHeight("17px");
    coveragePeptidesSequencesBar.setStyleName("lightgraylayout");

    stablePeptidesSequencesBar = new AbsoluteLayout();
    stablePeptidesSequencesBar.setWidth(width - 40 + "px");
    stablePeptidesSequencesBar.setHeight("15px");

    lowPeptidesSequencesBar = new AbsoluteLayout();
    lowPeptidesSequencesBar.setWidth(width - 40 + "px");

    initLayout();/*from ww w.j  ava  2s  .  c  om*/

}

From source file:probe.com.view.body.quantdatasetsoverview.quantproteinstabsheet.studies.ProteinStudyComparisonScatterPlotLayout.java

/**
 *
 * @param cp/*from w w  w  . ja va  2  s .  c  o  m*/
 * @param width
 * @param Quant_Central_Manager
 * @param custTrend
 */
public ProteinStudyComparisonScatterPlotLayout(final QuantCentralManager Quant_Central_Manager,
        final DiseaseGroupsComparisonsProteinLayout cp, int width, int custTrend) {
    this.custTrend = custTrend;
    this.Quant_Central_Manager = Quant_Central_Manager;
    this.setColumns(4);
    this.setRows(2);
    this.width = width;
    this.setSpacing(true);
    this.setMargin(new MarginInfo(true, false, false, false));
    this.comparisonProtein = cp;
    int numb = cp.getSignificantDown() + cp.getStable() + cp.getSignificantUp();
    String groupCompTitle = cp.getComparison().getComparisonHeader();
    String updatedHeader = groupCompTitle.split(" / ")[0].split("\n")[0] + " / "
            + groupCompTitle.split(" / ")[1].split("\n")[0];// + " ( " + groupCompTitle.split(" / ")[1].split("\n")[1] + " )";

    String rgbColor = Quant_Central_Manager
            .getDiseaseHashedColor(groupCompTitle.split(" / ")[1].split("\n")[1]);
    comparisonTitle = new Label("<font color='" + rgbColor + "' style='font-weight: bold;'>" + updatedHeader
            + " (Datasets " + numb + "/" + cp.getComparison().getDatasetIndexes().length + ")</font>");
    comparisonTitle.setContentMode(ContentMode.HTML);
    comparisonTitle.setStyleName("custChartLabelHeader");
    comparisonTitle.setWidth((width - 55) + "px");
    comparisonTitle.setDescription(cp.getComparison().getComparisonFullName());
    this.addComponent(comparisonTitle, 1, 0);
    this.setComponentAlignment(comparisonTitle, Alignment.TOP_LEFT);

    closeBtn = new VerticalLayout();
    closeBtn.setWidth("20px");
    closeBtn.setHeight("20px");
    closeBtn.setStyleName("closebtn");
    this.addComponent(closeBtn, 2, 0);
    this.setComponentAlignment(closeBtn, Alignment.TOP_RIGHT);

    imgWidth = (width - 55);
    ProteinScatterPlotContainer = new AbsoluteLayout();

    this.addComponent(ProteinScatterPlotContainer, 1, 1);
    ProteinScatterPlotContainer.setWidth(imgWidth + "px");
    ProteinScatterPlotContainer.setHeight(150 + "px");

    //        String styleString = "_" + cp.getProteinAccssionNumber() + "_" + cp.getComparison().getComparisonHeader();
    //        teststyle = styleString.replace(" ", "_").replace("+", "_").replace(")", "_").replace("(", "_").toLowerCase().replace(" ", "_").replace("\n", "_").replace(")", "_").replace("(", "_").toLowerCase().replace("+", "_").replace("/", "_").replace(".", "_").replace("'s", "_") + "_scatterplot";
    //        styles.add("." + teststyle + " {  background-image: url(" + defaultScatterPlottImgUrl + " );background-position:center; background-repeat: no-repeat; }");
    //        ProteinScatterPlotContainer.setStyleName(teststyle);
    ProteinScatterPlotContainer.addComponent(defaultChartImage, "left: " + 0 + "px; top: " + 0 + "px;");
    ProteinScatterPlotContainer.addComponent(defaultChartLayout, "left: " + 0 + "px; top: " + 0 + "px;");
    defaultChartLayout.setWidth(imgWidth + "px");
    defaultChartLayout.setHeight(150 + "px");

    defaultChartLayout.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {
        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {

            if (event.getClickedComponent() instanceof SquaredDot) {
                SquaredDot dot = (SquaredDot) event.getClickedComponent();
                int trend = (Integer) dot.getParam("trend");
                int pGrNumber = (Integer) dot.getParam("pGrNumber");
                int[] dssArr = new int[patientGroupsNumToDsIdMap.get(pGrNumber).getRegulatedList(trend).size()];
                for (int x = 0; x < dssArr.length; x++) {
                    dssArr[x] = patientGroupsNumToDsIdMap.get(pGrNumber).getRegulatedList(trend).get(x);
                }
                Quant_Central_Manager.setStudySelectionListenerLevel(
                        new CSFFilterSelection("Study_Selection", dssArr, "scatter", null));//  
                Set<QuantDatasetObject> dsObjects = new HashSet<QuantDatasetObject>();
                for (int dsId : dssArr) {

                    dsObjects.add(Quant_Central_Manager.getFullQuantDatasetMap().get(dsId));

                }
                studyPopupLayoutManager.updateSelectedProteinInformation(pGrNumber, trend, dsObjects, cp);
            }
        }
    });

}

From source file:songstock.web.client.MenuPanel.java

License:Open Source License

@AutoGenerated
private AbsoluteLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new AbsoluteLayout();
    mainLayout.setImmediate(false);/* w  w w .  jav  a  2  s .c o  m*/
    mainLayout.setWidth("100%");
    mainLayout.setHeight("23px");

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

    // menuBar
    menuBar = new MenuBar();
    menuBar.setImmediate(false);
    menuBar.setWidth("100.0%");
    menuBar.setHeight("-1px");
    mainLayout.addComponent(menuBar, "top:0.0px;left:0.0px;");

    return mainLayout;
}

From source file:songstock.web.extensions.browsing.AlbumDetailsView.java

License:Open Source License

@AutoGenerated
private AbsoluteLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new AbsoluteLayout();
    mainLayout.setImmediate(false);// w  w w  .  j  a v  a 2s  . c o  m
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");

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

    // labelAlbumName
    labelAlbumName = new Label();
    labelAlbumName.setImmediate(false);
    labelAlbumName.setWidth("-1px");
    labelAlbumName.setHeight("-1px");
    labelAlbumName.setValue("<b>Album Name</b>");
    labelAlbumName.setContentMode(com.vaadin.shared.ui.label.ContentMode.HTML);
    mainLayout.addComponent(labelAlbumName, "top:20.0px;left:20.0px;");

    // labelAlbumArtist
    labelAlbumArtist = new Label();
    labelAlbumArtist.setImmediate(false);
    labelAlbumArtist.setWidth("-1px");
    labelAlbumArtist.setHeight("-1px");
    labelAlbumArtist.setValue("Album Artist");
    mainLayout.addComponent(labelAlbumArtist, "top:40.0px;left:20.0px;");

    // labelAlbumReleaseYear
    labelAlbumReleaseYear = new Label();
    labelAlbumReleaseYear.setImmediate(false);
    labelAlbumReleaseYear.setWidth("-1px");
    labelAlbumReleaseYear.setHeight("-1px");
    labelAlbumReleaseYear.setValue("<i>Album Release Year</i>");
    labelAlbumReleaseYear.setContentMode(com.vaadin.shared.ui.label.ContentMode.HTML);
    mainLayout.addComponent(labelAlbumReleaseYear, "top:60.0px;left:20.0px;");

    // embeddedAlbumArtwork
    embeddedAlbumArtwork = new Embedded();
    embeddedAlbumArtwork.setImmediate(false);
    embeddedAlbumArtwork.setWidth("90px");
    embeddedAlbumArtwork.setHeight("-1px");
    embeddedAlbumArtwork.setSource(new ThemeResource("img/component/embedded_icon.png"));
    embeddedAlbumArtwork.setType(1);
    embeddedAlbumArtwork.setMimeType("image/png");
    mainLayout.addComponent(embeddedAlbumArtwork, "top:20.0px;right:20.0px;");

    // tableAlbumSongs
    tableAlbumSongs = new Table();
    tableAlbumSongs.setImmediate(false);
    tableAlbumSongs.setWidth("100.0%");
    tableAlbumSongs.setHeight("100.0%");
    mainLayout.addComponent(tableAlbumSongs, "top:100.0px;right:20.0px;bottom:20.0px;left:20.0px;");

    return mainLayout;
}

From source file:songstock.web.extensions.browsing.AlbumsListView.java

License:Open Source License

@AutoGenerated
private AbsoluteLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new AbsoluteLayout();
    mainLayout.setImmediate(false);/* www . j  ava2s. c  om*/
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");

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

    // labelTitle
    labelTitle = new Label();
    labelTitle.setImmediate(false);
    labelTitle.setWidth("-1px");
    labelTitle.setHeight("-1px");
    labelTitle.setValue("<b>Albums</b>");
    labelTitle.setContentMode(com.vaadin.shared.ui.label.ContentMode.HTML);
    mainLayout.addComponent(labelTitle, "top:20.0px;left:20.0px;");

    // tableAlbums
    tableAlbums = new Table();
    tableAlbums.setImmediate(false);
    tableAlbums.setWidth("100.0%");
    tableAlbums.setHeight("100.0%");
    mainLayout.addComponent(tableAlbums, "top:60.0px;right:20.0px;bottom:20.0px;left:20.0px;");

    return mainLayout;
}

From source file:songstock.web.extensions.download.DownloadsView.java

License:Open Source License

@AutoGenerated
private AbsoluteLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new AbsoluteLayout();
    mainLayout.setImmediate(false);//from   w  w w.  java  2  s  .co  m
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");

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

    // labelTitle
    labelTitle = new Label();
    labelTitle.setImmediate(false);
    labelTitle.setWidth("-1px");
    labelTitle.setHeight("-1px");
    labelTitle.setValue("<b>Downloads</b>");
    labelTitle.setContentMode(com.vaadin.shared.ui.label.ContentMode.HTML);
    mainLayout.addComponent(labelTitle, "top:20.0px;left:20.0px;");

    // tableDownloadLinks
    tableDownloadLinks = new Table();
    tableDownloadLinks.setImmediate(false);
    tableDownloadLinks.setWidth("100.0%");
    tableDownloadLinks.setHeight("100.0%");
    mainLayout.addComponent(tableDownloadLinks, "top:60.0px;right:20.0px;bottom:20.0px;left:20.0px;");

    return mainLayout;
}

From source file:songstock.web.extensions.login.basic.BasicLoginForm.java

License:Open Source License

@AutoGenerated
private AbsoluteLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new AbsoluteLayout();
    mainLayout.setImmediate(false);/*ww w. ja va2 s. co  m*/
    mainLayout.setWidth("340px");
    mainLayout.setHeight("180px");

    // top-level component properties
    setWidth("340px");
    setHeight("180px");

    // labelTitle
    labelTitle = new Label();
    labelTitle.setImmediate(false);
    labelTitle.setWidth("-1px");
    labelTitle.setHeight("-1px");
    labelTitle.setValue("<b>Login Form</b>");
    labelTitle.setContentMode(com.vaadin.shared.ui.label.ContentMode.HTML);
    mainLayout.addComponent(labelTitle, "top:20.0px;left:20.0px;");

    // labelEmail
    labelEmail = new Label();
    labelEmail.setImmediate(false);
    labelEmail.setWidth("-1px");
    labelEmail.setHeight("-1px");
    labelEmail.setValue("Email:");
    mainLayout.addComponent(labelEmail, "top:60.0px;left:20.0px;");

    // labelPassword
    labelPassword = new Label();
    labelPassword.setImmediate(false);
    labelPassword.setWidth("-1px");
    labelPassword.setHeight("-1px");
    labelPassword.setValue("Password:");
    mainLayout.addComponent(labelPassword, "top:102.0px;left:20.0px;");

    // textFieldEmail
    textFieldEmail = new TextField();
    textFieldEmail.setImmediate(false);
    textFieldEmail.setWidth("220px");
    textFieldEmail.setHeight("-1px");
    mainLayout.addComponent(textFieldEmail, "top:60.0px;left:100.0px;");

    // passwordField
    passwordField = new PasswordField();
    passwordField.setImmediate(false);
    passwordField.setWidth("220px");
    passwordField.setHeight("-1px");
    mainLayout.addComponent(passwordField, "top:100.0px;left:100.0px;");

    // buttonLogin
    buttonLogin = new Button();
    buttonLogin.setCaption("Login");
    buttonLogin.setImmediate(true);
    buttonLogin.setWidth("61px");
    buttonLogin.setHeight("-1px");
    mainLayout.addComponent(buttonLogin, "top:140.0px;right:19.0px;");

    // labelError
    labelError = new Label();
    labelError.setImmediate(false);
    labelError.setWidth("-1px");
    labelError.setHeight("-1px");
    labelError.setValue("<i>Label</i>");
    labelError.setContentMode(com.vaadin.shared.ui.label.ContentMode.HTML);
    mainLayout.addComponent(labelError, "top:142.0px;left:20.0px;");

    return mainLayout;
}