def createDialogArea(self, parent): composite = self.super__createDialogArea(parent) glayout = GridLayout(1, False) composite.setLayout(glayout) data = GridData(SWT.FILL, SWT.FILL, True, True); data.widthHint = 800; data.heightHint = 350; composite.setLayoutData(data); browser = Browser(composite, SWT.NONE) browser.setUrl(File(output.name).toURI().toString()) browser.setLayoutData(GridData(SWT.FILL, SWT.FILL, True, True)); return composite
browser2.setUrl('file:///Users/krismz/Software/delv/examples/java_cars/parallel_coords.html') pgd = GridData(SWT.FILL, SWT.FILL, True, False) #pgd.widthHint = 804 #pgd.heightHint = 504 browser2.setLayoutData(pgd) browser3 = Browser(shell, SWT.RESIZE) jggplot = JRI_ggplot(None, Rengine(["--vanilla"], False, None)) jggplot.Rengine.eval('mtcars$cyl <- factor(mtcars$cyl,levels=c(4,6,8),labels=c("4cyl","6cyl","8cyl"))') #browser3.setUrl(jggplot.qplot("cyl","mpg","mtcars") browser3.setUrl(jggplot.qplot("wt","mpg","mtcars", 'geom=c("point", "smooth"), method="lm", formula=y~x, color=cyl, main="Regression of MPG on Weight", xlab="Weight", ylab="Miles per Gallon"')) #jgd = GridData(SWT.FILL, SWT.FILL, True, True) jgd = GridData() jgd.widthHint = 404 #504 jgd.heightHint = 404 #504 browser3.setLayoutData(jgd) composite = Composite(shell, SWT.EMBEDDED | SWT.RESIZE) # TODO keep this resize listener? #composite.addControlListener(CleanResizeListener()) #cgd = GridData(SWT.FILL, SWT.FILL, True, True) cgd = GridData() cgd.widthHint = 100 #cgd.heightHint = 200 cgd.heightHint = 404 #504 composite.setLayoutData(cgd) frame = SWT_AWT.new_Frame(composite) # Do this instead if running without SWT #frame=JFrame(title="Cars", resizable=1,defaultCloseOperation=JFrame.EXIT_ON_CLOSE)