private static native void toFullScreen(Element element) /*-{ if(element.requestFullscreen) { element.requestFullscreen(); } else if(element.webkitRequestFullscreen) { element.webkitRequestFullscreen(); } else if(element.mozRequestFullscreen) { element.mozRequestFullScreen(); } var rect = element.getBoundingClientRect(); element.width = rect.width; element.height = rect.height; }-*/;
@Override public void execute() { setSize(CSS3DRenderingPanel.this.getOffsetWidth(), CSS3DRenderingPanel.this.getOffsetHeight()); } });
private static native boolean isSupportFullScreen(Element element) /*-{ return (element.requestFullscreen || element.webkitRequestFullscreen || element.mozRequestFullscreen) ? true : false; }-*/; }
/** * This constructor will create new instance of the widget. */ public CSS3DRenderingPanel() { super(""); this.handlerManager = new HandlerManager(this); this.ensureDebugId("css3DRenderingPanel"); this.getElement().getStyle().setPosition(Position.RELATIVE); this.setWidth("100%"); this.setHeight("100%"); }
setSize(this.getOffsetWidth(), this.getOffsetHeight()); if(getAnimatedScene() != null)
/** * Resizes the {@link CSS3DRenderer} viewport * to (width, height), and also sets the viewport to fit that size, * starting in (0, 0). * * @param width the new width of the {@link CSS3DRenderer}. * @param height the new height of the {@link CSS3DRenderer}. */ private void setSize(int width, int height) { Log.debug("CSS3DRenderingPanel: set size: W=" + width + ", H=" + height); getCanvas().setSize(width+"px", height+"px"); getRenderer().setSize(width, height); }
@Override public void execute() { onLoaded(); } });
/** * Sets the {@link CSS3DAnimatedScene} to the widget. * @param animatedScene */ public void setAnimatedScene(CSS3DAnimatedScene animatedScene) { this.animatedScene = animatedScene; this.add(animatedScene.getRenderer()); // handlerManager.fireEvent(new SceneLoadingEvent()); }