List of usage examples for com.vaadin.ui Alignment BOTTOM_RIGHT
Alignment BOTTOM_RIGHT
To view the source code for com.vaadin.ui Alignment BOTTOM_RIGHT.
Click Source Link
From source file:org.universAAL.ucc.windows.LicenceWindow.java
public LicenceWindow(UccUI app, ArrayList<License> licenses, AALService aal, UAPP installApp) throws IOException { res = ResourceBundle.getBundle(base); setCaption(res.getString("license.capt")); this.app = app; this.installingApplication = installApp; modus = Arrays.asList(new String[] { res.getString("agree.radio"), res.getString("dontAgree.radio") }); vl = new VerticalLayout(); vl.setSizeFull();/*from w w w . ja v a 2 s .com*/ vl.setSpacing(true); vl.setMargin(true); hp = new HorizontalSplitPanel(); hp.setSplitPosition(150, Sizeable.UNITS_PIXELS); hp.setStyleName(Reindeer.SPLITPANEL_SMALL); hp.setLocked(true); hp.setSizeFull(); tree = new Tree(); tree.setImmediate(true); tree.setNullSelectionAllowed(true); tree.setNewItemsAllowed(false); for (License l : licenses) { tree.addItem(l.getAppName()); tree.setChildrenAllowed(l.getAppName(), true); tree.expandItemsRecursively(l.getAppName()); for (File f : l.getLicense()) { tree.addItem(f.getName()); tree.setParent(f.getName(), l.getAppName()); tree.setChildrenAllowed(f.getName(), false); } } if (licenses.size() > 0) { tree.select(licenses.get(0).getLicense().get(0).getName()); } Panel panel = new Panel(); panel.setHeight("400px"); VerticalLayout layout = (VerticalLayout) panel.getContent(); layout.setSpacing(true); layout.setMargin(true); for (License l : licenses) { if (l.getSlaList().size() > 0) { for (File slaFile : l.getSlaList()) { FileReader fr = new FileReader(slaFile); // SLA makes problems BufferedReader reader = new BufferedReader(fr); String line = null; while ((line = reader.readLine()) != null) { panel.addComponent(new Label(line)); } } } else if (l.getLicense().size() > 0) { for (File lFile : l.getLicense()) { FileReader fr = new FileReader(lFile); BufferedReader reader = new BufferedReader(fr); String line = null; while ((line = reader.readLine()) != null) { panel.addComponent(new Label(line)); } } } } hp.setFirstComponent(tree); vl.addComponent(panel); setContent(hp); op = new OptionGroup("", modus); op.setNullSelectionAllowed(false); op.select(res.getString("dontAgree.radio")); op.setImmediate(true); vl.addComponent(op); HorizontalLayout hl = new HorizontalLayout(); hl.setSpacing(true); hl.setMargin(true); cancel = new Button(res.getString("cancel.button")); go = new Button(res.getString("finish.button")); go.setEnabled(false); hl.addComponent(cancel); hl.addComponent(go); vl.addComponent(hl); vl.setComponentAlignment(hl, Alignment.BOTTOM_RIGHT); setWidth("700px"); setHeight("600px"); setModal(true); center(); hp.setSecondComponent(vl); setClosable(false); lic = new LicenseController(app, this, licenses, aal, installingApplication); tree.addListener(lic); op.addListener(lic); }
From source file:org.universAAL.ucc.windows.LicenceWindow.java
public void createSecondComponent(Panel p) { modus = Arrays.asList(new String[] { res.getString("agree.radio"), res.getString("dontAgree.radio") }); vl = new VerticalLayout(); vl.setSizeFull();/*from w w w . ja v a2s .co m*/ vl.setSpacing(true); vl.setMargin(true); p.setHeight("400px"); VerticalLayout layout = (VerticalLayout) p.getContent(); layout.setSpacing(true); layout.setMargin(true); vl.addComponent(p); op = new OptionGroup("", modus); op.setNullSelectionAllowed(false); op.select(res.getString("dontAgree.radio")); op.setImmediate(true); vl.addComponent(op); HorizontalLayout hl = new HorizontalLayout(); hl.setSpacing(true); hl.setMargin(true); cancel = new Button(res.getString("cancel.button")); go = new Button(res.getString("finish.button")); cancel.addListener((Button.ClickListener) lic); go.addListener((Button.ClickListener) lic); go.setEnabled(false); hl.addComponent(cancel); hl.addComponent(go); vl.addComponent(hl); vl.setComponentAlignment(hl, Alignment.BOTTOM_RIGHT); op.addListener(lic); hp.setSecondComponent(vl); }
From source file:org.vaadin.addons.serverpush.samples.chat.ChatLayout.java
License:Apache License
public ChatLayout(final User user, final User from) { setSizeFull();// ww w . jav a 2s. co m Table table = new Table(); table.setSizeFull(); table.setContainerDataSource(new MessageContainer(user, from)); table.addListener(new Container.ItemSetChangeListener() { public void containerItemSetChange(Container.ItemSetChangeEvent event) { ((Pushable) getApplication()).push(); } }); table.setVisibleColumns(new String[] { "from", "to", "received", "message" }); addComponent(table); HorizontalLayout hl = new HorizontalLayout(); hl.setWidth("100%"); final TextArea textArea = new TextArea(); textArea.setRows(5); textArea.setSizeFull(); textArea.setWordwrap(true); textArea.setValue(""); hl.addComponent(textArea); Button sendButton = new Button("Send"); sendButton.setWidth("120px"); sendButton.setImmediate(true); sendButton.addListener(new Button.ClickListener() { public void buttonClick(Button.ClickEvent event) { Message msg = new Message(); msg.setFrom(from); msg.setTo(user); msg.setMessage(textArea.getValue().toString()); MessageManager.getInstance().addMessage(msg); textArea.setValue(""); } }); hl.addComponent(sendButton); hl.setComponentAlignment(sendButton, Alignment.BOTTOM_RIGHT); hl.setExpandRatio(textArea, 1); addComponent(hl); setExpandRatio(table, 1); }
From source file:org.vaadin.overlay.sample.OverlaySampleApplication.java
License:Apache License
@Override protected void init(VaadinRequest request) { VerticalLayout layout = new VerticalLayout(); final Label label = new Label("Alignment.TOP_LEFT"); layout.addComponent(label);//from w ww. ja va 2 s.c om for (int i = 0; i < 20; i++) { Button button = new Button("Sample Button"); layout.addComponent(button); final ImageOverlay io = new ImageOverlay(button); Resource res = new ClassResource(this.getClass(), "../icon-new.png"); io.setImage(res); io.setComponentAnchor(Alignment.TOP_LEFT); // Top left of the button io.setOverlayAnchor(Alignment.MIDDLE_CENTER); // Center of the image io.setClickListener(new OverlayClickListener() { public void overlayClicked(CustomClickableOverlay overlay) { Notification.show("ImageOverlay Clicked!"); } }); layout.addComponent(io); io.setEnabled(true); final TextOverlay to = new TextOverlay(button, "New!"); to.setComponentAnchor(Alignment.MIDDLE_RIGHT); // Top right of the button to.setOverlayAnchor(Alignment.MIDDLE_CENTER); // Center of the image to.setClickListener(new OverlayClickListener() { public void overlayClicked(CustomClickableOverlay overlay) { Notification.show("TextOverlay Clicked!"); } }); layout.addComponent(to); button.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { Alignment a = io.getComponentAnchor(); String s = ""; if (Alignment.TOP_LEFT.equals(a)) { a = Alignment.TOP_CENTER; s = "TOP_CENTER"; } else if (Alignment.TOP_CENTER.equals(a)) { a = Alignment.TOP_RIGHT; s = "TOP_RIGHT"; } else if (Alignment.TOP_RIGHT.equals(a)) { a = Alignment.MIDDLE_RIGHT; s = "MIDDLE_RIGHT"; } else if (Alignment.MIDDLE_RIGHT.equals(a)) { a = Alignment.BOTTOM_RIGHT; s = "BOTTOM_RIGHT"; } else if (Alignment.BOTTOM_RIGHT.equals(a)) { a = Alignment.BOTTOM_CENTER; s = "BOTTOM_CENTER"; } else if (Alignment.BOTTOM_CENTER.equals(a)) { a = Alignment.BOTTOM_LEFT; s = "BOTTOM_LEFT"; } else if (Alignment.BOTTOM_LEFT.equals(a)) { a = Alignment.MIDDLE_LEFT; s = "MIDDLE_LEFT"; } else if (Alignment.MIDDLE_LEFT.equals(a)) { a = Alignment.TOP_LEFT; s = "TOP_LEFT"; } io.setComponentAnchor(a); label.setValue("Alignment." + s); } }); } setContent(layout); }
From source file:org.vaadin.tori.view.listing.category.EditCategoryForm.java
License:Apache License
public EditCategoryForm(final EditCategoryListener listener, final CategoryData categoryToEdit) { this.categoryToEdit = categoryToEdit; setData(categoryToEdit);/*from w ww .j av a2s.c o m*/ final VerticalLayout newCategoryLayout = new VerticalLayout(); newCategoryLayout.setSpacing(true); newCategoryLayout.setMargin(true); newCategoryLayout.setWidth("100%"); nameField = new TextField(); nameField.setInputPrompt("Category name"); nameField.setWidth("100%"); if (categoryToEdit != null) { nameField.setValue(categoryToEdit.getName()); } newCategoryLayout.addComponent(nameField); descriptionField = new TextArea(); descriptionField.setInputPrompt("Description"); descriptionField.setRows(3); descriptionField.setWidth("100%"); if (categoryToEdit != null) { descriptionField.setValue(categoryToEdit.getDescription()); } newCategoryLayout.addComponent(descriptionField); final Button saveButton = new Button((categoryToEdit == null ? "Create Category" : "Save"), new Button.ClickListener() { @Override public void buttonClick(final ClickEvent event) { listener.commit(nameField.getValue(), descriptionField.getValue()); resetForm(); } }); final Button cancelButton = ComponentUtil.getSecondaryButton(("Cancel"), new Button.ClickListener() { @Override public void buttonClick(final ClickEvent event) { listener.cancel(); resetForm(); } }); HorizontalLayout buttonsLayout = new HorizontalLayout(cancelButton, saveButton); buttonsLayout.setWidth(100.0f, Unit.PERCENTAGE); buttonsLayout.setSpacing(true); buttonsLayout.setExpandRatio(cancelButton, 1.0f); buttonsLayout.setComponentAlignment(cancelButton, Alignment.BOTTOM_RIGHT); newCategoryLayout.addComponent(buttonsLayout); setWidth("300px"); setCompositionRoot(newCategoryLayout); }
From source file:org.vaadin.tori.view.thread.ReportComponent.java
License:Apache License
private Component newReportLayout() { final VerticalLayout layout = new VerticalLayout(); layout.setWidth("260px"); layout.setSpacing(true);/*from ww w .j av a 2s . c o m*/ layout.setMargin(true); layout.addComponent(new Label("What's wrong with this post?")); final OptionGroup reason = new OptionGroup(); reason.addItem(Reason.SPAM); reason.setItemCaption(Reason.SPAM, "Spam"); reason.addItem(Reason.OFFENSIVE); reason.setItemCaption(Reason.OFFENSIVE, "Offensive, abusive or hateful."); reason.addItem(Reason.WRONG_CATEGORY); reason.setItemCaption(Reason.WRONG_CATEGORY, "Doesn't belong in the category."); reason.addItem(Reason.MODERATOR_ALERT); reason.setItemCaption(Reason.MODERATOR_ALERT, "A moderator should take a look at it."); reason.setImmediate(true); reason.addValueChangeListener(new OptionGroup.ValueChangeListener() { @Override public void valueChange(final ValueChangeEvent event) { explanationLayout.setVisible(reason.getValue() == Reason.MODERATOR_ALERT); reportButton.setEnabled(reason.getValue() != null); } }); layout.addComponent(reason); explanationLayout = new CssLayout(); explanationLayout.setStyleName("explanationlayout"); explanationLayout.addComponent(new Label("Here's why:")); final TextArea reasonText = createReasonTextArea(); explanationLayout.addComponent(reasonText); explanationLayout.setVisible(false); explanationLayout.setWidth("100%"); layout.addComponent(explanationLayout); final HorizontalLayout footer = new HorizontalLayout(); footer.setSpacing(true); layout.addComponent(footer); layout.setComponentAlignment(footer, Alignment.BOTTOM_RIGHT); reportButton = new Button("Report Post"); reportButton.addClickListener(new NativeButton.ClickListener() { @Override public void buttonClick(final ClickEvent event) { final URI l = Page.getCurrent().getLocation(); final String link = l.getScheme() + "://" + l.getAuthority() + l.getPath() + postPermalink; presenter.handlePostReport(post, (Reason) reason.getValue(), reasonText.getValue(), link); reportPopup.setPopupVisible(false); } }); reportButton.setEnabled(false); footer.addComponent(reportButton); final Button cancel = ComponentUtil.getSecondaryButton("Cancel", new Button.ClickListener() { @Override public void buttonClick(final ClickEvent event) { reportPopup.setPopupVisible(false); } }); footer.addComponent(cancel); return layout; }
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;//from w ww . ja v a2 s . c o 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); 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;//from ww w .ja v a 2 s. c o 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.core.PopupInfoBtn.java
public PopupInfoBtn(VerticalLayout pupupLayout, String btnName, String publicationAuthor) { this.addLayoutClickListener(PopupInfoBtn.this); this.setHeight("80px"); this.setWidth("200px"); Label btnLabel = new Label(btnName); btnLabel.setContentMode(ContentMode.HTML); this.addComponent(btnLabel); this.setComponentAlignment(btnLabel, Alignment.MIDDLE_CENTER); this.setStyleName("tabbtn"); //add popup for testing VerticalLayout infoPopup = initPopupLayout(pupupLayout, publicationAuthor); pupupPanel = new PopupView(null, infoPopup); pupupPanel.setWidth("2px"); pupupPanel.setHeight("2px"); this.addComponent(pupupPanel); this.setComponentAlignment(pupupPanel, Alignment.BOTTOM_RIGHT); pupupPanel.setVisible(true);/*from www . ja va 2 s . co m*/ pupupPanel.setPopupVisible(false); pupupPanel.setHideOnMouseOut(false); this.setExpandRatio(btnLabel, 0.99f); this.setExpandRatio(pupupPanel, 0.01f); }
From source file:pt.ist.vaadinframework.ui.PaginatedSorterViewer.java
License:Open Source License
public void setPagination(int pageLength) { setPagination(pageLength, Alignment.BOTTOM_LEFT, Alignment.BOTTOM_RIGHT); }