This is an extension point in Hudson, allowing different kind of rendering to be added as plugins.
The View object is the main Java 3D object for controlling the Java 3D viewing model. All of the components that specify the view transform used to render to the 3D canvases are either contained in the View object or in objects that are referenced by the View object.
Java 3D allows applications to specify multiple simultaneously active View objects, each controlling its own set of canvases.
The Java 3D View object has several instance variables and methods, but most are calibration variables or user-helping functions. The viewing policies defined by the View object are described below.
Policies
The View object defines the following policies:
screenScale = physicalScreenWidth / 2.0
screenScale
attribute (see the setScreenScale method description).
The projection and clip parameters determine the view model's field of view and the front and back clipping distances.
There are several considerations to take into account when choosing values for the front and back clip distances.
There are five methods used to get information about system execution and performance:
getCurrentFrameStartTime
returns the time at which the most recent rendering frame started. getLastFrameDuration
returns the duration, in milliseconds, of the most recently completed rendering frame.
getFrameNumber
returns the frame number for this view.
getMaxFrameStartTimes
retrieves the implementation-dependent maximum number of frames whose start times will be recorded by the system.
getFrameStartTimes
copies the last k frame start time values into the user-specified array.
The following methods control the traversal, the rendering, and the execution of the behavior scheduler for this view:
startBehaviorScheduler
starts the behavior scheduler running after it has been stopped. stopBehaviorScheduler
stops the behavior scheduler after all currently-scheduled behaviors are executed.
isBehaviorSchedulerRunning
retrieves a flag that indicates whether the behavior scheduler is currently running.
startView
starts traversing this view and starts the renderers associated with all canvases attached to this view.
stopView
stops traversing this view after the current state of the scene graph is reflected on all canvases attached to this view.
isViewRunning
returns a flag indicating whether the traverser is currently running on this view.
Scene Antialiasing
The following methods set and retrieve the scene antialiasing flag. Scene antialiasing is either enabled or disabled for this view. If enabled, the entire scene will be antialiased on each canvas in which scene antialiasing is available. Scene antialiasing is disabled by default.
setSceneAntialiasingEnable
sets the scene antialiasing flag. getSceneAntialiasingEnable
returns the scene antialiasing flag.
Note: Scene antialiasing is ignored in pure immediate mode, but is supported in mixed-immediate mode.
Depth Buffer
The following two methods enable and disable automatic freezing of the depth buffer for objects rendered during the transparent rendering pass (that is, objects rendered using alpha blending) for this view. If enabled, depth buffer writes are disabled during the transparent rendering pass regardless of the value of the depth-buffer-write-enable flag in the RenderingAttributes object for a particular node. This flag is enabled by default.
setDepthBufferFreezeTransparent
enables depth buffer freezing. getDepthBufferFreezeTransparent
retrieves the depth buffer flag.
Sensors
The following methods retrieve the sensor's location in the virtual world:
getSensorToVworld
takes the sensor's last reading and generates a sensor-to-vworld coordinate system transform. This Transform3D object takes points in that sensor's local coordinate system and transforms them into virtual world coordinates. getSensorHotSpotInVworld
retrieves the specified sensor's last hotspot location in virtual world coordinates.
A camera-based view model allows application programmers to think about the images displayed on the computer screen as if a virtual camera took those images. Such a view model allows application programmers to position and orient a virtual camera within a virtual scene, to manipulate some parameters of the virtual camera's lens (specify its field of view), and to specify the locations of the near and far clipping planes.
Java 3D allows applications to enable compatibility mode for room-mounted, non-head-tracked display environments, or to disable compatibility mode using the following methods. Camera-based viewing functions are only available in compatibility mode.
setCompatibilityModeEnable
turns compatibility mode on or off. Compatibility mode is disabled by default. getCompatabilityModeEnable
returns the compatibility mode enable flag.
Setting the Viewing Transform
The View object provides the following compatibility-mode methods that operate on the viewing transform.
setVpcToEc
a compatibility mode method that specifies the ViewPlatform coordinates (VPC) to eye coordinates viewing transform. getVpcToEc
returns the VPC.
The View object provides the following compatibility-mode methods that operate on the projection transform:
setLeftProjection
and setRightProjection
methods specify a viewing frustum for the left and right eye that transforms points in eye coordinates to clipping coordinates. The getLeftProjection
and getRightProjection
methods return the viewing frustum for the left and right eye.
Additional Information
For more information, see the Introduction to the Java 3D API and View Model documents. @see Canvas3D @see PhysicalBody @see PhysicalEnvironment @see ViewPlatform @see TransparencyAttributes
A very important part of the text package is the View
class. As the name suggests it represents a view of the text model, or a piece of the text model. It is this class that is responsible for the look of the text component. The view is not intended to be some completely new thing that one must learn, but rather is much like a lightweight component.
By default, a view is very light. It contains a reference to the parent view from which it can fetch many things without holding state, and it contains a reference to a portion of the model (Element
). A view does not have to exactly represent an element in the model, that is simply a typical and therefore convenient mapping. A view can alternatively maintain a couple of Position objects to maintain its location in the model (i.e. represent a fragment of an element). This is typically the result of formatting where views have been broken down into pieces. The convenience of a substantial relationship to the element makes it easier to build factories to produce the views, and makes it easier to keep track of the view pieces as the model is changed and the view must be changed to reflect the model. Simple views therefore represent an Element directly and complex views do not.
A view has the following responsibilities:
The view has a setSize
method which is like doLayout
and setSize
in Component
combined. The view has a preferenceChanged
method which is like invalidate
in Component
except that one can invalidate just one axis and the child requesting the change is identified.
A View expresses the size that it would like to be in terms of three values, a minimum, a preferred, and a maximum span. Layout in a view is can be done independently upon each axis. For a properly functioning View implementation, the minimum span will be <= the preferred span which in turn will be <= the maximum span.
The minimum set of methods for layout are:
The setSize
method should be prepared to be called a number of times (i.e. It may be called even if the size didn't change). The setSize
method is generally called to make sure the View layout is complete prior to trying to perform an operation on it that requires an up-to-date layout. A view's size should always be set to a value within the minimum and maximum span specified by that view. Additionally, the view must always call the preferenceChanged
method on the parent if it has changed the values for the layout it would like, and expects the parent to honor. The parent View is not required to recognize a change until the preferenceChanged
has been sent. This allows parent View implementations to cache the child requirements if desired. The calling sequence looks something like the following:
The exact calling sequence is up to the layout functionality of the parent view (if the view has any children). The view may collect the preferences of the children prior to determining what it will give each child, or it might iteratively update the children one at a time.
This is done in the paint method, which is pretty much like a component paint method. Views are expected to potentially populate a fairly large tree. A View
has the following semantics for rendering:
Component
(i.e. the Component
returned by the {@link #getContainer getContainer} method).This means a child view lives in the same coordinate system as the parent view unless the parent has explicitly changed the coordinate system. To schedule itself to be repainted a view can call repaint on the hosting Component
. Graphics
object given is not initialized in any way. A view should set any settings needed. View
is inherently transparent. While a view may render into its entire allocation, typically a view does not. Rendering is performed by traversing down the tree of View
implementations. Each View
is responsible for rendering its children. This behavior is depended upon for thread safety. While view implementations do not necessarily have to be implemented with thread safety in mind, other view implementations that do make use of concurrency can depend upon a tree traversal to guarantee thread safety. The methods for rendering are:
Because the view objects are produced from a factory and therefore cannot necessarily be counted upon to be in a particular pattern, one must be able to perform translation to properly locate spatial representation of the model. The methods for doing this are:
The layout must be valid prior to attempting to make the translation. The translation is not valid, and must not be attempted while changes are being broadcasted from the model via a DocumentEvent
.
If the overall view is represented by many pieces (which is the best situation if one want to be able to change the view and write the least amount of new code), it would be impractical to have a huge number of DocumentListener
s. If each view listened to the model, only a few would actually be interested in the changes broadcasted at any given time. Since the model has no knowledge of views, it has no way to filter the broadcast of change information. The view hierarchy itself is instead responsible for propagating the change information. At any level in the view hierarchy, that view knows enough about its children to best distribute the change information further. Changes are therefore broadcasted starting from the root of the view hierarchy. The methods for doing this are:
The following features are supported:
view.add(child);And the child will be added to the contentPane. The content pane will always be non-null. Attempting to set it to null will cause the View to throw an exception. The default content pane will not have a layout manager set. @see javax.swing.JFrame @see javax.swing.JRootPane @author Christopher Butler @author Karl Schaefer
View
is jEdit's top-level frame window. In a BeanShell script, you can obtain the current view instance from the view
variable.
The largest component it contains is an {@link EditPane} that in turncontains a {@link org.gjt.sp.jedit.textarea.JEditTextArea} that displays a{@link Buffer}. A view can have more than one edit pane in a split window configuration. A view also contains a menu bar, an optional toolbar and other window decorations, as well as docked windows.
The View class performs two important operations dealing with plugins: creating plugin menu items, and managing dockable windows.
jEdit
class.
@see org.gjt.sp.jedit.jEdit#newView(View)
@see org.gjt.sp.jedit.jEdit#newView(View,Buffer)
@see org.gjt.sp.jedit.jEdit#newView(View,Buffer,boolean)
@see org.gjt.sp.jedit.jEdit#closeView(View)
@author Slava Pestov
@author John Gellene (API documentation)
@version $Id: View.java,v 1.111 2004/05/06 22:35:11 spestov Exp $
Each View
implementation must have a constructor that takes an ApplicationWindow
as its single argument.
@author Torgil Zethson
Represents the renderable view in the model-view-controller pattern. Users can create their own renderable views by implementing this class, and returning a concrete instance in an action method.
@author Luis AntunesView implementations may differ widely. An obvious implementation would be JSP-based. Other implementations might be XSLT-based, or use an HTML generation library. This interface is designed to avoid restricting the range of possible implementations.
Views should be beans. They are likely to be instantiated as beans by a ViewResolver. As this interface is stateless, view implementations should be thread-safe. @author Rod Johnson @author Arjen Poutsma @see org.springframework.web.servlet.view.AbstractView @see org.springframework.web.servlet.view.InternalResourceView
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|