List of usage examples for com.vaadin.ui VerticalLayout setHeight
@Override public void setHeight(String height)
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.PopupRecombineDiseaseGroups.java
private HorizontalLayout initDiseaseNamesUpdateContainer(String diseaseCategory) { GridLayout diseaseNamesUpdateContainer = new GridLayout(2, (default_DiseaseCat_DiseaseGroupMap.get(diseaseCategory).size() * 2)); diseaseNamesUpdateContainer.setWidth("100%"); diseaseNamesUpdateContainer.setHeightUndefined(); diseaseNamesUpdateContainer.setSpacing(false); diseaseNamesUpdateContainer.setMargin(new MarginInfo(false, false, false, false)); int widthCalc = 0; int row = 0;/*w ww . j a v a2s. c o m*/ int col = 0; Map<String, ComboBox> diseaseGroupNameToListMap = new LinkedHashMap<String, ComboBox>(); for (String diseaseGroupName : default_DiseaseCat_DiseaseGroupMap.get(diseaseCategory).keySet()) { // if(!diseaseGroupName.contains(diseaseCategory)) // continue; diseaseNamesUpdateContainer.addComponent(generateLabel(diseaseGroupName, diseaseCategory), col, row); ComboBox list = generateLabelList(diseaseCategory); diseaseNamesUpdateContainer.addComponent(list, col + 1, row); diseaseGroupNameToListMap.put(diseaseGroupName, list); col = 0; row++; VerticalLayout spacer1 = new VerticalLayout(); spacer1.setHeight("2px"); spacer1.setWidth("300px"); spacer1.setStyleName(Reindeer.LAYOUT_WHITE); diseaseNamesUpdateContainer.addComponent(spacer1, col, row); VerticalLayout spacer2 = new VerticalLayout(); spacer2.setHeight("2px"); spacer2.setWidth("300px"); spacer2.setStyleName(Reindeer.LAYOUT_WHITE);//"lightgraylayout"); diseaseNamesUpdateContainer.addComponent(spacer2, col + 1, row); col = 0; row++; widthCalc += 26; } diseaseGroupsSelectionListMap.put(diseaseCategory, diseaseGroupNameToListMap); // widthCalc-=26; VerticalLayout diseaseLabelContainer = new VerticalLayout(); Label label = new Label("<center><font color='#ffffff'>" + diseaseCategory + "</font></center>"); label.setContentMode(ContentMode.HTML); diseaseLabelContainer.setHeight(widthCalc + "px"); diseaseLabelContainer.setWidth("20px"); VerticalLayout rotateContainer = new VerticalLayout(); rotateContainer.setWidth(widthCalc + "px"); rotateContainer.setHeight("20px"); diseaseLabelContainer.addComponent(rotateContainer); rotateContainer.setStyleName( "row_" + diseaseStyleMap.get(diseaseCategory.replace(" ", "_").replace("'", "-") + ("_Disease"))); rotateContainer.addComponent(label); HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.addComponent(diseaseLabelContainer); layout.addComponent(diseaseNamesUpdateContainer); return layout; }
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.popupreordergroups.SortableLayoutContainer.java
public final void initLists(Set<String> labels) { sortableDiseaseGroupLayout.removeAllComponents(); counterLayout.removeAllComponents(); diseaseGroupSelectOption.removeAllItems(); selectAllSet.clear();/*from www .ja va2s . c o m*/ // fullSelectionSet.clear(); // fullSelectionSet.addAll(labels); int counter = 0; labelsLayoutSet.clear(); for (final VerticalLayout component : createComponents(labels)) { VerticalLayout container = new VerticalLayout(); container.setWidth(30 + "px"); container.setHeight("20px"); container.setStyleName("countItem"); Label label = new Label(counter + 1 + ""); container.addComponent(label); this.counterLayout.addComponent(container); sortableDiseaseGroupLayout.addComponent(component, strTitle); diseaseGroupSelectOption.addItem(counter); diseaseGroupSelectOption.setItemCaption(counter, ""); autoClear = true; diseaseGroupSelectOption.select(counter); selectAllSet.add(counter); counter++; } autoClear = false; }
From source file:probe.com.view.body.quantdatasetsoverview.quantproteinscomparisons.TrendLegend.java
private HorizontalLayout generateItemLabel(String label, String style) { HorizontalLayout labelLayout = new HorizontalLayout(); labelLayout.setSpacing(true);//from w ww . j av a 2 s. com labelLayout.setHeight("20px"); VerticalLayout icon = new VerticalLayout(); icon.setWidth("10px"); icon.setHeight("10px"); icon.setStyleName(style); labelLayout.addComponent(icon); labelLayout.setComponentAlignment(icon, Alignment.MIDDLE_LEFT); Label l = new Label("<font size='2' face='Verdana'>" + label + "</font>"); l.setContentMode(ContentMode.HTML); labelLayout.addComponent(l); return labelLayout; }
From source file:probe.com.view.body.quantdatasetsoverview.quantproteinstabsheet.peptidescontainer.popupcomponents.PeptideSequenceContainer.java
private void addTerminalLabels(int top, int width) { VerticalLayout nTerminalEdge = new VerticalLayout(); nTerminalEdge.setWidth("19px"); nTerminalEdge.setHeight("15px"); nTerminalEdge.setStyleName("terminal"); Label nLabel = new Label("N"); nLabel.setWidth("10px"); nLabel.setStyleName("ntermlayout"); nTerminalEdge.addComponent(nLabel);//from w ww . j ava2s . c o m this.addComponent(nTerminalEdge, "left: " + (0) + "px; top: " + (top) + "px;"); VerticalLayout cTerminalEdge = new VerticalLayout(); cTerminalEdge.setWidth("20px"); cTerminalEdge.setHeight("15px"); cTerminalEdge.setStyleName("terminal"); Label cLabel = new Label("C"); cLabel.setStyleName("ctermlayout"); cTerminalEdge.addComponent(cLabel); cLabel.setWidth("10px"); cTerminalEdge.setComponentAlignment(cLabel, Alignment.TOP_RIGHT); this.addComponent(cTerminalEdge, "left: " + (width - 21) + "px; top: " + (top) + "px;"); }
From source file:probe.com.view.body.quantdatasetsoverview.quantproteinstabsheet.peptidescontainer.popupcomponents.PeptideSequenceContainer.java
private void checkAndMerge() { TreeMap<Integer, StackedBarPeptideComponent> finalUpdatedPeptidesCoverageMap = new TreeMap<Integer, StackedBarPeptideComponent>(); TreeMap<Integer, StackedBarPeptideComponent> orderedCompoMap = new TreeMap<Integer, StackedBarPeptideComponent>(); for (StackedBarPeptideComponent peptideLayout : allPeptidesStackedBarComponentsMap) { if (orderedCompoMap.containsKey(peptideLayout.getX0())) { StackedBarPeptideComponent toReplaceComp = orderedCompoMap.remove(peptideLayout.getX0()); if (toReplaceComp.getWidthArea() <= peptideLayout.getWidthArea()) { orderedCompoMap.put(peptideLayout.getX0(), peptideLayout); } else { orderedCompoMap.put(toReplaceComp.getX0(), toReplaceComp); }/*from ww w . j a v a 2 s. co m*/ } else { orderedCompoMap.put(peptideLayout.getX0(), peptideLayout); } } if (orderedCompoMap.size() == 1) { StackedBarPeptideComponent peptideI = orderedCompoMap.firstEntry().getValue(); finalUpdatedPeptidesCoverageMap.put(peptideI.getX0(), peptideI); } else { TreeMap<Integer, StackedBarPeptideComponent> refrenceOrderedCompoMap = new TreeMap<Integer, StackedBarPeptideComponent>( orderedCompoMap); while (true) { boolean merge = false; for (int keyI : orderedCompoMap.navigableKeySet()) { StackedBarPeptideComponent peptideI = orderedCompoMap.get(keyI); TreeMap<Integer, StackedBarPeptideComponent> comparableOrderedCompoMap = new TreeMap<Integer, StackedBarPeptideComponent>( refrenceOrderedCompoMap); comparableOrderedCompoMap.remove(keyI); for (int keyII : comparableOrderedCompoMap.navigableKeySet()) { StackedBarPeptideComponent peptideII = comparableOrderedCompoMap.get(keyII); if (((Integer) peptideII.getParam("start")) == ((Integer) peptideI.getParam("end") + 1) || (((Integer) peptideI.getParam("start")) == ((Integer) peptideII.getParam("end") + 1))) { // int x0 = Math.min(peptideI.getX0(), peptideII.getX0()); int widthArea = peptideI.getWidthArea() + peptideII.getWidthArea(); String sequence; if (peptideI.getX0() < peptideII.getX0()) { sequence = peptideI.getParam("sequence").toString() + peptideII.getParam("sequence"); } else { sequence = peptideII.getParam("sequence").toString() + peptideI.getParam("sequence"); } StackedBarPeptideComponent updatedCoverComp = new StackedBarPeptideComponent(x0, widthArea, "", ""); refrenceOrderedCompoMap.remove(keyI); refrenceOrderedCompoMap.remove(keyII); updatedCoverComp.setParam("sequence", sequence); updatedCoverComp.setParam("start", Math.min(((Integer) peptideI.getParam("start")), ((Integer) peptideII.getParam("start")))); updatedCoverComp.setParam("end", Math.max(((Integer) peptideI.getParam("end")), ((Integer) peptideII.getParam("end")))); refrenceOrderedCompoMap.put(x0 + 10000, updatedCoverComp); merge = true; break; } else if (((Integer) peptideII.getParam("start") > (Integer) peptideI.getParam("start")) && ((Integer) peptideII.getParam("end") > (Integer) peptideI.getParam("end")) && ((Integer) peptideII.getParam("start") < (Integer) peptideI.getParam("end"))) { //// int x0 = Math.min(peptideI.getX0(), peptideII.getX0()); int widthArea = 0; String sequence; if (peptideI.getX0() < peptideII.getX0()) { sequence = peptideI.getParam("sequence").toString() + peptideII.getParam("sequence"); widthArea = peptideII.getWidthArea() + (peptideII.getX0() - peptideI.getX0()); } else { sequence = peptideII.getParam("sequence").toString() + peptideI.getParam("sequence"); widthArea = peptideI.getWidthArea() + (peptideI.getX0() - peptideII.getX0()); } StackedBarPeptideComponent updatedCoverComp = new StackedBarPeptideComponent(x0, widthArea, "", ""); refrenceOrderedCompoMap.remove(keyI); refrenceOrderedCompoMap.remove(keyII); updatedCoverComp.setParam("sequence", sequence); updatedCoverComp.setParam("start", Math.min(((Integer) peptideI.getParam("start")), ((Integer) peptideII.getParam("start")))); updatedCoverComp.setParam("end", Math.max(((Integer) peptideI.getParam("end")), ((Integer) peptideII.getParam("end")))); refrenceOrderedCompoMap.put(x0 + 10000, updatedCoverComp); merge = true; break; } else if (((Integer) peptideII.getParam("start") > (Integer) peptideI.getParam("start")) && ((Integer) peptideII.getParam("end") <= (Integer) peptideI.getParam("end"))) { int x0 = Math.min(peptideI.getX0(), peptideII.getX0()); int widthArea = 0; String sequence; if (peptideI.getParam("sequence").toString() .contains(peptideII.getParam("sequence").toString())) { widthArea = peptideI.getWidthArea(); sequence = peptideI.getParam("sequence").toString(); } else { widthArea = peptideII.getWidthArea(); sequence = peptideII.getParam("sequence").toString(); } StackedBarPeptideComponent updatedCoverComp = new StackedBarPeptideComponent(x0, widthArea, "", ""); refrenceOrderedCompoMap.remove(keyI); refrenceOrderedCompoMap.remove(keyII); updatedCoverComp.setParam("sequence", sequence); updatedCoverComp.setParam("start", Math.min(((Integer) peptideI.getParam("start")), ((Integer) peptideII.getParam("start")))); updatedCoverComp.setParam("end", Math.max(((Integer) peptideI.getParam("end")), ((Integer) peptideII.getParam("end")))); refrenceOrderedCompoMap.put(x0 + 10000, updatedCoverComp); merge = true; break; } } } if (merge) { orderedCompoMap.clear(); orderedCompoMap.putAll(refrenceOrderedCompoMap); } else { break; } } finalUpdatedPeptidesCoverageMap.putAll(refrenceOrderedCompoMap); } // LinkedHashMap<Integer, Integer> startEndMap = new LinkedHashMap<Integer, Integer>(); // LinkedHashMap<Integer, StackedBarPeptideComponent> stackedPepSet = new LinkedHashMap<Integer, StackedBarPeptideComponent>(); // LinkedHashMap<Integer, StackedBarPeptideComponent> orderedCompoMap = new LinkedHashMap<Integer, StackedBarPeptideComponent>(); // for (StackedBarPeptideComponent peptideLayout : allPeptidesStackedBarComponentsMap) { // int start = (Integer) peptideLayout.getParam("start"); // int end = (Integer) peptideLayout.getParam("end"); // if (!startEndMap.containsKey(start)) { // int x0 = peptideLayout.getX0(); // int widthArea = peptideLayout.getWidthArea(); // String sequence = peptideLayout.getParam("sequence").toString(); // StackedBarPeptideComponent updatedCoverComp = new StackedBarPeptideComponent(x0, widthArea, "", ""); // updatedCoverComp.setParam("sequence", sequence); // updatedCoverComp.setParam("start", peptideLayout.getParam("start")); // updatedCoverComp.setParam("end", peptideLayout.getParam("end")); // startEndMap.put(start, end); // stackedPepSet.put(start, peptideLayout); // } else { // StackedBarPeptideComponent updatedCoverComp = stackedPepSet.remove(start); // int x0 = peptideLayout.getX0(); // int widthArea ; // String sequence; // if (updatedCoverComp.getParam("sequence").toString().contains(peptideLayout.getParam("sequence").toString())) { // widthArea = updatedCoverComp.getWidthArea(); // sequence = updatedCoverComp.getParam("sequence").toString(); // } else { // widthArea = peptideLayout.getWidthArea(); // sequence = peptideLayout.getParam("sequence").toString(); // } // // StackedBarPeptideComponent updatedCoverCompI = new StackedBarPeptideComponent(x0, widthArea, "", ""); // updatedCoverCompI.setParam("sequence", sequence); // updatedCoverCompI.setParam("start", peptideLayout.getParam("start")); // updatedCoverCompI.setParam("end", Math.max((Integer)peptideLayout.getParam("end"),(Integer)updatedCoverComp.getParam("end"))); // startEndMap.put(start,(Integer) updatedCoverCompI.getParam("end")); // stackedPepSet.put(start, updatedCoverCompI); // // } // // } for (StackedBarPeptideComponent peptideLayout : finalUpdatedPeptidesCoverageMap.values()) { VerticalLayout coverageComp = new VerticalLayout(); coverageComp.setStyleName("vdarkgray"); coverageComp.setHeight("15px"); coverageComp.setWidth(peptideLayout.getWidth(), peptideLayout.getWidthUnits()); coverageComp.setDescription("" + peptideLayout.getParam("start") + "-" + peptideLayout.getParam("sequence") + "-" + peptideLayout.getParam("end")); coveragePeptidesSequencesBar.addComponent(coverageComp, "left: " + (peptideLayout.getX0() - 20) + "px; top: " + (0) + "px;"); } }
From source file:probe.com.view.body.quantdatasetsoverview.quantproteinstabsheet.studies.PeptidesComparisonsSequenceLayout.java
/** * * @param cp// w w w . ja v a 2 s. c om * @param width * @param Quant_Central_Manager */ public PeptidesComparisonsSequenceLayout(QuantCentralManager Quant_Central_Manager, final DiseaseGroupsComparisonsProteinLayout cp, int width) { this.studiesMap = new LinkedHashMap<String, StudyInfoData>(); this.setColumns(4); this.setRows(3); this.setWidthUndefined(); this.setSpacing(true); this.setMargin(new MarginInfo(true, false, false, false)); comparisonTitle = new Label(); comparisonTitle.setContentMode(ContentMode.HTML); comparisonTitle.setStyleName("custChartLabelHeader"); comparisonTitle.setWidth((width - 55) + "px"); 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); //end of toplayout //init comparison study layout GridLayout proteinSequenceComparisonsContainer = new GridLayout(2, cp.getComparison().getDatasetIndexes().length); proteinSequenceComparisonsContainer.setWidthUndefined(); proteinSequenceComparisonsContainer.setHeightUndefined(); proteinSequenceComparisonsContainer.setStyleName(Reindeer.LAYOUT_WHITE); proteinSequenceComparisonsContainer.setSpacing(true); proteinSequenceComparisonsContainer.setMargin(new MarginInfo(true, false, false, false)); this.addComponent(proteinSequenceComparisonsContainer, 1, 1); coverageWidth = (width - 100 - 180); Map<Integer, Set<QuantPeptide>> dsQuantPepMap = new HashMap<Integer, Set<QuantPeptide>>(); for (QuantPeptide quantPep : cp.getQuantPeptidesList()) { if (!dsQuantPepMap.containsKey(quantPep.getDsKey())) { Set<QuantPeptide> subList = new HashSet<QuantPeptide>(); dsQuantPepMap.put(quantPep.getDsKey(), subList); } Set<QuantPeptide> subList = dsQuantPepMap.get(quantPep.getDsKey()); subList.add(quantPep); dsQuantPepMap.put(quantPep.getDsKey(), subList); } int numb = 0; int panelWidth = Page.getCurrent().getBrowserWindowWidth() - 100; 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] + " )"; ; final StudyInformationPopupComponent studyInformationPopupPanel = new StudyInformationPopupComponent( panelWidth, cp.getProtName(), cp.getUrl(), cp.getComparison().getComparisonFullName()); studyInformationPopupPanel.setVisible(false); LayoutEvents.LayoutClickListener studyListener = new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { Integer dsId; if (event.getComponent() instanceof AbsoluteLayout) { dsId = (Integer) ((AbsoluteLayout) event.getComponent()).getData(); } else { dsId = (Integer) ((VerticalLayout) event.getComponent()).getData(); } studyInformationPopupPanel.updateContent(dsToStudyLayoutMap.get(dsId)); } }; TreeSet<QuantProtein> orderSet = new TreeSet<QuantProtein>(cp.getDsQuantProteinsMap().values()); for (QuantProtein quantProtein : orderSet) { StudyInfoData exportData = new StudyInfoData(); exportData.setCoverageWidth(coverageWidth); Label studyTitle = new Label();//"Study " + (numb + 1)); studyTitle.setStyleName("peptideslayoutlabel"); studyTitle.setHeightUndefined(); studyTitle.setWidth("200px"); Label iconTitle = new Label("#Patients (" + (quantProtein.getPatientsGroupIINumber() + quantProtein.getPatientsGroupINumber()) + ")"); exportData.setSubTitle(iconTitle.getValue()); iconTitle.setStyleName("peptideslayoutlabel"); iconTitle.setHeightUndefined(); if (quantProtein.getStringPValue().equalsIgnoreCase("Not Significant") || quantProtein.getStringFCValue().equalsIgnoreCase("Not regulated")) { iconTitle.setStyleName("notregicon"); exportData.setTrend(0); } else if (quantProtein.getStringFCValue().equalsIgnoreCase("Decreased")) { iconTitle.setStyleName("downarricon"); exportData.setTrend(-1); } else { exportData.setTrend(1); iconTitle.setStyleName("uparricon"); } iconTitle.setDescription(cp.getProteinAccssionNumber() + " : #Patients (" + (quantProtein.getPatientsGroupIINumber() + quantProtein.getPatientsGroupINumber()) + ") " + quantProtein.getStringFCValue() + " " + quantProtein.getStringPValue() + ""); VerticalLayout labelContainer = new VerticalLayout(); labelContainer.addComponent(studyTitle); labelContainer.addComponent(iconTitle); proteinSequenceComparisonsContainer.addComponent(labelContainer, 0, numb); proteinSequenceComparisonsContainer.setComponentAlignment(labelContainer, Alignment.TOP_CENTER); Map<Integer, ComparisonDetailsBean> patientGroupsNumToDsIdMap = new HashMap<Integer, ComparisonDetailsBean>(); ComparisonDetailsBean pGr = new ComparisonDetailsBean(); patientGroupsNumToDsIdMap .put((quantProtein.getPatientsGroupIINumber() + quantProtein.getPatientsGroupINumber()), pGr); QuantDatasetObject ds; ds = Quant_Central_Manager.getFullQuantDatasetMap().get(quantProtein.getDsKey()); StudyPopupLayout study = new StudyPopupLayout(panelWidth, quantProtein, ds, cp.getProteinAccssionNumber(), cp.getUrl(), cp.getProtName(), Quant_Central_Manager.getDiseaseHashedColorMap()); Set<QuantDatasetObject> qdsSet = new HashSet<QuantDatasetObject>(); qdsSet.add(ds); study.setInformationData(qdsSet, cp); dsToStudyLayoutMap.put(ds.getDsKey(), study); labelContainer.addLayoutClickListener(studyListener); labelContainer.setData(ds.getDsKey()); studyTitle.setValue("[" + (numb + 1) + "] " + ds.getAuthor()); exportData.setTitle(ds.getAuthor()); if (dsQuantPepMap.get(quantProtein.getDsKey()) == null) { Label noPeptidesInfoLabel = new Label("No Peptide Information Available "); noPeptidesInfoLabel.setHeightUndefined(); noPeptidesInfoLabel.setStyleName("peptideslayoutlabel"); VerticalLayout labelValueContainer = new VerticalLayout(); labelValueContainer.addComponent(noPeptidesInfoLabel); labelValueContainer.addLayoutClickListener(studyListener); labelValueContainer.setData(ds.getDsKey()); proteinSequenceComparisonsContainer.addComponent(labelValueContainer, 1, numb); proteinSequenceComparisonsContainer.setComponentAlignment(labelValueContainer, Alignment.TOP_CENTER); numb++; studiesMap.put((numb + 1) + ds.getAuthor(), exportData); continue; } String key = "_-_" + quantProtein.getDsKey() + "_-_" + cp.getProteinAccssionNumber() + "_-_"; PeptidesInformationOverviewLayout peptideInfoLayout = new PeptidesInformationOverviewLayout( cp.getSequence(), dsQuantPepMap.get(quantProtein.getDsKey()), coverageWidth, true, studyListener, ds.getDsKey()); exportData.setPeptidesInfoList(peptideInfoLayout.getStackedPeptides()); exportData.setLevelsNumber(peptideInfoLayout.getLevel()); hasPTM = peptideInfoLayout.isHasPTM(); peptidesInfoLayoutDSIndexMap.put(key, peptideInfoLayout); proteinSequenceComparisonsContainer.addComponent(peptideInfoLayout, 1, numb); numb++; studiesMap.put((numb + 1) + ds.getAuthor(), exportData); } String rgbColor = Quant_Central_Manager .getDiseaseHashedColor(groupCompTitle.split(" / ")[1].split("\n")[1]); comparisonTitle.setValue("<font color='" + rgbColor + "' style='font-weight: bold;'>" + updatedHeader + " (#Datasets " + numb + "/" + cp.getComparison().getDatasetIndexes().length + ")</font>"); comparisonTitle.setDescription(cp.getComparison().getComparisonFullName()); VerticalLayout bottomSpacer = new VerticalLayout(); bottomSpacer.setWidth((width - 100) + "px"); bottomSpacer.setHeight("10px"); bottomSpacer.setStyleName("dottedline"); this.addComponent(bottomSpacer, 1, 2); }
From source file:probe.com.view.body.welcomelayout.PublicationsInformationWindow.java
public PublicationsInformationWindow(List<Object[]> publicationList) { int height = Page.getCurrent().getBrowserWindowHeight() - 100; int width = Page.getCurrent().getBrowserWindowWidth() - 100; int columnNum = width / 250; width = columnNum * 250;//from w w w. j a v a2 s .c o m VerticalLayout popupBodyWrapper = new VerticalLayout(); popupBodyWrapper.setWidth("100%"); popupBodyWrapper.setHeight("100%"); VerticalLayout popupBody = new VerticalLayout(); popupBody.setWidth((width) + "px"); popupBody.setHeightUndefined(); popupBody.setStyleName(Reindeer.LAYOUT_WHITE); popupBody.setMargin(true); popupBody.setSpacing(true); popupBodyWrapper.addComponent(popupBody); popupBodyWrapper.setComponentAlignment(popupBody, Alignment.TOP_CENTER); popupWindow = new Window() { @Override public void close() { popupWindow.setVisible(false); } }; popupWindow.setContent(popupBodyWrapper); popupWindow.setWindowMode(WindowMode.NORMAL); popupWindow.setWidth((width + 22) + "px"); popupWindow.setVisible(false); popupWindow.setResizable(false); popupWindow.setClosable(false); popupWindow.setStyleName(Reindeer.WINDOW_LIGHT); popupWindow.setModal(true); popupWindow.setDraggable(false); popupWindow.setCaption( "<font color='gray' style='font-weight: bold;!important'> Publication Information</font>"); UI.getCurrent().addWindow(popupWindow); popupWindow.center(); popupWindow.setCaptionAsHtml(true); popupWindow.setClosable(true); GridLayout publicationContainer = new GridLayout(); publicationContainer.setWidth("100%"); publicationContainer.setSpacing(true); publicationContainer.setMargin(true); popupBody.addComponent(publicationContainer); publicationContainer.setColumns(columnNum); publicationContainer.setRows(publicationList.size()); this.addLayoutClickListener(PublicationsInformationWindow.this); int row = 0; int col = 0; for (Object[] obj : publicationList) { VerticalLayout publicationLayout = initPublicationLayout(obj); String btnName = "<font size=1 >" + obj[0].toString() + "</font><br/>" + obj[1].toString() + "<br/><font size=1 >" + obj[2].toString() + "</font><br/><font size=1 >#Proteins: " + obj[5].toString() /*+ "/" + obj[5].toString() + */ + " #Peptides: " + obj[7].toString() /*+ "/" + obj[7].toString() +*/ + "</font>"; PopupInfoBtn publicationBtn = new PopupInfoBtn(publicationLayout, btnName, obj[1].toString()); publicationContainer.addComponent(publicationBtn, col++, row); publicationContainer.setComponentAlignment(publicationBtn, Alignment.TOP_CENTER); if (col >= columnNum) { row++; col = 0; } } height = Math.min((++row * 85) + 200, height); popupWindow.setHeight((height) + "px"); }
From source file:probe.com.view.core.InfoPopupBtn.java
public InfoPopupBtn(String infoText) { HorizontalLayout topLayout = new HorizontalLayout(); VerticalLayout mainBody = new VerticalLayout(); mainBody.setWidth("450px"); mainBody.addComponent(topLayout);//www .j a va2 s.c o m Label infoHeaderLabel = new Label( "<h3 style='font-family:verdana;color:black;font-weight:bold;margin-left:20px;margin-right:20px;'>Information</h3>"); infoHeaderLabel.setContentMode(ContentMode.HTML); topLayout.addComponent(infoHeaderLabel); topLayout.setWidth("100%"); Label infoLable = new Label( "<div style='text-align:justify;text-justify:inter-word;'><p style='line-height:60px; font-family:verdana;color:black;margin-left:20px;margin-right:20px;'>" + infoText + "</p></div>"); infoLable.setContentMode(ContentMode.HTML); infoLable.setWidth("450px"); mainBody.addComponent(infoLable); popupBodyLayout.addComponent(mainBody); mainBody.setStyleName("popupmainbody"); VerticalLayout closeBtn = new VerticalLayout(); closeBtn.setWidth("16px"); closeBtn.setHeight("16px"); closeBtn.setStyleName("defaultclosebtn"); topLayout.addComponent(closeBtn); topLayout.setComponentAlignment(closeBtn, Alignment.TOP_RIGHT); popupLayout = new PopupView("", popupBodyLayout); this.setStyleName("infoicon"); this.setWidth("16px"); this.setHeight("16px"); this.setDescription("Information"); this.addLayoutClickListener(InfoPopupBtn.this); this.addComponent(popupLayout); this.popupLayout.setHideOnMouseOut(false); closeBtn.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { popupLayout.setPopupVisible(false); } }); }
From source file:probe.com.view.core.NotificationComponent.java
public NotificationComponent(String text, String uniqueID) { this.uniqueID = uniqueID; popupBody = new VerticalLayout(); popupBody.setWidthUndefined();//setWidth((200) + "px"); popupBody.setHeightUndefined();//setHeight((200) + "px"); popupBody.setStyleName("notificationbody"); popupBody.addLayoutClickListener(NotificationComponent.this); popup = new PopupView(null, popupBody) { @Override//from ww w . j a v a 2 s . c om public void setPopupVisible(boolean visible) { super.setPopupVisible(visible); //To change body of generated methods, choose Tools | Templates. } @Override public boolean isPopupVisible() { return super.isPopupVisible(); //To change body of generated methods, choose Tools | Templates. } }; this.addComponent(popup); // popupWindow = new Window() { // // @Override // public void close() { // popupWindow.setVisible(false); // } // // }; // // popupWindow.setStyleName("notificationwindow"); // popupWindow.setCaption(null); // popupWindow.setContent(popupBody); // popupWindow.setWindowMode(WindowMode.NORMAL); // popupWindow.setWidthUndefined();//.setWidth((200) + "px"); // popupWindow.setHeightUndefined();//setHeight((200) + "px"); // popupWindow.setVisible(false); // popupWindow.setResizable(false); // popupWindow.setClosable(false); // popupWindow.setModal(false); // popupWindow.setDraggable(false); // popupWindow.setModal(false); // // UI.getCurrent().addWindow(popupWindow); // popupWindow.setPositionX(x); // popupWindow.setPositionY(y); // // popupWindow.setCaptionAsHtml(true); // popupWindow.setClosable(false); popupBody.setMargin(true); popupBody.setSpacing(true); Label content = new Label("<center>" + text + "</center>"); content.setStyleName("notificationtext"); content.setContentMode(ContentMode.HTML); popupBody.addComponent(content); VerticalLayout footer = new VerticalLayout(); footer.setStyleName("bubbletalkfooter"); footer.setWidth("30px"); footer.setHeight("20px"); popupBody.addComponent(footer); popup.setHideOnMouseOut(false); popup.setStyleName("popupnotification"); popupBody.addStyleName("slowinvisible"); }
From source file:probe.com.view.core.NotificationComponent1.java
public NotificationComponent1(int x, int y, String text, String uniqueID) { this.uniqueID = uniqueID; popupBody = new VerticalLayout(); popupBody.setWidthUndefined();/*from w w w . java2 s .c om*/ ;//setWidth((200) + "px"); popupBody.setHeightUndefined(); ;//setHeight((200) + "px"); popupBody.setStyleName("notificationbody"); popupBody.addLayoutClickListener(NotificationComponent1.this); popupWindow = new Window() { @Override public void close() { popupWindow.setVisible(false); } }; popupWindow.setStyleName("notificationwindow"); popupWindow.setCaption(null); popupWindow.setContent(popupBody); popupWindow.setWindowMode(WindowMode.NORMAL); popupWindow.setWidthUndefined();//.setWidth((200) + "px"); popupWindow.setHeightUndefined();//setHeight((200) + "px"); popupWindow.setVisible(false); popupWindow.setResizable(false); popupWindow.setClosable(false); popupWindow.setModal(false); popupWindow.setDraggable(false); popupWindow.setModal(false); UI.getCurrent().addWindow(popupWindow); popupWindow.setPositionX(x); popupWindow.setPositionY(y); popupWindow.setCaptionAsHtml(true); popupWindow.setClosable(false); popupBody.setMargin(true); popupBody.setSpacing(true); Label content = new Label("<center>" + text + "</center>"); content.setStyleName("notificationtext"); content.setContentMode(ContentMode.HTML); popupBody.addComponent(content); VerticalLayout footer = new VerticalLayout(); footer.setStyleName("bubbletalkfooter"); footer.setWidth("30px"); footer.setHeight("20px"); popupBody.addComponent(footer); }