📄 viewer.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Fri Apr 18 11:17:03 PDT 2003 --><TITLE>Viewer (Java 3D API)</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"></HEAD><SCRIPT>function asd(){parent.document.title="Viewer (Java 3D API)";}</SCRIPT><BODY BGCOLOR="white" onload="asd();"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/sun/j3d/utils/universe/SimpleUniverse.html"><B>PREV CLASS</B></A> <A HREF="../../../../../com/sun/j3d/utils/universe/ViewerAvatar.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Viewer.html" TARGET="_top"><B>NO FRAMES</B></A> <SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT><A HREF="../../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">com.sun.j3d.utils.universe</FONT><BR>Class Viewer</H2><PRE>java.lang.Object | +--<B>com.sun.j3d.utils.universe.Viewer</B></PRE><HR><DL><DT>public class <B>Viewer</B><DT>extends java.lang.Object</DL><P>The Viewer class holds all the information that describes the physical and virtual "presence" in the Java 3D universe. The Viewer object consists of: <UL> <LI>Physical Objects</LI> <UL> <LI>Canvas3D's - used to render with.</LI> <LI>PhysicalEnvironment - holds characteristics of the hardware platform being used to render on.</LI> <LI>PhysicalBody - holds the physical characteristics and personal preferences of the person who will be viewing the Java 3D universe.</LI> </UL> <LI>Virtual Objects</LI> <UL> <LI>View - the Java 3D View object.</LI> <LI>ViewerAvatar - the geometry that is used by Java 3D to represent the person viewing the Java 3D universe.</LI> </UL> </UL> If the Viewer object is created without any Canvas3D's, or indirectly through a configuration file, it will create the Canvas3D's as needed. The default Viewer creates one Canvas3D. If the Viewer object creates the Canvas3D's, it will also create a JPanel and JFrame for each Canvas3D. Dynamic video resize is a new feature in Java 3D 1.3.1. This feature provides a means for doing swap synchronous resizing of the area that is to be magnified (or passed through) to the output video resolution. This functionality allows an application to draw into a smaller viewport in the framebuffer in order to reduce the time spent doing pixel fill. The reduced size viewport is then magnified up to the video output resolution using the SUN_video_resize extension. This extension is only implemented in XVR-4000 and later hardware with back end video out resizing capability. If video size compensation is enable, the line widths, point sizes and pixel operations will be scaled internally with the resize factor to approximately compensate for video resizing. The location of the pixel ( x, y ) in the resized framebuffer = ( floor( x * factor + 0.5 ), floor( y * factor + 0.5 ) ) <p><P><P><DL><DT><B>See Also:</B><DD><A HREF="../../../../../javax/media/j3d/Canvas3D.html"><CODE>Canvas3D</CODE></A>, <A HREF="../../../../../javax/media/j3d/PhysicalEnvironment.html"><CODE>PhysicalEnvironment</CODE></A>, <A HREF="../../../../../javax/media/j3d/PhysicalBody.html"><CODE>PhysicalBody</CODE></A>, <A HREF="../../../../../javax/media/j3d/View.html"><CODE>View</CODE></A>, <A HREF="../../../../../com/sun/j3d/utils/universe/ViewerAvatar.html"><CODE>ViewerAvatar</CODE></A></DL><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#Viewer()">Viewer</A></B>()</CODE><BR> Creates a default viewer object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#Viewer(javax.media.j3d.Canvas3D)">Viewer</A></B>(<A HREF="../../../../../javax/media/j3d/Canvas3D.html">Canvas3D</A> userCanvas)</CODE><BR> Creates a default viewer object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#Viewer(javax.media.j3d.Canvas3D[])">Viewer</A></B>(<A HREF="../../../../../javax/media/j3d/Canvas3D.html">Canvas3D</A>[] userCanvases)</CODE><BR> Creates a default viewer object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#Viewer(javax.media.j3d.Canvas3D[], javax.media.j3d.PhysicalBody, javax.media.j3d.PhysicalEnvironment, boolean)">Viewer</A></B>(<A HREF="../../../../../javax/media/j3d/Canvas3D.html">Canvas3D</A>[] userCanvases, <A HREF="../../../../../javax/media/j3d/PhysicalBody.html">PhysicalBody</A> userBody, <A HREF="../../../../../javax/media/j3d/PhysicalEnvironment.html">PhysicalEnvironment</A> userEnvironment, boolean setVisible)</CODE><BR> Creates a viewer object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#Viewer(javax.media.j3d.Canvas3D, java.net.URL)">Viewer</A></B>(<A HREF="../../../../../javax/media/j3d/Canvas3D.html">Canvas3D</A> userCanvas, java.net.URL userConfig)</CODE><BR> <B>Deprecated.</B> <I>create a ConfiguredUniverse to use a configuration file</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#Viewer(java.net.URL)">Viewer</A></B>(java.net.URL userConfig)</CODE><BR> <B>Deprecated.</B> <I>create a ConfiguredUniverse to use a configuration file</I></TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#clearViewerMap()">clearViewerMap</A></B>()</CODE><BR> Removes all Viewer mappings from the Viewer map.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../../javax/media/j3d/AudioDevice.html">AudioDevice</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#createAudioDevice()">createAudioDevice</A></B>()</CODE><BR> Used to create and initialize a default AudioDevice3D used for sound rendering.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../../com/sun/j3d/utils/universe/ViewerAvatar.html">ViewerAvatar</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getAvatar()">getAvatar</A></B>()</CODE><BR> Gets the geometry associated with the viewer's avatar.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../../javax/media/j3d/Canvas3D.html">Canvas3D</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getCanvas3D()">getCanvas3D</A></B>()</CODE><BR> Returns the 0th Canvas3D object associated with this Viewer object</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../../javax/media/j3d/Canvas3D.html">Canvas3D</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getCanvas3D(int)">getCanvas3D</A></B>(int canvasNum)</CODE><BR> Returns the Canvas3D object at the specified index associated with this Viewer object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../../javax/media/j3d/Canvas3D.html">Canvas3D</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getCanvas3Ds()">getCanvas3Ds</A></B>()</CODE><BR> Returns all the Canvas3D objects associated with this Viewer object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../../javax/media/j3d/Canvas3D.html">Canvas3D</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getCanvases()">getCanvases</A></B>()</CODE><BR> <B>Deprecated.</B> <I>superceded by getCanvas3D()</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> float</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getDvrFactor()">getDvrFactor</A></B>()</CODE><BR> Retrieves the dynamic video resize factor of this viewer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getDvrResizeCompensationEnable()">getDvrResizeCompensationEnable</A></B>()</CODE><BR> Returns a status flag indicating whether or not dynamic video resize compensation is enabled.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.awt.Frame</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getFrame()">getFrame</A></B>()</CODE><BR> <B>Deprecated.</B> <I>AWT Frame components are no longer created by the Viewer class.</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> javax.swing.JFrame</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getJFrame(int)">getJFrame</A></B>(int frameNum)</CODE><BR> Returns the JFrame object created by this Viewer object at the specified index.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> javax.swing.JFrame[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getJFrames()">getJFrames</A></B>()</CODE><BR> Returns all the JFrames created by this Viewer object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> javax.swing.JPanel</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getJPanel(int)">getJPanel</A></B>(int panelNum)</CODE><BR> Returns the JPanel object created by this Viewer object at the specified index.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> javax.swing.JPanel[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getJPanels()">getJPanels</A></B>()</CODE><BR> Returns all the JPanel objects created by this Viewer object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.awt.Panel</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getPanel()">getPanel</A></B>()</CODE><BR> <B>Deprecated.</B> <I>AWT Panel components are no longer created by the Viewer class.</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../../javax/media/j3d/PhysicalBody.html">PhysicalBody</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getPhysicalBody()">getPhysicalBody</A></B>()</CODE><BR> Returns the PhysicalBody object associated with the Viewer object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../../javax/media/j3d/PhysicalEnvironment.html">PhysicalEnvironment</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getPhysicalEnvironment()">getPhysicalEnvironment</A></B>()</CODE><BR> Returns the PhysicalEnvironment object associated with the Viewer object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../../com/sun/j3d/utils/universe/SimpleUniverse.html">SimpleUniverse</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getUniverse()">getUniverse</A></B>()</CODE><BR> Returns the Universe to which this Viewer is attached</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../../javax/media/j3d/View.html">View</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getView()">getView</A></B>()</CODE><BR> Returns the View object associated with the Viewer object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html">Viewer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getViewer(javax.media.j3d.View)">getViewer</A></B>(<A HREF="../../../../../javax/media/j3d/View.html">View</A> view)</CODE><BR> Get the Viewer associated with the view object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../../com/sun/j3d/utils/universe/ViewingPlatform.html">ViewingPlatform</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#getViewingPlatform()">getViewingPlatform</A></B>()</CODE><BR> Get the ViewingPlatform object used by this Viewer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/universe/Viewer.html#isDvrEnabled()">isDvrEnabled</A></B>()</CODE><BR> Returns a status flag indicating whether or not dynamic video size
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -