List of usage examples for com.vaadin.ui HorizontalLayout setSizeFull
@Override public void setSizeFull()
From source file:uicomponents.BarcodePreviewComponent.java
License:Open Source License
public BarcodePreviewComponent(SampleToBarcodeFieldTranslator translator) { this.translator = translator; setSpacing(true);//w ww . j ava2 s.c o m setMargin(true); Resource res = new ThemeResource("img/qrtest.png"); Image qr = new Image(null, res); qr.setHeight("140px"); qr.setWidth("140px"); Image qr2 = new Image(null, res); qr2.setHeight("140px"); qr2.setWidth("140px"); code = new TextField(); info1 = new TextField(); info2 = new TextField(); codedName = new OptionGroup("Put ID on sticker:"); codedName.addItems(Arrays.asList("QBiC ID", "Lab ID", "Secondary Name")); codedName.setImmediate(true); codedName.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL); codedName.select("QBiC ID"); code.addStyleName(ValoTheme.TEXTFIELD_BORDERLESS); code.setWidth("200px"); code.addStyleName("barcode-large"); styleInfoField(info1); styleInfoField(info2); styleInfoField(qbicInfo); VerticalLayout box = new VerticalLayout(); box.setHeight("110px"); box.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP); box.addComponent(code); box.addComponent(info1); box.addComponent(info2); box.addComponent(qbicInfo); box.setWidth("190px"); HorizontalLayout test = new HorizontalLayout(); test.setSizeFull(); test.addComponent(qr); test.addComponent(box); test.addComponent(qr2); setFieldsReadOnly(true); List<String> options = new ArrayList<String>(Arrays.asList("Tissue/Extr. Material", "Secondary Name", "QBiC ID", "Lab ID", "MHC Type", "Used Antibody")); select1 = new ComboBox("First Info", options); select1.setStyleName(Styles.boxTheme); select1.setImmediate(true); select1.select("Tissue/Extr. Material"); select2 = new ComboBox("Second Info", options); select2.select("Secondary Name"); select2.setImmediate(true); select2.setStyleName(Styles.boxTheme); ValueChangeListener vc = new ValueChangeListener() { /** * */ private static final long serialVersionUID = -7466519211904860012L; @Override public void valueChange(ValueChangeEvent event) { refresh(); } }; codedName.addValueChangeListener(vc); select1.addValueChangeListener(vc); select2.addValueChangeListener(vc); HorizontalLayout designBox = new HorizontalLayout(); designBox.addComponent(select1); designBox.addComponent(select2); designBox.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING); designBox.setSpacing(true); VerticalLayout previewBox = new VerticalLayout(); previewBox.setStyleName(ValoTheme.LAYOUT_CARD); previewBox.setCaption("Barcode Example"); previewBox.addComponent(test); addComponent(previewBox); addComponent(codedName); addComponent(designBox); // overwrite = new CheckBox("Overwrite existing Tube Barcode Files"); // addComponent(ProjectwizardUI.questionize(overwrite, // "Overwrites existing files of barcode stickers. This is useful when " // + "the design was changed after creating them.", "Overwrite Sticker Files")); }
From source file:uk.co.intec.keyDatesApp.components.HeaderComponent.java
License:Apache License
/** * Constructor, passing the Vaadin application page * * @param ui//w ww.j ava2 s . c o m * MainUI application page */ public HeaderComponent(MainUI ui) { setHeight("50px"); setStyleName("header"); final HorizontalLayout bannerArea = new HorizontalLayout(); bannerArea.setStyleName("menuArea"); bannerArea.setSizeFull(); final ThemeResource resource = new ThemeResource("img/intec-logo.gif.png"); final Image bannerImg = new Image(); bannerImg.setAlternateText("Intec"); bannerImg.setHeight("50px"); bannerImg.setDescription("Intec Logo"); bannerImg.setSource(resource); bannerImg.setWidth(null); bannerImg.setStyleName("bannerImg"); setMenubar(new MenuBar()); getMenubar().setStyleName(ValoTheme.MENU_SUBTITLE); getMenubar().addStyleName("valo-menu-subtitle-indent"); getMenubar().setWidth(100, Unit.PERCENTAGE); if (!"Anonymous".equals(getUserName())) { final MenuItem logout = menubar.addItem("Logout", null); logout.setStyleName("menuRight"); } final MenuItem userItem = menubar.addItem(getUserName(), null); userItem.setStyleName("menuRight"); bannerArea.addComponents(bannerImg, menubar); bannerArea.setExpandRatio(menubar, 1); addComponent(bannerArea); setExpandRatio(bannerArea, 1); setSizeFull(); }
From source file:VaadinIRC.GUI.channelGUI.java
License:Open Source License
/** * Creates the GUI for a channel.//from w w w . j a v a 2s .com */ public void createChannelGUI() { panel = new Panel(); panel.setCaption(channelName); panel.setSizeFull(); panel.getContent().setSizeFull(); AbstractLayout panelLayout = (AbstractLayout) panel.getContent(); panelLayout.setMargin(false); panel.setImmediate(true); labelTitle.setValue("<b>" + channelName + "</b>"); VerticalLayout mainVerticalLayout = new VerticalLayout(); mainVerticalLayout.setSizeFull(); // Top bar containing channel title & topright buttons GridLayout topGrid = new GridLayout(2, 1); topGrid.setStyleName("topBar"); topGrid.addComponent(labelTitle); topGrid.setSizeFull(); labelTitle.setSizeFull(); HorizontalLayout hori = new HorizontalLayout(); hori.setStyleName("rightTopBar"); hori.setWidth(100, Sizeable.UNITS_PIXELS); hori.addComponent(buttonSettings); hori.addComponent(buttonChangeNick); hori.addComponent(buttonRefreshUsernames); topGrid.addComponent(hori); topGrid.setComponentAlignment(hori, Alignment.TOP_RIGHT); mainVerticalLayout.addComponent(topGrid); mainVerticalLayout.setExpandRatio(topGrid, 0.05f); // Message area & table of nicknames HorizontalLayout horizontal = new HorizontalLayout(); horizontal.setSpacing(false); horizontal.setMargin(false); horizontal.setSizeFull(); horizontal.addComponent(panelMessages); mainVerticalLayout.addComponent(horizontal); mainVerticalLayout.setExpandRatio(horizontal, 0.90f); if (channelName.startsWith("#")) { horizontal.addComponent(tableNicknames); horizontal.setExpandRatio(panelMessages, 0.8f); horizontal.setExpandRatio(tableNicknames, 0.2f); } // Send message textfield & send button HorizontalLayout bottomBar = new HorizontalLayout(); //bottomBar.setWidth(100, Sizeable.UNITS_PERCENTAGE); bottomBar.setSizeFull(); //bottomBar.setSpacing(true); //bottomBar.setMargin(true, false, false, false); bottomBar.addComponent(textfieldMessagefield); bottomBar.addComponent(buttonSendMessage); bottomBar.setExpandRatio(textfieldMessagefield, 1f); bottomBar.setExpandRatio(buttonSendMessage, 0f); mainVerticalLayout.addComponent(bottomBar); mainVerticalLayout.setExpandRatio(bottomBar, 0.05f); horizontal.setImmediate(true); panelMessages.setImmediate(true); tableNicknames.setImmediate(true); textfieldMessagefield.setImmediate(true); tableNicknames.addContainerProperty("Rights", String.class, null); tableNicknames.addContainerProperty("Nicknames", String.class, null); tableNicknames.setSelectable(true); textfieldMessagefield.focus(); //mainVerticalLayout.setSizeFull(); panel.addComponent(mainVerticalLayout); }
From source file:VaadinIRC.GUI.IRC.AbstractIRCTableGUI.java
License:Open Source License
/** * Creates the the GUI./*w ww. ja v a2 s . c o m*/ */ public void createGUI() { window.setSizeFull(); ((VerticalLayout) window.getLayout()).setSizeFull(); HorizontalLayout horiPanel = new HorizontalLayout(); horiPanel.setSizeFull(); table = new Table(""); table.setImmediate(true); table.setSelectable(true); table.setWidth(100, Sizeable.UNITS_PERCENTAGE); table.setHeight(100, Sizeable.UNITS_PERCENTAGE); horiPanel.addComponent(table); window.addComponent(horiPanel); }