j2s-development] About binding DIV elements as SWT's Multiple Monitors
Brought to you by:
zhourenjian
|
From: Zhou R. <jo...@sj...> - 2006-08-07 17:45:49
|
Hi, I know native SWT 3.1 is not supporting multiple monitors. But SWT 3.2 or future version may support multiple monitors. In HTML DOM mode, <DIV> elements can be considered as blocks with position and size. If we treat DIV element as a monitor in browser. We can have multiple monitors for SWT! If we are not in the purpose of multiple monitors, we can also have our SWT application embeded inside a DIV block of normal HTML page. Please visit http://j2s.sourceforge.net/, the ControlExample is running inside a DIV monitors. I think that is cool. Currently, we choose document.body as the primary monitor when running as "Java2Script Application" in browser. But maybe Java2Script SWT applications running as DIV block embed applications should be right way. What is your opinions about how "Java2Script SWT Application" will be run as? Standalone? Embed? Workbench (JavaScript version of RCP)? Regards Zhou Renjian Attachment =================== By the way, there are some codes in the SVN repository Display.java: protected static void registerElementAsMonitor(Element el); something like: if (el == document.body) { monitor.clientWidth = document.body.clientWidth; monitor.clientHeight = document.body.clientHeight; monitor.x = 0; monitor.y = 0; monitor.width = window.screen.availWidth; monitor.height = window.screen.availHeight; } else { Point pt = OS.getElementPositionInShell(el, document.body); el.style.position = "absolute"; monitor.x = pt.x; monitor.y = pt.y; monitor.width = monitor.clientWidth = OS.getContainerWidth(el); monitor.height = monitor.clientHeight = OS.getContainerHeight(el); } |