Viewport viewport = new Viewport(); viewport.add(new ContentPanel(), new MarginData(10)); RootPanel.get().add(viewport);The viewport is not added to the root panel automatically. Is is not necessary to call {@link #layout()} after adding the viewport to theRootPanel. Layout will be called after being added to the root panel.
This class takes the "main" / top level panel passed in its constructor and "expands" it to fit the browsers viewable area. You must not add the "main" panel to GWT's RootPanel via RootPanel.get().add(..) when using the ViewPort class - this is done automatically for you. @author Sanjiv Jivan
ViewPort
represents a view inside the display window or a {@link FrameBuffer} to which scenes will be rendered. A viewport has a {@link #ViewPort(java.lang.String,com.jme3.renderer.Camera) camera}which is used to render a set of {@link #attachScene(com.jme3.scene.Spatial) scenes}. A view port has a location on the screen as set by the {@link Camera#setViewPort(float,float,float,float) } method.By default, a view port does not clear the framebuffer, but it can be set to {@link #setClearFlags(boolean,boolean,boolean) clear the framebuffer}. The background color which the color buffer is cleared to can be specified via the {@link #setBackgroundColor(com.jme3.math.ColorRGBA)} method.
A ViewPort has a list of {@link SceneProcessor}s which can control how the ViewPort is rendered by the {@link RenderManager}. @author Kirill Vainer @see RenderManager @see SceneProcessor @see Spatial @see Camera
public void onModuleLoad() { Viewport viewport = new Viewport(); viewport.setWidget(new ContentPanel(), new MarginData(10)); RootPanel.get().add(viewport); }The viewport is not added to the root panel automatically. Is is not necessary to call {@link #forceLayout()} after adding the viewport to theRootPanel. Layout will be called after being added to the root panel.
Central view port definition that determines and influences that position of the map. It allows for zooming in and out, translation, etc.
Note that all coordinates and bounding boxes must always be expressed in world space. See {@link RenderSpace} formore information.
Next to simply storing and changing the map location, implementation of this interface will also send out several types of events that clearly define the changes in the view on the map.
@author Pieter De Graef @author Oliver May @author Jan De Moerloose @since 1.0.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|