List of usage examples for com.vaadin.ui VerticalLayout setStyleName
@Override public void setStyleName(String style)
From source file:org.robot.gtf.gui.GTFApplication.java
License:Apache License
@Override public void init() { buildNewProjectWindow();/*from ww w. ja v a 2 s . c om*/ buildAboutWindow(); buildMenuButtons(); HorizontalLayout container = new HorizontalLayout(); window = new Window(TextResources.getAppName() + " - " + TextResources.getAppVersion()); window.setTheme("runo"); window.setContent(container); setMainWindow(window); // Main Menu VerticalLayout menuContainer = new VerticalLayout(); menuContainer.addComponent(buttonNewTestProject); menuContainer.addComponent(buttonOpenTestProject); menuContainer.addComponent(buttonSettings); menuContainer.addComponent(buttonHelp); menuContainer.setMargin(true, true, false, true); container.addComponent(menuContainer); // Main Content VerticalLayout mainContent = new VerticalLayout(); mainContent.setMargin(true, false, false, false); mainContent.setSpacing(true); // Heading Layout VerticalLayout headingContent = new VerticalLayout(); headingContent.setStyleName("v-window-header "); Label heading = new Label(TextResources.getAppName() + " - " + TextResources.getAppVersion()); heading.setStyleName("v-label-h1"); headingContent.addComponent(heading); mainContent.addComponent(headingContent); projectNameHeading = new Label(); projectNameHeading.setStyleName("v-label-h3"); mainContent.addComponent(projectNameHeading); // Testcase table and Scenario selection HorizontalLayout testcases = new HorizontalLayout(); table.setVisible(false); // Selection list with scenarios scenariosListSelect.setNullSelectionAllowed(false); scenariosListSelect.setImmediate(true); scenariosListSelect.setVisible(false); testcases.setSpacing(true); testcases.addComponent(table); testcases.addComponent(scenariosListSelect); mainContent.addComponent(testcases); // Button Container HorizontalLayout buttons = new HorizontalLayout(); buttons.setSpacing(true); // Table Add Button addRowButton = new Button("Add Testcase", new Button.ClickListener() { public void buttonClick(ClickEvent event) { if (table2 == null) { table.addItem(); } else { table2.addItem(); } } }); addRowButton.addStyleName(Runo.BUTTON_SMALL); addRowButton.addStyleName(Runo.BUTTON_DEFAULT); addRowButton.setIcon(new ThemeResource("../runo/icons/16/document-add.png")); addRowButton.setVisible(false); buttons.addComponent(addRowButton); // Table Save Button saveButton = new Button("Save", new Button.ClickListener() { public void buttonClick(ClickEvent event) { } }); saveButton.addStyleName(Runo.BUTTON_SMALL); saveButton.addStyleName(Runo.BUTTON_DEFAULT); saveButton.setIcon(new ThemeResource("../runo/icons/16/ok.png")); saveButton.setVisible(false); buttons.addComponent(saveButton); mainContent.addComponent(buttons); container.addComponent(mainContent); }
From source file:org.semanticsoft.vaaclipse.presentation.renderers.PartRenderer.java
License:Open Source License
@Override public void createWidget(MUIElement element, MElementContainer<MUIElement> parent) { VerticalLayout pane = new VerticalLayout(); pane.setSizeFull();// www . j a va 2 s . co m final MPart part = (MPart) element; CssLayout toolbarArea = new CssLayout(); toolbarArea.setStyleName("mparttoolbararea"); toolbarArea.setSizeUndefined(); toolbarArea.setWidth("100%"); pane.addComponent(toolbarArea); //create toolbar MToolBar toolbar = part.getToolbar(); if (toolbar != null && toolbar.isToBeRendered()) { Component toolbarWidget = (Component) renderingEngine.createGui(toolbar); ((AbstractLayout) toolbarWidget).setSizeUndefined(); toolbarWidget.setStyleName("mparttoolbar"); toolbarArea.addComponent(toolbarWidget); } VerticalLayout contributionArea = new VerticalLayout(); contributionArea.setSizeFull(); pane.addComponent(contributionArea); pane.setExpandRatio(contributionArea, 100); pane.setStyleName("part"); element.setWidget(pane); IEclipseContext localContext = part.getContext(); localContext.set(Component.class, contributionArea); localContext.set(ComponentContainer.class, contributionArea); localContext.set(VerticalLayout.class, contributionArea); localContext.set(MPart.class, part); SavePromptSetup savePromptProvider = new SavePromptSetup(); savePrompts.put(part, savePromptProvider); localContext.set(SavePromptSetup.class, savePromptProvider); if (part instanceof MInputPart) localContext.set(MInputPart.class, (MInputPart) part); IContributionFactory contributionFactory = (IContributionFactory) localContext .get(IContributionFactory.class.getName()); Object newPart = contributionFactory.create(part.getContributionURI(), localContext); part.setObject(newPart); }
From source file:org.tltv.gantt.demo.DemoUI.java
License:Apache License
@Override protected void init(VaadinRequest request) { ganttListener = null;//from w ww. j av a2 s . co m createGantt(); MenuBar menu = controlsMenuBar(); Panel controls = createControls(); TabSheet tabsheet = new TabSheet(); tabsheet.setSizeFull(); Component wrapper = UriFragmentWrapperFactory.wrapByUriFragment(UI.getCurrent().getPage().getUriFragment(), gantt); if (wrapper instanceof GanttListener) { ganttListener = (GanttListener) wrapper; } final VerticalLayout layout = new VerticalLayout(); layout.setStyleName("demoContentLayout"); layout.setSizeFull(); layout.addComponent(menu); layout.addComponent(controls); layout.addComponent(wrapper); layout.setExpandRatio(wrapper, 1); setContent(layout); }
From source file:org.vaadin.tori.component.DebugControlPanel.java
License:Apache License
private Component createControlPanel(final ContextData data) { this.data = data; final VerticalLayout layout = new VerticalLayout(); layout.setStyleName(Reindeer.PANEL_LIGHT); layout.setWidth("300px"); layout.setSpacing(true);//from w ww .j a v a 2s. c o m final Set<Method> setters = getSettersByReflection(authorizationService); final List<Method> orderedSetters = new ArrayList<Method>(setters); Collections.sort(orderedSetters, new Comparator<Method>() { @Override public int compare(final Method o1, final Method o2) { return o1.getName().compareToIgnoreCase(o2.getName()); } }); try { for (final Method setter : orderedSetters) { if (isForPosts(setter)) { layout.addComponent(createPostControl(setter, data.getPosts())); } else { layout.addComponent(createRegularControl(setter)); } } } catch (final Exception e) { e.printStackTrace(); layout.addComponent(new Label(e.toString())); } return layout; }
From source file:pl.exsio.frameset.vaadin.navigation.menu.AccordionMenu.java
License:Open Source License
private VerticalLayout initPanel(VerticalLayout panel, MenuItem category, Tab tab) { for (final MenuItem item : category.getChildren()) { final VaadinFrame frame = (VaadinFrame) item.getFrame(); final Button b = new NativeButton(t(frame.getMenuLabel())); b.setIcon(frame.getIcon());//from w w w .j av a 2 s.c o m b.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { ((FramesetUI) getUI()).getFramesetNavigator().navigateTo(frame, true); MenuSelectionChangeEvent e = new MenuSelectionChangeEvent(item, b); for (MenuSelectionChangeListener listener : listeners) { listener.onSelectionChange(e); } } }); b.setStyleName("button-" + frame.getSlug()); this.buttonsMap.put(frame, b); this.frameMap.put(frame, tab); this.buttons.add(b); panel.addComponent(b); } panel.setStyleName("panel-" + category.getFrame().getSlug()); return panel; }
From source file:probe.com.view.body.quantcompare.PieChart.java
public PieChart(String title, double full, double found, final String notfound) { this.setWidth(200 + "px"); this.setHeight(200 + "px"); defaultKeyColorMap.put("Found", new Color(110, 177, 206)); defaultKeyColorMap.put("Not found", new Color(219, 169, 1)); otherSymbols.setGroupingSeparator('.'); this.setStyleName("click"); labels = new String[] { "Found", "Not found" }; double foundPercent = ((found / full) * 100.0); df = new DecimalFormat("#.##", otherSymbols); valuesMap.put("Found", ((int) found) + " (" + df.format(foundPercent) + "%)"); values = new Double[] { foundPercent, 100.0 - foundPercent }; valuesMap.put("Not found", ((int) (full - found)) + " (" + df.format(100.0 - foundPercent) + "%)"); String defaultImgURL = initPieChart(200, 200, title); chartImg.setSource(new ExternalResource(defaultImgURL)); this.addComponent(chartImg); this.addLayoutClickListener(PieChart.this); popupLayout = new PopupView(null, popupBody); popupLayout.setHideOnMouseOut(false); popupBody.setWidth("300px"); popupBody.setStyleName(Reindeer.LAYOUT_WHITE); popupBody.setHeightUndefined();/* w w w. jav a 2s . c o m*/ this.addComponent(popupLayout); this.notfound = notfound.replace(" ", "").replace(",", "/n"); HorizontalLayout topLayout = new HorizontalLayout(); topLayout.setWidth("100%"); topLayout.setHeight("20px"); Label header = new Label("<b>Not Found (New Proteins)</b>"); header.setStyleName(Reindeer.LABEL_SMALL); topLayout.addComponent(header); header.setContentMode(ContentMode.HTML); VerticalLayout closeBtn = new VerticalLayout(); closeBtn.setWidth("10px"); closeBtn.setHeight("10px"); closeBtn.setStyleName("closebtn"); topLayout.addComponent(closeBtn); topLayout.setComponentAlignment(closeBtn, Alignment.TOP_RIGHT); closeBtn.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { popupLayout.setPopupVisible(false); } }); popupBody.addComponent(topLayout); popupBody.addComponent(textArea); textArea.setWidth("100%"); textArea.setHeight("150px"); textArea.setValue(this.notfound); textArea.setReadOnly(true); popupBody.setSpacing(true); HorizontalLayout bottomLayout = new HorizontalLayout(); bottomLayout.setWidth("100%"); bottomLayout.setHeight("40px"); bottomLayout.setMargin(new MarginInfo(false, true, true, true)); popupBody.addComponent(bottomLayout); Button exportTableBtn = new Button(""); exportTableBtn.setHeight("24px"); exportTableBtn.setWidth("24px"); exportTableBtn.setPrimaryStyleName("exportxslbtn"); exportTableBtn.setDescription("Export table data"); exportTableBtn.addClickListener(new Button.ClickListener() { private Table table; @Override public void buttonClick(Button.ClickEvent event) { if (table == null) { table = new Table(); table.addContainerProperty("Index", Integer.class, null, "", null, Table.Align.RIGHT); table.addContainerProperty("Accession", String.class, Table.Align.CENTER); table.setVisible(false); addComponent(table); int i = 1; for (String str : notfound.replace(" ", "").replace(",", "\n").split("\n")) { table.addItem(new Object[] { i, str }, i++); } } ExcelExport csvExport = new ExcelExport(table, "Not found protein accessions (New proteins)"); // csvExport.setReportTitle("CSF-PR / Not found protein accessions (New proteins) "); csvExport.setExportFileName("CSF-PR - Not found protein accessions" + ".xls"); csvExport.setMimeType(CsvExport.EXCEL_MIME_TYPE); csvExport.setDisplayTotals(false); csvExport.setExcelFormatOfProperty("Index", "#0;[Red] #0"); csvExport.export(); } }); bottomLayout.addComponent(exportTableBtn); bottomLayout.setComponentAlignment(exportTableBtn, Alignment.MIDDLE_RIGHT); }
From source file:probe.com.view.body.QuantCompareDataLayout.java
private VerticalLayout initProteinsDataCapture(int width) { VerticalLayout proteinsDataCapturingMainLayout = new VerticalLayout(); proteinsDataCapturingMainLayout.setSpacing(true); proteinsDataCapturingMainLayout.setMargin(true); String containerWidth = ((width * 2) + 10) + "px"; proteinsDataCapturingMainLayout.setWidth(containerWidth); proteinsDataCapturingMainLayout.setSpacing(true); Label titleLabel = new Label("2. Insert UniProt Proteins Accessions"); titleLabel.setContentMode(ContentMode.HTML); titleLabel.setStyleName("normalheader"); titleLabel.setHeight("20px"); proteinsDataCapturingMainLayout.addComponent(titleLabel); proteinsDataCapturingMainLayout.setComponentAlignment(titleLabel, Alignment.TOP_LEFT); GridLayout insertProteinsLayout = new GridLayout(3, 3); proteinsDataCapturingMainLayout.addComponent(insertProteinsLayout); insertProteinsLayout.setSpacing(true); insertProteinsLayout.setMargin(new MarginInfo(false, false, false, false)); insertProteinsLayout.setWidth(containerWidth); HorizontalLayout hlo1 = new HorizontalLayout(); hlo1.setWidth("100%"); hlo1.setMargin(new MarginInfo(false, true, false, false)); Label highLabel = new Label("<font color='#cc0000'> High</font>"); highLabel.setWidth("40px"); highLabel.setContentMode(ContentMode.HTML); hlo1.addComponent(highLabel);/*ww w. j a v a2s.com*/ HorizontalLayout hlo2 = new HorizontalLayout(); hlo2.setWidth("100%"); hlo2.setMargin(new MarginInfo(false, true, false, false)); Label stableLabel = new Label("<font color='#018df4'> Stable</font>"); stableLabel.setWidth("50px"); stableLabel.setContentMode(ContentMode.HTML); hlo2.addComponent(stableLabel); HorizontalLayout hlo3 = new HorizontalLayout(); hlo3.setWidth("100%"); hlo3.setMargin(new MarginInfo(false, true, false, false)); Label lowLabel = new Label("<font color='#009900'> Low</font>"); lowLabel.setWidth("40px"); lowLabel.setContentMode(ContentMode.HTML); hlo3.addComponent(lowLabel); insertProteinsLayout.addComponent(hlo1, 0, 0); insertProteinsLayout.setComponentAlignment(hlo1, Alignment.MIDDLE_CENTER); insertProteinsLayout.addComponent(hlo2, 1, 0); insertProteinsLayout.setComponentAlignment(hlo2, Alignment.MIDDLE_CENTER); insertProteinsLayout.addComponent(hlo3, 2, 0); insertProteinsLayout.setComponentAlignment(hlo3, Alignment.MIDDLE_CENTER); highTextArea.setWidth("100%"); highTextArea.setHeight("200px"); insertProteinsLayout.addComponent(highTextArea, 0, 1); insertProteinsLayout.setComponentAlignment(highTextArea, Alignment.MIDDLE_CENTER); stableTextArea.setWidth("100%"); stableTextArea.setHeight("200px"); insertProteinsLayout.addComponent(stableTextArea, 1, 1); insertProteinsLayout.setComponentAlignment(stableTextArea, Alignment.MIDDLE_CENTER); lowTextArea.setWidth("100%"); lowTextArea.setHeight("200px"); insertProteinsLayout.addComponent(lowTextArea, 2, 1); insertProteinsLayout.setComponentAlignment(lowTextArea, Alignment.MIDDLE_CENTER); VerticalLayout clear1 = new VerticalLayout(); hlo1.addComponent(clear1); clear1.setDescription("Clear field"); clear1.setStyleName("clearfieldbtn"); clear1.setWidth("20px"); clear1.setHeight("20px"); // insertProteinsLayout.addComponent(clear1, 0, 2); hlo1.setComponentAlignment(clear1, Alignment.MIDDLE_RIGHT); clear1.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { highTextArea.clear(); } }); VerticalLayout clear2 = new VerticalLayout(); hlo2.addComponent(clear2); clear2.setDescription("Clear field"); clear2.setStyleName("clearfieldbtn"); clear2.setWidth("20px"); clear2.setHeight("20px"); clear2.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { stableTextArea.clear(); } }); hlo2.setComponentAlignment(clear2, Alignment.MIDDLE_RIGHT); VerticalLayout clear3 = new VerticalLayout(); hlo3.addComponent(clear3); clear3.setDescription("Clear field"); clear3.setStyleName("clearfieldbtn"); clear3.setWidth("20px"); clear3.setHeight("20px"); clear3.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { lowTextArea.clear(); } }); hlo3.setComponentAlignment(clear3, Alignment.MIDDLE_RIGHT); Label errorLabel = new Label(); proteinsDataCapturingMainLayout.addComponent(errorLabel); HorizontalLayout btnsLayout = new HorizontalLayout(); btnsLayout.setSpacing(true); btnsLayout.setMargin(new MarginInfo(true, false, false, false)); proteinsDataCapturingMainLayout.addComponent(btnsLayout); proteinsDataCapturingMainLayout.setComponentAlignment(btnsLayout, Alignment.MIDDLE_RIGHT); Button sampleBtn = new Button("Sample"); sampleBtn.setStyleName(Reindeer.BUTTON_SMALL); btnsLayout.addComponent(sampleBtn); sampleBtn.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { reset(); highTextArea.setValue(highAcc); lowTextArea.setValue(lowAcc); stableTextArea.setValue(stableAcc); diseaseGroupsListA.select("Group A"); diseaseGroupsListB.select("Group B"); compareBtn.focus(); } }); Button resetBtn = new Button("Reset"); resetBtn.setStyleName(Reindeer.BUTTON_SMALL); btnsLayout.addComponent(resetBtn); resetBtn.setId("resetBtn"); resetBtn.addClickListener(this); compareBtn = new Button("Compare"); compareBtn.setStyleName(Reindeer.BUTTON_SMALL); btnsLayout.addComponent(compareBtn); compareBtn.setId("compareBtn"); compareBtn.addClickListener(this); // highTextArea.setValue(highAcc); // lowTextArea.setValue(lowAcc); // stableTextArea.setValue(stableAcc); return proteinsDataCapturingMainLayout; }
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.ComparisonsSelectionOverviewBubbleChart.java
public ComparisonsSelectionOverviewBubbleChart(final QuantCentralManager Quant_Central_Manager, final CSFPRHandler CSFPR_Handler, int chartWidth, int chartHeight, Set<QuantDiseaseGroupsComparison> selectedComparisonList, List<QuantProtein> searchQuantificationProtList) { userDataCounter = 0;/*w ww. j av a2s . c om*/ this.searchQuantificationProtList = searchQuantificationProtList; Map<String, String> diseaseHashedColorMap = Quant_Central_Manager.getDiseaseHashedColorMap(); for (String str : diseaseHashedColorMap.keySet()) { diseaseColorMap.put(str, Color.decode(diseaseHashedColorMap.get(str))); } this.width = chartWidth; this.height = 600; this.CSFPR_Handler = CSFPR_Handler; this.setWidth(width + "px"); this.setHeightUndefined(); this.Quant_Central_Manager = Quant_Central_Manager; this.Quant_Central_Manager.registerStudySelectionListener(ComparisonsSelectionOverviewBubbleChart.this); this.setSpacing(true); //init toplayout topLayout.setHeight(30 + "px"); topLayout.setSpacing(true); topLayout.setMargin(new MarginInfo(false, false, true, false)); this.addComponent(topLayout); Label overviewLabel = new Label("<font style='margin-left :50px;'>Overview</font> "); overviewLabel.setContentMode(ContentMode.HTML); topLayout.addComponent(overviewLabel); overviewLabel.setStyleName("subtitle"); overviewLabel.setWidth("120px"); InfoPopupBtn info = new InfoPopupBtn( "The bubble chart give an overview for the proteins existed in the selected comparisons.<br/>The diameter of the bubble represents the number of the proteins in the selected comparison and the color represents the trend<br/>"); info.setWidth("16px"); info.setHeight("16px"); topLayout.addComponent(info); this.topLayout.setVisible(false); //end of toplayout //init chartlayout this.chartLayoutContainer.setVisible(false); this.addComponent(chartLayoutContainer); chartLayoutContainer.setWidth(width + "px"); chartLayoutContainer.setHeight(height + "px"); chartLayoutContainer.addComponent(chartImage, "left: " + 0 + "px; top: " + 0 + "px;"); chartLayoutContainer.addComponent(chartLayout, "left: " + 0 + "px; top: " + 0 + "px;"); chartLayout.setWidth(width + "px"); chartLayout.setHeight(height + "px"); chartLayout.addLayoutClickListener(ComparisonsSelectionOverviewBubbleChart.this); //end of chartlayout //init bottomlayout bottomLayout.setWidth("100%"); this.addComponent(bottomLayout); this.setComponentAlignment(bottomLayout, Alignment.BOTTOM_RIGHT); bottomLayout.setVisible(false); HorizontalLayout btnContainerLayout = new HorizontalLayout(); btnContainerLayout.setSpacing(true); // btnContainerLayout.setMargin(new MarginInfo(false, false, false, false)); btnContainerLayout.setWidthUndefined(); btnContainerLayout.setHeightUndefined(); // btnContainerLayout.addStyleName("leftspacer"); bottomLayout.addComponent(btnContainerLayout); bottomLayout.setComponentAlignment(btnContainerLayout, Alignment.TOP_RIGHT); TrendLegend legendLayout = new TrendLegend("bubblechart"); legendLayout.setWidthUndefined(); legendLayout.setHeight("24px"); btnContainerLayout.addComponent(legendLayout); btnContainerLayout.setComponentAlignment(legendLayout, Alignment.TOP_RIGHT); // btnContainerLayout.setExpandRatio(legendLayout, 600); // btnContainerLayout.setExpandRatio(btnContainerLayout, 210); // VerticalLayout stableBtnWrapper = new VerticalLayout(); //// stableBtnWrapper.setWidth("64px"); // HorizontalLayout stableBtn = new HorizontalLayout(); // stableBtnWrapper.addComponent(stableBtn); // stableBtnWrapper.setComponentAlignment(stableBtn, Alignment.TOP_LEFT); // btnContainerLayout.addComponent(stableBtnWrapper); groupSwichBtn = new GroupSwichBtn(Quant_Central_Manager, searchQuantificationProtList); btnContainerLayout.addComponent(groupSwichBtn); final VerticalLayout appliedIcon = new VerticalLayout(); appliedIcon.setStyleName("appliedicon"); appliedIcon.setWidth("24px"); appliedIcon.setHeight("24px"); appliedIcon.setDescription("Hide stable proteins"); btnContainerLayout.addComponent(appliedIcon); // stableBtn.setStyleName("stablebtn"); // stableBtn.setHeight("24px"); // Label stableLabel = new Label("Equal"); // stableLabel.setWidth("44px"); // stableBtn.addComponent(stableLabel); appliedIcon.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { if (appliedIcon.getStyleName().equalsIgnoreCase("appliedicon")) { appliedIcon.setStyleName("unappliedicon"); Quant_Central_Manager.updateSignificantOnlySelection(true); appliedIcon.setDescription("Show stable proteins"); } else { appliedIcon.setStyleName("appliedicon"); Quant_Central_Manager.updateSignificantOnlySelection(false); appliedIcon.setDescription("Hide stable proteins"); } } }); exportPdfBtn = new Button(""); exportPdfBtn.setWidth("24px"); exportPdfBtn.setHeight("24px"); exportPdfBtn.setPrimaryStyleName("exportpdfbtn"); exportPdfBtn.setDescription("Export chart image"); StreamResource myResource = createResource(); FileDownloader fileDownloader = new FileDownloader(myResource); fileDownloader.extend(exportPdfBtn); btnContainerLayout.addComponent(exportPdfBtn); VerticalLayout unselectAllBtn = new VerticalLayout(); unselectAllBtn.setStyleName("unselectallbtn"); btnContainerLayout.addComponent(unselectAllBtn); btnContainerLayout.setComponentAlignment(unselectAllBtn, Alignment.TOP_LEFT); unselectAllBtn.setDescription("Clear selection"); unselectAllBtn.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { Quant_Central_Manager.setBubbleChartQuantProteinsSelection(new HashSet<String>(), ""); resetChart(); } }); final VerticalLayout selectMultiBtn = new VerticalLayout(); selectMultiBtn.setStyleName("selectmultiselectedbtn"); btnContainerLayout.addComponent(selectMultiBtn); btnContainerLayout.setComponentAlignment(selectMultiBtn, Alignment.TOP_LEFT); selectMultiBtn.setDescription("Multiple selection"); activeMultiSelect = true; selectMultiBtn.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { if (selectMultiBtn.getStyleName().equalsIgnoreCase("selectmultiselectedbtn")) { selectMultiBtn.setStyleName("selectmultibtn"); activeMultiSelect = false; } else { selectMultiBtn.setStyleName("selectmultiselectedbtn"); activeMultiSelect = true; } } }); //end of btns layout //init empty layout emptySelectionLayout = new VerticalLayout(); this.addComponent(emptySelectionLayout); emptySelectionLayout.setWidth(100 + "%"); emptySelectionLayout.setHeightUndefined(); VerticalLayout spacer = new VerticalLayout(); spacer.setHeight("100px"); spacer.setWidth("10px"); spacer.setStyleName(Reindeer.LAYOUT_WHITE); emptySelectionLayout.addComponent(spacer); emptySelectionLayout.setComponentAlignment(spacer, Alignment.BOTTOM_RIGHT); Label startLabel = new Label( "<center><h2 style='color:gray;'><b>Select comparison from the table</b></h2></center>"); startLabel.setContentMode(ContentMode.HTML); emptySelectionLayout.addComponent(startLabel); emptySelectionLayout.setComponentAlignment(startLabel, Alignment.MIDDLE_CENTER); Image handleft = new Image(); handleft.setSource(new ThemeResource("img/handleft.png")); emptySelectionLayout.addComponent(handleft); emptySelectionLayout.setComponentAlignment(handleft, Alignment.MIDDLE_CENTER); //init bubble chart }
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.ComparisonsSelectionOverviewBubbleChart.java
public ComparisonsSelectionOverviewBubbleChart(final QuantCentralManager Quant_Central_Manager, final CSFPRHandler CSFPR_Handler, int chartWidth, int chartHeight, Set<QuantDiseaseGroupsComparison> selectedComparisonList, List<QuantProtein> searchQuantificationProtList, QuantDiseaseGroupsComparison userCustomizedComparison) { this.userCustomizedComparison = userCustomizedComparison; userDataCounter = 1;// w ww . j a v a2s . co m this.searchQuantificationProtList = searchQuantificationProtList; Map<String, String> diseaseHashedColorMap = Quant_Central_Manager.getDiseaseHashedColorMap(); for (String str : diseaseHashedColorMap.keySet()) { diseaseColorMap.put(str, Color.decode(diseaseHashedColorMap.get(str))); } this.width = chartWidth; this.height = 600; this.CSFPR_Handler = CSFPR_Handler; this.setWidth(width + "px"); this.setHeightUndefined(); this.Quant_Central_Manager = Quant_Central_Manager; this.Quant_Central_Manager.registerStudySelectionListener(ComparisonsSelectionOverviewBubbleChart.this); this.setSpacing(true); //init toplayout topLayout.setHeight(30 + "px"); topLayout.setSpacing(true); topLayout.setMargin(new MarginInfo(false, false, true, false)); this.addComponent(topLayout); Label overviewLabel = new Label("<font style='margin-left :50px;'>Overview</font> "); overviewLabel.setContentMode(ContentMode.HTML); topLayout.addComponent(overviewLabel); overviewLabel.setStyleName("subtitle"); overviewLabel.setWidth("120px"); InfoPopupBtn info = new InfoPopupBtn( "The bubble chart give an overview for the proteins existed in the selected comparisons.<br/>The diameter of the bubble represents the number of the proteins in the selected comparison and the color represents the trend<br/>"); info.setWidth("16px"); info.setHeight("16px"); topLayout.addComponent(info); //end of toplayout //init chartlayout this.chartLayoutContainer.setVisible(false); this.addComponent(chartLayoutContainer); this.addComponent(chartLayoutContainer); chartLayoutContainer.setWidth(width + "px"); chartLayoutContainer.setHeight(height + "px"); chartLayoutContainer.addComponent(chartImage, "left: " + 0 + "px; top: " + 0 + "px;"); chartLayoutContainer.addComponent(chartLayout, "left: " + 0 + "px; top: " + 0 + "px;"); chartLayout.setWidth(width + "px"); chartLayout.setHeight(height + "px"); chartLayout.addLayoutClickListener(ComparisonsSelectionOverviewBubbleChart.this); //end of chartlayout //init bottomlayout bottomLayout.setWidth("100%"); this.addComponent(bottomLayout); this.setComponentAlignment(bottomLayout, Alignment.BOTTOM_RIGHT); bottomLayout.setVisible(false); HorizontalLayout btnContainerLayout = new HorizontalLayout(); btnContainerLayout.setSpacing(true); // btnContainerLayout.setMargin(new MarginInfo(false, false, false, false)); btnContainerLayout.setWidthUndefined(); btnContainerLayout.setHeightUndefined(); // btnContainerLayout.addStyleName("leftspacer"); bottomLayout.addComponent(btnContainerLayout); bottomLayout.setComponentAlignment(btnContainerLayout, Alignment.TOP_RIGHT); TrendLegend legendLayout = new TrendLegend("bubblechart"); legendLayout.setWidthUndefined(); legendLayout.setHeight("24px"); btnContainerLayout.addComponent(legendLayout); btnContainerLayout.setComponentAlignment(legendLayout, Alignment.TOP_RIGHT); Quant_Central_Manager.insertNoftfication("Quantitative Datasets", "Remeber you can flip the disease group comparisons using (Swich disease groups button)<img src='VAADIN/themes/dario-theme/img/flip-v-updated.png' height='25px' width='25' alt='Reorder and select' Align='center'/> ", width, width, "flipnotification"); // btnContainerLayout.setExpandRatio(legendLayout, 600); // btnContainerLayout.setExpandRatio(btnContainerLayout, 210); // VerticalLayout stableBtnWrapper = new VerticalLayout(); //// stableBtnWrapper.setWidth("64px"); // HorizontalLayout stableBtn = new HorizontalLayout(); // stableBtnWrapper.addComponent(stableBtn); // stableBtnWrapper.setComponentAlignment(stableBtn, Alignment.TOP_LEFT); // btnContainerLayout.addComponent(stableBtnWrapper); groupSwichBtn = new GroupSwichBtn(Quant_Central_Manager, searchQuantificationProtList); btnContainerLayout.addComponent(groupSwichBtn); final VerticalLayout appliedIcon = new VerticalLayout(); appliedIcon.setStyleName("appliedicon"); appliedIcon.setWidth("24px"); appliedIcon.setHeight("24px"); appliedIcon.setDescription("Hide stable proteins"); btnContainerLayout.addComponent(appliedIcon); // stableBtn.setStyleName("stablebtn"); // stableBtn.setHeight("24px"); // Label stableLabel = new Label("Equal"); // stableLabel.setWidth("44px"); // stableBtn.addComponent(stableLabel); appliedIcon.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { if (appliedIcon.getStyleName().equalsIgnoreCase("appliedicon")) { appliedIcon.setStyleName("unappliedicon"); Quant_Central_Manager.updateSignificantOnlySelection(true); appliedIcon.setDescription("Show stable proteins"); } else { appliedIcon.setStyleName("appliedicon"); Quant_Central_Manager.updateSignificantOnlySelection(false); appliedIcon.setDescription("Hide stable proteins"); } } }); exportPdfBtn = new Button(""); exportPdfBtn.setWidth("24px"); exportPdfBtn.setHeight("24px"); exportPdfBtn.setPrimaryStyleName("exportpdfbtn"); exportPdfBtn.setDescription("Export chart image"); StreamResource myResource = createResource(); FileDownloader fileDownloader = new FileDownloader(myResource); fileDownloader.extend(exportPdfBtn); btnContainerLayout.addComponent(exportPdfBtn); VerticalLayout unselectAllBtn = new VerticalLayout(); unselectAllBtn.setStyleName("unselectallbtn"); btnContainerLayout.addComponent(unselectAllBtn); btnContainerLayout.setComponentAlignment(unselectAllBtn, Alignment.TOP_LEFT); unselectAllBtn.setDescription("Clear selection"); unselectAllBtn.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { Quant_Central_Manager.setBubbleChartQuantProteinsSelection(new HashSet<String>(), ""); resetChart(); } }); final VerticalLayout selectMultiBtn = new VerticalLayout(); selectMultiBtn.setStyleName("selectmultiselectedbtn"); btnContainerLayout.addComponent(selectMultiBtn); btnContainerLayout.setComponentAlignment(selectMultiBtn, Alignment.TOP_LEFT); selectMultiBtn.setDescription("Multiple selection"); activeMultiSelect = true; selectMultiBtn.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { if (selectMultiBtn.getStyleName().equalsIgnoreCase("selectmultiselectedbtn")) { selectMultiBtn.setStyleName("selectmultibtn"); activeMultiSelect = false; } else { selectMultiBtn.setStyleName("selectmultiselectedbtn"); activeMultiSelect = true; } } }); //end of btns layout //init empty layout emptySelectionLayout = new VerticalLayout(); this.addComponent(emptySelectionLayout); emptySelectionLayout.setWidth(width + "px"); emptySelectionLayout.setHeightUndefined(); VerticalLayout spacer = new VerticalLayout(); spacer.setHeight("100px"); spacer.setWidth("10px"); spacer.setStyleName(Reindeer.LAYOUT_WHITE); emptySelectionLayout.addComponent(spacer); emptySelectionLayout.setComponentAlignment(spacer, Alignment.BOTTOM_RIGHT); Label startLabel = new Label( "<center><h2 style='color:gray;'><b>Select comparison from the table</b></h2></center>"); startLabel.setContentMode(ContentMode.HTML); emptySelectionLayout.addComponent(startLabel); emptySelectionLayout.setComponentAlignment(startLabel, Alignment.MIDDLE_CENTER); Image handleft = new Image(); handleft.setSource(new ThemeResource("img/handleft.png")); emptySelectionLayout.addComponent(handleft); emptySelectionLayout.setComponentAlignment(handleft, Alignment.MIDDLE_CENTER); }
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.GroupSwichBtn.java
private VerticalLayout swichIconGenerator() { VerticalLayout switchBtn = new VerticalLayout(); switchBtn.setStyleName("switchbtn"); switchBtn.setWidth("50px"); switchBtn.setHeight("25px"); return switchBtn; }