List of usage examples for com.vaadin.ui Embedded setSizeFull
@Override public void setSizeFull()
From source file:annis.visualizers.component.AbstractDotVisualizer.java
License:Apache License
@Override public ImagePanel createComponent(final VisualizerInput visInput, VisualizationToggle visToggle) { try {/* ww w .j a va2 s. c o m*/ final PipedOutputStream out = new PipedOutputStream(); final PipedInputStream in = new PipedInputStream(out); new Thread(new Runnable() { @Override public void run() { writeOutput(visInput, out); } }).start(); String fileName = "dotvis_" + new Random().nextInt(Integer.MAX_VALUE) + ".png"; StreamResource resource = new StreamResource(new StreamResource.StreamSource() { @Override public InputStream getStream() { return in; } }, fileName); Embedded emb = new Embedded("", resource); emb.setMimeType("image/png"); emb.setSizeFull(); emb.setStandby("loading image"); emb.setAlternateText("DOT graph visualization"); return new ImagePanel(emb); } catch (IOException ex) { log.error(null, ex); } return new ImagePanel(new Embedded()); }
From source file:com.etest.pdfgenerator.TQViewer.java
public TQViewer(int tqCoverageId) { this.tqCoverageId = tqCoverageId; // setSizeFull(); setWidth("900px"); setHeight("600px"); center();/* w w w .j a v a 2 s. c om*/ StreamResource resource = new StreamResource(new TQCoveragePDF(getTQCoverageId()), "TQ.pdf"); resource.setMIMEType("application/pdf"); VerticalLayout v = new VerticalLayout(); v.setSizeFull(); Embedded e = new Embedded(); e.setSource(resource); e.setSizeFull(); e.setType(Embedded.TYPE_BROWSER); v.addComponent(e); setContent(v); }
From source file:com.etest.pdfviewer.ItemAnalysisOfSubjectReportViewer.java
public ItemAnalysisOfSubjectReportViewer(int tqCoverageId) { this.tqCoverageId = tqCoverageId; setWidth("900px"); setHeight("600px"); center();/*from w w w . ja v a 2 s .c o m*/ StreamResource resource = new StreamResource(new ItemAnalysisOfSubjectReportPDF(getTQCoverageId()), "ItemAnalysis.pdf"); resource.setMIMEType("application/pdf"); VerticalLayout v = new VerticalLayout(); v.setSizeFull(); Embedded e = new Embedded(); e.setSource(resource); e.setSizeFull(); e.setType(Embedded.TYPE_BROWSER); v.addComponent(e); setContent(v); }
From source file:com.etest.pdfviewer.ItemAnalysisReportViewer.java
public ItemAnalysisReportViewer(int tqCoverageId) { this.tqCoverageId = tqCoverageId; setWidth("900px"); setHeight("600px"); center();// w ww. j av a2 s . co m StreamResource resource = new StreamResource(new ItemAnalysisReportPDF(getTqCoverageId()), "ItemAnalysis.pdf"); resource.setMIMEType("application/pdf"); VerticalLayout v = new VerticalLayout(); v.setSizeFull(); Embedded e = new Embedded(); e.setSource(resource); e.setSizeFull(); e.setType(Embedded.TYPE_BROWSER); v.addComponent(e); setContent(v); }
From source file:com.etest.pdfviewer.SummaryReportViewer.java
public SummaryReportViewer(String summaryType) { setCaption(summaryType);/*from w ww. j av a2 s.c o m*/ setWidth("900px"); setHeight("600px"); center(); StreamResource resource; //= new StreamResource(new InventoryCasesReportPDF(), "InventoryOfCases.pdf"); if (summaryType.equals("Summary: Case vs Items")) { resource = new StreamResource(new InventoryCasesReportPDF(), "InventoryOfCases.pdf"); } else { resource = new StreamResource(new InventoryItemsReportPDF(), "InventoryOfItems.pdf"); } resource.setMIMEType("application/pdf"); VerticalLayout v = new VerticalLayout(); v.setSizeFull(); Embedded e = new Embedded(); e.setSource(resource); e.setSizeFull(); e.setType(Embedded.TYPE_BROWSER); v.addComponent(e); setContent(v); }
From source file:com.etest.pdfviewer.TQCriticalIndexReportViewer.java
public TQCriticalIndexReportViewer(int tqCoverageId) { this.tqCoverageId = tqCoverageId; setWidth("900px"); setHeight("600px"); center();/*from w ww .j ava 2 s .c o m*/ StreamResource resource = new StreamResource(new TQCriticalIndexValuesReportPDF(getTQCoverageId()), "TQCriticalIndexValues.pdf"); resource.setMIMEType("application/pdf"); VerticalLayout v = new VerticalLayout(); v.setSizeFull(); Embedded e = new Embedded(); e.setSource(resource); e.setSizeFull(); e.setType(Embedded.TYPE_BROWSER); v.addComponent(e); setContent(v); }
From source file:com.hris.payroll.reports.ReportViewer.java
public ReportViewer(String reportType, int branchId, Date payrollDate) { this.reportType = reportType; this.branchId = branchId; this.payrollDate = payrollDate; setWidth("900px"); setHeight("600px"); center();/* w ww. j a v a 2s .c o m*/ StreamResource resource = null; switch (reportType) { case "Payslip": { String filename = "Payslip-" + new Date().getTime() + ".pdf"; resource = new StreamResource(new PayslipReportPDF(getBranchId(), getPayrollDate()), filename); break; } case "Advances Summary": { String filename = "Advances-" + new Date().getTime() + ".pdf"; resource = new StreamResource(new AdvancesSummaryReportPdf(getBranchId(), getPayrollDate()), filename); break; } default: { String filename = "Advances-" + new Date().getTime() + ".pdf"; resource = new StreamResource(new AdvancesReportPdf(getBranchId(), getPayrollDate(), reportType), filename); break; } } resource.setMIMEType("application/pdf"); VerticalLayout v = new VerticalLayout(); v.setSizeFull(); v.setSpacing(true); v.setMargin(new MarginInfo(false, false, true, false)); Embedded em = new Embedded(); em.setSource(resource); em.setSizeFull(); em.setType(Embedded.TYPE_BROWSER); v.addComponent(em); v.setExpandRatio(em, 1); setContent(v); }
From source file:eu.lod2.CKAN.java
License:Apache License
public CKAN(LOD2DemoState st) { // The internal state state = st;//from ww w . j a va 2s .c o m Embedded browser = new Embedded(); try { URL url = new URL("http://ckan.net"); browser = new Embedded("", new ExternalResource(url)); browser.setType(Embedded.TYPE_BROWSER); browser.setSizeFull(); //panel.addComponent(browser); } catch (MalformedURLException e) { e.printStackTrace(); } ; // The composition root MUST be set setCompositionRoot(browser); }
From source file:eu.lod2.D2RCordis.java
License:Apache License
public D2RCordis(LOD2DemoState st) { // The internal state state = st;/*ww w . j ava2 s .c o m*/ Embedded browser = new Embedded(); try { LOD2DemoInitApp urlD2r = new LOD2DemoInitApp(st, "http://localhost/d2r-cordis"); System.err.println(urlD2r.service); URL url = new URL(urlD2r.service); browser = new Embedded("", new ExternalResource(url)); browser.setType(Embedded.TYPE_BROWSER); browser.setSizeFull(); //panel.addComponent(browser); } catch (MalformedURLException e) { e.printStackTrace(); } ; // The composition root MUST be set setCompositionRoot(browser); }
From source file:eu.lod2.DBpedia.java
License:Apache License
public DBpedia(LOD2DemoState st) { // The internal state state = st;// w ww. j av a2 s . c o m Embedded browser = new Embedded(); try { URL url = new URL("http://live.dbpedia.org"); browser = new Embedded("", new ExternalResource(url)); browser.setType(Embedded.TYPE_BROWSER); browser.setSizeFull(); //panel.addComponent(browser); } catch (MalformedURLException e) { e.printStackTrace(); } ; // The composition root MUST be set setCompositionRoot(browser); }