List of usage examples for com.vaadin.ui Embedded setHeight
@Override public void setHeight(String height)
From source file:org.fossa.rolp.RolpApplication.java
License:Open Source License
@Override public void buildMainLayout() { Embedded logo = new Embedded(null, new ThemeResource(MAINPAGE_PANEL_ANMELDEN_LOGO_PATH)); logo.setType(Embedded.TYPE_IMAGE);/*from w w w. j av a 2s . com*/ logo.setWidth("100px"); logo.setHeight("96px"); headlineApp.addComponent(logo, "logo"); headlineApp.addComponent(authorizerLayout, "authorizerLayout"); headlineApp.addStyleName("headlineApp"); layout.addComponent(headlineApp, "headlineApp"); getMainWindow().setContent(layout); getMainWindow().addComponent(getAnimator()); if (getLoginLehrer().getIsAdmin()) { layout.addComponent(getAdminDashboard(), "admin"); } else { layout.addComponent(main, "main"); buildAppLayout(); } }
From source file:org.fossa.rolp.ui.dashboard.FachlehrerDashboard.java
License:Open Source License
public FachlehrerDashboard(RolpApplication app) { super(app);/*from w w w . j a v a 2 s . c o m*/ this.app = app; setCaption(" - FachlehrerDashboard - "); setWidth("100%"); setHeight("100%"); buildButtonBatteries(); CustomLayout layout = new CustomLayout("./lehrerDashboards/fachLehrerDashboardMain"); setContent(layout); CustomLayout headline = new CustomLayout("./lehrerDashboards/headline"); headline.addStyleName("headline"); Embedded logo = new Embedded(null, new ThemeResource(MAINPAGE_PANEL_ANMELDEN_LOGO_PATH)); logo.setType(Embedded.TYPE_IMAGE); logo.setWidth("100px"); logo.setHeight("96px"); headline.addComponent(logo, "logo"); CustomLayout faecherListe = new CustomLayout("./lehrerDashboards/liste"); faecherListe.addStyleName("liste"); faecherList = getFaecherList(); faecherList.setHeight("250px"); faecherList.setStyleName("list"); faecherListe.addComponent(faecherList, "list"); faecherListe.setHeight("260px"); layout.addComponent(faecherListe, "liste"); layout.addComponent(headline, "headline"); layout.addComponent(horizontalButtonBattery, "horizontalButtonBattery"); lehrerBlog = getLehrerBlog(); layout.addComponent(lehrerBlog, "blog"); windowCloseButton.setWidth("100%"); layout.addComponent(windowCloseButton, "windowCloseButton"); }
From source file:org.fossa.rolp.ui.dashboard.KlassenlehrerDashboard.java
License:Open Source License
public KlassenlehrerDashboard(RolpApplication app) { super(app);// w w w . ja v a 2s.c o m this.app = app; setCaption(" - KlassenlehrerDashboard - "); setWidth("100%"); setHeight("100%"); buildButtonBatteries(); CustomLayout layout = new CustomLayout("./lehrerDashboards/klassenLehrerDashboardMain"); setContent(layout); CustomLayout headline = new CustomLayout("./lehrerDashboards/headline"); headline.addStyleName("headline"); Embedded logo = new Embedded(null, new ThemeResource(MAINPAGE_PANEL_ANMELDEN_LOGO_PATH)); logo.setType(Embedded.TYPE_IMAGE); logo.setWidth("100px"); logo.setHeight("96px"); headline.addComponent(logo, "logo"); headline.addComponent(headdataEditingPanel, "headdataEditingPanel"); Panel hints = new Panel(); hints.addStyleName("hints"); hinweistext = new Label(); hinweistext.setContentMode(Label.CONTENT_XHTML); hinweistext.setReadOnly(true); hinweistext.setHeight("250px"); hints.setHeight("250px"); hints.setScrollable(true); hints.addComponent(hinweistext); refreshHinweistext(); CustomLayout schuelerListe = new CustomLayout("./lehrerDashboards/liste"); schuelerListe.addStyleName("liste"); schuelerList = getSchuelerList(); schuelerList.setHeight("250px"); schuelerList.setStyleName("list"); schuelerListe.addComponent(schuelerList, "list"); schuelerListe.setHeight("260px"); layout.addComponent(schuelerListe, "liste"); layout.addComponent(headline, "headline"); layout.addComponent(horizontalButtonBattery, "horizontalButtonBattery"); layout.addComponent(verticalButtonBattery, "verticalButtonBattery"); layout.addComponent(hints, "hints"); windowCloseButton.setWidth("100%"); layout.addComponent(windowCloseButton, "windowCloseButton"); // app.getAnimator().animate(horizontalButtonBattery, AnimType.ROLL_DOWN_OPEN_POP).setDuration(500).setDelay(500); }
From source file:org.fossa.rolp.ui.leb.LebAnzeigen.java
License:Open Source License
public LebAnzeigen(FossaApplication app, SchuelerLaso schueler, KlasseLaso klasse) throws DocumentException, IOException { super(app);/* ww w. ja v a2s.c o m*/ setCaption(" - Lernentwicklungsbericht anzeigen - "); VerticalLayout layout = new VerticalLayout(); setWidth("800px"); setContent(layout); layout.setSpacing(true); Embedded embeddedPdf = new Embedded(); embeddedPdf.setType(Embedded.TYPE_BROWSER); DateFormat dateFormat = new SimpleDateFormat("ddMMyy-HHmmss"); String dateiname = "Klasse" + klasse.getKlassenname() + "_" + schueler.getVorname() + "_" + schueler.getName() + "_" + dateFormat.format(new Date()) + ".pdf"; embeddedPdf.setSource(new LebCreator(app, schueler, klasse, dateiname).getLebResource()); embeddedPdf.setWidth(100, Sizeable.UNITS_PERCENTAGE); embeddedPdf.setHeight("580px"); windowCloseButton.setWidth(100, Sizeable.UNITS_PERCENTAGE); layout.addComponent(embeddedPdf); layout.addComponent(windowCloseButton); }
From source file:org.icrisat.gdms.ui.GDMSMain.java
VerticalLayout buildWelcomeScreen() { VerticalLayout layoutForWelcomeTab = new VerticalLayout(); layoutForWelcomeTab.setMargin(true); layoutForWelcomeTab.setSpacing(true); layoutForWelcomeTab.setCaption("Welcome"); layoutForWelcomeTab.setStyleName(Reindeer.LAYOUT_WHITE); CssLayout cssLayout = new CssLayout(); cssLayout.setMargin(true);//from w ww . j a va 2s . co m cssLayout.setWidth("100%"); layoutForWelcomeTab.addComponent(cssLayout); HeadingOne title = new HeadingOne("Welcome to Genotyping Data Management"); cssLayout.addComponent(title); HorizontalLayout horizLayoutForIntroPara = new HorizontalLayout(); horizLayoutForIntroPara.setSpacing(true); horizLayoutForIntroPara.setWidth("100%"); horizLayoutForIntroPara.setMargin(true, false, true, false); cssLayout.addComponent(horizLayoutForIntroPara); String strIntroPara1 = "<p>The Genotyping Data Management System aims to provide a comprehensive public repository " + "for genotype, linkage map and QTL data from crop species relevant in the semi-arid tropics.</p>"; String strIntroPara2 = "<p>This system is developed in Java and the database is MySQL. The initial release record " + "details of current genotype datasets generated for GCP mandate crops along with details of " + "molecular markers and related metadata. The Retrieve tab is a good starting point to browse " + "or query the database contents. The datasets available for each crop species can be queried. " + "Access to data sets requires a login.</p>"; String strIntroPara3 = "<p>Data may be currently exported to the following formats: 2x2 matrix and flapjack software formats. " + "Data submission is through templates; upload templates are available for genotype, QTL and " + "map data(type of markers - SSR, SNP and DArt). The templates are in the form of excel sheets with built-in " + "validation functions.</p>"; Label lblPara = new Label(strIntroPara1 + strIntroPara2 + strIntroPara3, Label.CONTENT_XHTML); horizLayoutForIntroPara.addComponent(lblPara); horizLayoutForIntroPara.setExpandRatio(lblPara, 1); //Spacer lblPara = new Label(""); lblPara.setWidth("20px"); horizLayoutForIntroPara.addComponent(lblPara); ThemeResource themeResource = new ThemeResource("images/FlowChart.jpg"); Embedded headerImage = new Embedded("", themeResource); headerImage.setWidth("500px"); headerImage.setHeight("400px"); horizLayoutForIntroPara.addComponent(headerImage); return layoutForWelcomeTab; }
From source file:org.icrisat.gdms.ui.GDMSMain.java
CssLayout getBottomPanelLayout() { CssLayout cssLayoutForContactImage = new CssLayout(); cssLayoutForContactImage.setWidth("100%"); ThemeResource themeResource = new ThemeResource("images/GDMS_Footer.gif"); Embedded contactImage = new Embedded("", themeResource); contactImage.setWidth("1000px"); contactImage.setHeight("20px"); cssLayoutForContactImage.addComponent(contactImage); return cssLayoutForContactImage; }
From source file:org.jpos.qi.login.LoginView.java
License:Open Source License
private HorizontalLayout createTitle() { HorizontalLayout labels = new HorizontalLayout(); labels.setWidth("100%"); labels.setMargin(new MarginInfo(false, false, true, false)); labels.addStyleName("labels"); Label title = new Label(app.getMessage("login.title")); title.setSizeUndefined();/*from www. ja v a 2 s .c o m*/ title.addStyleName(ValoTheme.LABEL_H4); title.addStyleName(ValoTheme.LABEL_COLORED); labels.addComponent(title); labels.setComponentAlignment(title, Alignment.BOTTOM_LEFT); Embedded logo = new Embedded("", QIResources.JPOS_LOGO); logo.setHeight("80px"); labels.addComponent(logo); labels.setComponentAlignment(logo, Alignment.TOP_RIGHT); return labels; }
From source file:org.milleni.dunning.ui.customer.form.CustomProcessInstanceDetailPanel.java
License:Apache License
protected void addProcessImage() { ProcessDefinitionEntity processDefinitionEntity = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService) .getDeployedProcessDefinition(processDefinition.getId()); // Only show when graphical notation is defined if (processDefinitionEntity != null) { boolean didDrawImage = false; if (ExplorerApp.get().isUseJavascriptDiagram()) { try { final InputStream definitionStream = repositoryService.getResourceAsStream( processDefinition.getDeploymentId(), processDefinition.getResourceName()); XMLInputFactory xif = XMLInputFactory.newInstance(); XMLStreamReader xtr = xif.createXMLStreamReader(definitionStream); BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr); if (bpmnModel.getFlowLocationMap().size() > 0) { int maxX = 0; int maxY = 0; for (String key : bpmnModel.getLocationMap().keySet()) { GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(key); double elementX = graphicInfo.getX() + graphicInfo.getWidth(); if (maxX < elementX) { maxX = (int) elementX; }/*from w ww. j av a2 s . c om*/ double elementY = graphicInfo.getY() + graphicInfo.getHeight(); if (maxY < elementY) { maxY = (int) elementY; } } Panel imagePanel = new Panel(); // using panel for scrollbars imagePanel.addStyleName(Reindeer.PANEL_LIGHT); imagePanel.setWidth(100, UNITS_PERCENTAGE); imagePanel.setHeight(100, UNITS_PERCENTAGE); URL explorerURL = ExplorerApp.get().getURL(); URL url = new URL(explorerURL.getProtocol(), explorerURL.getHost(), explorerURL.getPort(), explorerURL.getPath().replace("/ui", "") + "diagram-viewer/index.html?processDefinitionId=" + processDefinition.getId() + "&processInstanceId=" + processInstance.getId()); Embedded browserPanel = new Embedded("", new ExternalResource(url)); browserPanel.setType(Embedded.TYPE_BROWSER); browserPanel.setWidth(maxX + 350 + "px"); browserPanel.setHeight(maxY + 220 + "px"); HorizontalLayout panelLayoutT = new HorizontalLayout(); panelLayoutT.setSizeUndefined(); imagePanel.setContent(panelLayoutT); imagePanel.addComponent(browserPanel); panelLayout.addComponent(imagePanel); didDrawImage = true; } } catch (Exception e) { LOGGER.error("Error loading process diagram component", e); } } if (didDrawImage == false && processDefinitionEntity.isGraphicalNotationDefined()) { StreamResource diagram = new ProcessDefinitionImageStreamResourceBuilder() .buildStreamResource(processInstance, repositoryService, runtimeService); if (diagram != null) { Label header = new Label(i18nManager.getMessage(Messages.PROCESS_HEADER_DIAGRAM)); header.addStyleName(ExplorerLayout.STYLE_H3); header.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK); header.addStyleName(ExplorerLayout.STYLE_NO_LINE); panelLayout.addComponent(header); Embedded embedded = new Embedded(null, diagram); embedded.setType(Embedded.TYPE_IMAGE); embedded.setSizeUndefined(); Panel imagePanel = new Panel(); // using panel for scrollbars imagePanel.setScrollable(true); imagePanel.addStyleName(Reindeer.PANEL_LIGHT); imagePanel.setWidth(100, UNITS_PERCENTAGE); imagePanel.setHeight(100, UNITS_PERCENTAGE); HorizontalLayout panelLayoutT = new HorizontalLayout(); panelLayoutT.setSizeUndefined(); imagePanel.setContent(panelLayoutT); imagePanel.addComponent(embedded); panelLayout.addComponent(imagePanel); } } } }
From source file:org.universAAL.ucc.controller.desktop.ToolController.java
public void buttonClick(ClickEvent event) { if (event.getButton() == toolWin.getuStoreButton()) { Embedded em = new Embedded("", new ExternalResource(createLink())); em.setType(Embedded.TYPE_BROWSER); em.setWidth("100%"); em.setHeight("850px"); Window w = new Window("uStore"); w.setWidth("1250px"); w.setHeight("800px"); VerticalLayout v = new VerticalLayout(); w.center();/*from ww w . j av a 2s.c om*/ v.addComponent(em); w.setContent(v); app.getMainWindow().removeWindow(toolWin); app.getMainWindow().addWindow(w); } if (event.getButton() == toolWin.getOpenAAL()) { // Embedded em = new Embedded("", new ExternalResource( // "http://wiki.openaal.org")); // em.setType(Embedded.TYPE_BROWSER); // em.setWidth("100%"); // em.setHeight("800px"); // Window w = new Window("openAAL"); // w.setWidth("1250px"); // w.setHeight("800px"); // VerticalLayout v = new VerticalLayout(); // w.center(); // v.addComponent(em); // w.setContent(v); BrowseServicesWindow pw = new BrowseServicesWindow(app); PurchasedServicesController pc = new PurchasedServicesController(pw, app); app.getMainWindow().removeWindow(toolWin); app.getMainWindow().addWindow(pw); } if (event.getButton() == toolWin.getInstallButton()) { // Later uncomment again only for testing commented out! Upload up = new Upload("", new AALServiceReceiver()); up.setButtonCaption(res.getString("install.button")); up.addListener((Upload.FinishedListener) this); up.addListener((Upload.FailedListener) this); installWindow = new Window(res.getString("install.win.caption")); installWindow.setResizable(false); installWindow.center(); installWindow.setWidth("400px"); VerticalLayout v = new VerticalLayout(); v.setSizeFull(); v.setSpacing(true); v.setMargin(true); v.addComponent(up); installWindow.setContent(v); app.getMainWindow().removeWindow(toolWin); app.getMainWindow().addWindow(installWindow); } if (event.getButton() == toolWin.getLogoutButton()) { DesktopController.setCurrentPassword(""); DesktopController.setCurrentUser(""); // if(!DesktopController.web.getSocket().isClosed()) { // try { // DesktopController.web.getSocket().close(); // } catch (IOException e) { // e.printStackTrace(); // } // } app.close(); } if (event.getButton() == toolWin.getUninstallButton()) { app.getMainWindow().removeWindow(toolWin); List<RegisteredService> ids = new ArrayList<RegisteredService>(); Document doc = Model.getSrvDocument(); NodeList nodeList = doc.getElementsByTagName("service"); for (int i = 0; i < nodeList.getLength(); i++) { RegisteredService srv = new RegisteredService(); Element element = (Element) nodeList.item(i); System.err.println(element.getAttribute("serviceId")); srv.setServiceId(element.getAttribute("serviceId")); NodeList srvChilds = element.getChildNodes(); for (int j = 0; j < srvChilds.getLength(); j++) { Node n = srvChilds.item(j); if (n.getNodeName().equals("application")) { Element e = (Element) n; srv.getAppId().add(e.getAttribute("appId")); } if (n.getNodeName().equals("bundle")) { Element b = (Element) n; srv.getBundleId().add(b.getAttribute("id")); srv.setBundleVersion(b.getAttribute("version")); } if (n.getNodeName().equals("menuEntry")) { Element e = (Element) n; srv.setMenuName(e.getAttribute("entryName")); srv.setIconURL(e.getAttribute("iconURL")); srv.setProvider(e.getAttribute("vendor")); srv.setServiceClass(e.getAttribute("serviceClass")); srv.setUserID(e.getAttribute("userID")); } } ids.add(srv); } DeinstallWindow dw = new DeinstallWindow(ids); app.getMainWindow().addWindow(dw); DeinstallController dc = new DeinstallController(dw, app); // frontend.uninstallService(Activator.getSessionKey(), "28002"); // frontend.getInstalledUnitsForService(Activator.getSessionKey(), "28002"); } if (event.getButton() == toolWin.getPersonButton()) { AddNewPersonWindow apw = null; try { apw = new AddNewPersonWindow(null, null, app); } catch (JAXBException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (ParseException e) { e.printStackTrace(); } app.getMainWindow().removeWindow(toolWin); app.getMainWindow().addWindow(apw); } if (event.getButton() == toolWin.getConfigButton()) { AddNewHardwareWindow anhw = null; try { anhw = new AddNewHardwareWindow(null, null, app); } catch (JAXBException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (ParseException e) { e.printStackTrace(); } app.getMainWindow().removeWindow(toolWin); app.getMainWindow().addWindow(anhw); } if (event.getButton() == toolWin.getEditHW()) { RoomsWindow hardWare = null; try { hardWare = new RoomsWindow(app); } catch (JAXBException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (ParseException e) { e.printStackTrace(); } app.getMainWindow().removeWindow(toolWin); app.getMainWindow().addWindow(hardWare); } if (event.getButton() == toolWin.getEditPerson()) { HumansWindow hw = null; try { hw = new HumansWindow(app); } catch (JAXBException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (ParseException e) { e.printStackTrace(); } app.getMainWindow().removeWindow(toolWin); app.getMainWindow().addWindow(hw); } if (event.getButton() == toolWin.getEditUC()) { WhichBundleShouldBeConfiguredWindow uc = new WhichBundleShouldBeConfiguredWindow("Use Cases"); app.getMainWindow().removeWindow(toolWin); app.getMainWindow().addWindow(uc); } }
From source file:org.vaadin.alump.fancylayouts.demo.PanelDemo.java
License:Apache License
/** * Sample content for panel/*from w w w . ja va 2s . co m*/ * * @return */ private ComponentContainer createPanelContentA() { VerticalLayout layout = new VerticalLayout(); layout.setWidth("100%"); layout.setMargin(true); layout.setSpacing(true); Label label = new Label(LOREM_STR); layout.addComponent(label); Embedded image = new Embedded(); image.setSource(new ExternalResource("http://misc.siika.fi/fancy-demo1.jpg")); image.setWidth("500px"); image.setHeight("281px"); layout.addComponent(image); return layout; }