├── COPYRIGHT.txt ├── LICENSE.txt ├── README-FIRST.txt ├── README-build.html ├── THIRDPARTY-LICENSE-DISTANCE.txt ├── THIRDPARTY-LICENSE-FIST.txt ├── THIRDPARTY-LICENSE-MAINFRAME.txt ├── build.xml └── src ├── META-INF └── services │ └── javax.media.j3d.GeometryService └── com └── sun └── j3d ├── ExceptionStrings.properties ├── audioengines ├── AudioEngine.java ├── AudioEngine3D.java ├── AudioEngine3DL2.java ├── AudioEngineThread.java ├── AuralParameters.java ├── Sample.java ├── javasound │ ├── JSAuralParameters.java │ ├── JSChannel.java │ ├── JSClip.java │ ├── JSDirectionalSample.java │ ├── JSMidi.java │ ├── JSPositionalSample.java │ ├── JSSample.java │ ├── JSStream.java │ ├── JSThread.java │ ├── JavaSoundMixer.java │ └── package.html └── package.html ├── exp └── swing │ ├── JCanvas3D.java │ ├── impl │ └── AutoOffScreenCanvas3D.java │ └── package.html ├── internal ├── BufferWrapper.java ├── ByteBufferWrapper.java ├── Distance.java ├── DoubleBufferWrapper.java ├── FastVector.java ├── FloatBufferWrapper.java ├── HashCodeUtil.java └── J3dUtilsI18N.java ├── loaders ├── IncorrectFormatException.java ├── Loader.java ├── LoaderBase.java ├── ParsingErrorException.java ├── Scene.java ├── SceneBase.java ├── lw3d │ ├── DebugOutput.java │ ├── EnvelopeHandler.java │ ├── FloatValueInterpolator.java │ ├── ImageScaler.java │ ├── J3dLwoParser.java │ ├── LWOBFileReader.java │ ├── LightIntensityPathInterpolator.java │ ├── Lw3dLoader.java │ ├── LwLightObject.java │ ├── LwoParser.java │ ├── LwoSurface.java │ ├── LwoTexture.java │ ├── LwsBackground.java │ ├── LwsCamera.java │ ├── LwsEnvelope.java │ ├── LwsEnvelopeFrame.java │ ├── LwsEnvelopeLightIntensity.java │ ├── LwsFog.java │ ├── LwsFrame.java │ ├── LwsLight.java │ ├── LwsMotion.java │ ├── LwsObject.java │ ├── LwsPrimitive.java │ ├── ParserObject.java │ ├── SequenceLine.java │ ├── SequenceReader.java │ ├── ShapeHolder.java │ ├── SwitchPathInterpolator.java │ ├── TargaReader.java │ ├── TextfileParser.java │ └── package.html ├── objectfile │ ├── DefaultMaterials.java │ ├── ObjectFile.java │ ├── ObjectFileMaterials.java │ ├── ObjectFileParser.java │ ├── RgbFile.java │ └── package.html └── package.html └── utils ├── applet ├── JMainFrame.java ├── MainFrame.java └── package.html ├── audio ├── DistanceAttenuation.java └── package.html ├── behaviors ├── interpolators │ ├── CubicSplineCurve.java │ ├── CubicSplineSegment.java │ ├── KBCubicSplineCurve.java │ ├── KBCubicSplineSegment.java │ ├── KBKeyFrame.java │ ├── KBRotPosScaleSplinePathInterpolator.java │ ├── KBSplinePathInterpolator.java │ ├── RotPosScaleTCBSplinePathInterpolator.java │ ├── TCBKeyFrame.java │ ├── TCBSplinePathInterpolator.java │ └── package.html ├── keyboard │ ├── KeyNavigator.java │ ├── KeyNavigatorBehavior.java │ └── package.html ├── mouse │ ├── MouseBehavior.java │ ├── MouseBehaviorCallback.java │ ├── MouseRotate.java │ ├── MouseTranslate.java │ ├── MouseWheelZoom.java │ ├── MouseZoom.java │ └── package.html ├── picking │ ├── Intersect.java │ ├── PickMouseBehavior.java │ ├── PickObject.java │ ├── PickRotateBehavior.java │ ├── PickTranslateBehavior.java │ ├── PickZoomBehavior.java │ ├── PickingCallback.java │ └── package.html ├── sensor │ ├── Mouse6DPointerBehavior.java │ ├── SensorBeamEcho.java │ ├── SensorButtonListener.java │ ├── SensorEvent.java │ ├── SensorEventAgent.java │ ├── SensorGnomonEcho.java │ ├── SensorInputAdaptor.java │ ├── SensorReadListener.java │ └── package.html └── vp │ ├── OrbitBehavior.java │ ├── ViewPlatformAWTBehavior.java │ ├── ViewPlatformBehavior.java │ ├── WandViewBehavior.java │ └── package.html ├── compression ├── CommandStream.java ├── CompressedGeometryFile.java ├── CompressionStream.java ├── CompressionStreamColor.java ├── CompressionStreamElement.java ├── CompressionStreamNormal.java ├── CompressionStreamVertex.java ├── GeometryCompressor.java ├── HuffmanNode.java ├── HuffmanTable.java ├── MeshBuffer.java └── package.html ├── geometry ├── BBox.java ├── Basic.java ├── BottleNeck.java ├── Box.java ├── Bridge.java ├── Clean.java ├── ColorCube.java ├── Cone.java ├── Cylinder.java ├── Degenerate.java ├── Desperate.java ├── Distance.java ├── EarClip.java ├── Edge.java ├── EdgeTable.java ├── GeomBuffer.java ├── GeometryInfo.java ├── GeometryInfoGenerator.java ├── GeometryServiceImpl.java ├── Heap.java ├── HeapNode.java ├── Left.java ├── ListNode.java ├── NoHash.java ├── NormalGenerator.java ├── Numerics.java ├── Orientation.java ├── PntNode.java ├── Primitive.java ├── Project.java ├── Quadrics.java ├── Simple.java ├── Sphere.java ├── Stripifier.java ├── StripifierStats.java ├── Text2D.java ├── Triangle.java ├── Triangulator.java ├── compression │ ├── CommandStream.java │ ├── CompressedGeometryData.java │ ├── CompressedGeometryFile.java │ ├── CompressedGeometryRetained.java │ ├── CompressionStream.java │ ├── CompressionStreamColor.java │ ├── CompressionStreamElement.java │ ├── CompressionStreamNormal.java │ ├── CompressionStreamVertex.java │ ├── GeneralizedStrip.java │ ├── GeneralizedStripFlags.java │ ├── GeneralizedVertexList.java │ ├── GeometryCompressor.java │ ├── GeometryDecompressor.java │ ├── GeometryDecompressorShape3D.java │ ├── HuffmanNode.java │ ├── HuffmanTable.java │ ├── MeshBuffer.java │ └── package.html └── package.html ├── image ├── ImageException.java ├── TextureLoader.java └── package.html ├── pickfast ├── PickCanvas.java ├── PickIntersection.java ├── PickTool.java ├── behaviors │ ├── PickMouseBehavior.java │ ├── PickRotateBehavior.java │ ├── PickTranslateBehavior.java │ ├── PickZoomBehavior.java │ ├── PickingCallback.java │ └── package.html └── package.html ├── picking ├── PickCanvas.java ├── PickIntersection.java ├── PickResult.java ├── PickTool.java ├── behaviors │ ├── PickMouseBehavior.java │ ├── PickRotateBehavior.java │ ├── PickTranslateBehavior.java │ ├── PickZoomBehavior.java │ ├── PickingCallback.java │ └── package.html └── package.html ├── scenegraph ├── io │ ├── NamedObjectException.java │ ├── ObjectNotLoadedException.java │ ├── SceneGraphFileReader.java │ ├── SceneGraphFileWriter.java │ ├── SceneGraphIO.java │ ├── SceneGraphObjectReferenceControl.java │ ├── SceneGraphStateProvider.java │ ├── SceneGraphStreamReader.java │ ├── SceneGraphStreamWriter.java │ ├── UnresolvedBehavior.java │ ├── UnsupportedUniverseException.java │ ├── doc-files │ │ └── extensibility.html │ ├── package.html │ ├── retained │ │ ├── Controller.java │ │ ├── J3fInputStream.java │ │ ├── J3fOutputStream.java │ │ ├── PositionInputStream.java │ │ ├── PositionOutputStream.java │ │ ├── RandomAccessFileControl.java │ │ ├── SGIORuntimeException.java │ │ ├── StreamControl.java │ │ ├── SymbolTable.java │ │ └── SymbolTableData.java │ └── state │ │ ├── com │ │ └── sun │ │ │ └── j3d │ │ │ └── utils │ │ │ ├── behaviors │ │ │ ├── interpolators │ │ │ │ ├── KBRotPosScaleSplinePathInterpolatorState.java │ │ │ │ └── RotPosScaleTCBSplinePathInterpolatorState.java │ │ │ └── mouse │ │ │ │ └── MouseBehaviorState.java │ │ │ ├── geometry │ │ │ ├── BoxState.java │ │ │ ├── ColorCubeState.java │ │ │ ├── ConeState.java │ │ │ ├── CylinderState.java │ │ │ ├── PrimitiveState.java │ │ │ ├── SphereState.java │ │ │ └── Text2DState.java │ │ │ ├── image │ │ │ ├── ImageComponent2DURL.java │ │ │ ├── ImageComponent2DURLIOListener.java │ │ │ └── ImageComponent2DURLState.java │ │ │ └── universe │ │ │ ├── PlatformGeometryState.java │ │ │ ├── SimpleUniverseState.java │ │ │ └── ViewerAvatarState.java │ │ └── javax │ │ └── media │ │ └── j3d │ │ ├── AlphaState.java │ │ ├── AlternateAppearanceState.java │ │ ├── AmbientLightState.java │ │ ├── AppearanceState.java │ │ ├── AuralAttributesState.java │ │ ├── BackgroundSoundState.java │ │ ├── BackgroundState.java │ │ ├── BehaviorState.java │ │ ├── BillboardState.java │ │ ├── BoundingLeafState.java │ │ ├── BranchGroupState.java │ │ ├── ClipState.java │ │ ├── ColorInterpolatorState.java │ │ ├── ColoringAttributesState.java │ │ ├── CompressedGeometryState.java │ │ ├── ConeSoundState.java │ │ ├── DecalGroupState.java │ │ ├── DepthComponentFloatState.java │ │ ├── DepthComponentIntState.java │ │ ├── DepthComponentNativeState.java │ │ ├── DirectionalLightState.java │ │ ├── DistanceLODState.java │ │ ├── ExponentialFogState.java │ │ ├── FogState.java │ │ ├── Font3DState.java │ │ ├── GeometryArrayState.java │ │ ├── GeometryState.java │ │ ├── GeometryStripArrayState.java │ │ ├── GroupState.java │ │ ├── ImageComponent2DState.java │ │ ├── ImageComponent3DState.java │ │ ├── ImageComponentState.java │ │ ├── IndexedGeometryArrayState.java │ │ ├── IndexedGeometryStripArrayState.java │ │ ├── IndexedLineArrayState.java │ │ ├── IndexedLineStripArrayState.java │ │ ├── IndexedPointArrayState.java │ │ ├── IndexedQuadArrayState.java │ │ ├── IndexedTriangleArrayState.java │ │ ├── IndexedTriangleFanArrayState.java │ │ ├── IndexedTriangleStripArrayState.java │ │ ├── InterpolatorState.java │ │ ├── LODState.java │ │ ├── LeafState.java │ │ ├── LightState.java │ │ ├── LineArrayState.java │ │ ├── LineAttributesState.java │ │ ├── LineStripArrayState.java │ │ ├── LinearFogState.java │ │ ├── LinkState.java │ │ ├── MaterialState.java │ │ ├── MediaContainerState.java │ │ ├── ModelClipState.java │ │ ├── MorphState.java │ │ ├── NodeComponentState.java │ │ ├── NodeState.java │ │ ├── NullSceneGraphObjectState.java │ │ ├── OrderedGroupState.java │ │ ├── OrientedShape3DState.java │ │ ├── PathInterpolatorState.java │ │ ├── PointAttributesState.java │ │ ├── PointLightState.java │ │ ├── PointSoundState.java │ │ ├── PolygonAttributesState.java │ │ ├── PositionInterpolatorState.java │ │ ├── PositionPathInterpolatorState.java │ │ ├── QuadArrayState.java │ │ ├── RasterState.java │ │ ├── RenderingAttributesState.java │ │ ├── RotPosPathInterpolatorState.java │ │ ├── RotPosScalePathInterpolatorState.java │ │ ├── RotationInterpolatorState.java │ │ ├── RotationPathInterpolatorState.java │ │ ├── ScaleInterpolatorState.java │ │ ├── SceneGraphObjectState.java │ │ ├── Shape3DState.java │ │ ├── SharedGroupState.java │ │ ├── SoundState.java │ │ ├── SoundscapeState.java │ │ ├── SpotLightState.java │ │ ├── SwitchState.java │ │ ├── SwitchValueInterpolatorState.java │ │ ├── TexCoordGenerationState.java │ │ ├── Text3DState.java │ │ ├── Texture2DState.java │ │ ├── Texture3DState.java │ │ ├── TextureAttributesState.java │ │ ├── TextureCubeMapState.java │ │ ├── TextureState.java │ │ ├── TextureUnitStateState.java │ │ ├── TransformGroupState.java │ │ ├── TransformInterpolatorState.java │ │ ├── TransparencyAttributesState.java │ │ ├── TransparencyInterpolatorState.java │ │ ├── TriangleArrayState.java │ │ ├── TriangleFanArrayState.java │ │ ├── TriangleStripArrayState.java │ │ └── ViewPlatformState.java └── transparency │ ├── SimpleDistanceComparator.java │ ├── TransparencySortController.java │ └── package.html ├── shader ├── StringIO.java └── package.html └── universe ├── ConfigCommand.java ├── ConfigContainer.java ├── ConfigDevice.java ├── ConfigObject.java ├── ConfigPhysicalBody.java ├── ConfigPhysicalEnvironment.java ├── ConfigScreen.java ├── ConfigSensor.java ├── ConfigSexpression.java ├── ConfigView.java ├── ConfigViewPlatform.java ├── ConfigViewPlatformBehavior.java ├── ConfiguredUniverse.java ├── LocaleFactory.java ├── MultiTransformGroup.java ├── PlatformGeometry.java ├── SimpleUniverse.java ├── ViewInfo.java ├── Viewer.java ├── ViewerAvatar.java ├── ViewingPlatform.java ├── doc-files ├── config-examples.html ├── config-syntax.html ├── j3d1x1-behavior.html ├── j3d1x1-stereo.html ├── j3d1x1-vr.html ├── j3d1x1-window.html ├── j3d1x1.html ├── j3d1x2-flat.html ├── j3d1x2-rot30.html ├── j3d1x3-cave-vr.html ├── j3d1x3-cave.html ├── j3d1x3-rot45.html └── j3d2x2-flat.html └── package.html /COPYRIGHT.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hharrison/java3d-utils/0d39448522b11731a8d03e4a944c235478b14de0/COPYRIGHT.txt -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | - Redistribution of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | - Redistribution in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the 13 | distribution. 14 | 15 | Neither the name of Sun Microsystems, Inc. or the names of 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | This software is provided "AS IS," without a warranty of any 20 | kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 21 | WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 23 | EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 24 | NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 25 | USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 26 | DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 27 | ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 28 | CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 29 | REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 30 | INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGES. 32 | 33 | You acknowledge that this software is not designed, licensed or 34 | intended for use in the design, construction, operation or 35 | maintenance of any nuclear facility. 36 | -------------------------------------------------------------------------------- /README-FIRST.txt: -------------------------------------------------------------------------------- 1 | The source code for the j3d-core-utils project is copyrighted code 2 | that is licensed to individuals or companies who download or otherwise 3 | access the code. 4 | 5 | The copyright notice for this project is in COPYRIGHT.txt 6 | 7 | The source code license information for this project is in LICENSE.txt 8 | 9 | Additional information and license restrictions for third party source 10 | code are found in the THIRDPARTY-LICENSE-*.txt files. 11 | 12 | Instructions for building this project are in README-build.html 13 | -------------------------------------------------------------------------------- /README-build.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 49 | 51 |The j3d-core-utils project is built as part of the j3d-core
57 | project. See the README-build.html
58 | file in the "j3d-core" directory for instructions.
59 |
47 | * NOTE: This class is not yet implemented. 48 | */ 49 | 50 | class JSMidi extends JSChannel { 51 | private static boolean warningReported = false; 52 | 53 | JSMidi() { 54 | // Report a "not implemented" warning message 55 | if (!warningReported) { 56 | System.err.println("***"); 57 | System.err.println("*** WARNING: JavaSoundMixer: MIDI sound not implemented"); 58 | System.err.println("***"); 59 | warningReported = true; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/com/sun/j3d/audioengines/javasound/JSStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.audioengines.javasound; 41 | 42 | /** 43 | * The JSStream class defines audio output methods that call the JavaSound 44 | * API methods for streams. 45 | * 46 | *
47 | * NOTE: This class is not yet implemented. 48 | */ 49 | 50 | class JSStream extends JSChannel { 51 | private static boolean warningReported = false; 52 | 53 | JSStream() { 54 | // Report a "not implemented" warning message 55 | if (!warningReported) { 56 | System.err.println("***"); 57 | System.err.println("*** WARNING: JavaSoundMixer: Streaming (uncached) audio not implemented"); 58 | System.err.println("***"); 59 | warningReported = true; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/com/sun/j3d/audioengines/javasound/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 6 |Provides a JavaSound-based implementation of a Java 3D audio device.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/audioengines/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |Provides abstract classes for creating Java 3D audio devices.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/exp/swing/impl/AutoOffScreenCanvas3D.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.exp.swing.impl; 41 | 42 | /** 43 | * Tagging interface for Java 3D off-screen Canvas3D objects that are 44 | * automatically rendered. This is used internally by the JCanvas3D 45 | * implementation. 46 | *47 | * NOTE: this is an experimental interface, which is not intended for use 48 | * by applications. 49 | * 50 | * @author pepe 51 | * 52 | * @since Java 3D 1.5 53 | */ 54 | public interface AutoOffScreenCanvas3D extends javax.media.j3d.AutoOffScreenCanvas3D {} 55 | -------------------------------------------------------------------------------- /src/com/sun/j3d/exp/swing/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 6 |EXPERIMENTAL: Provides a lightweight JCanvas3D class. 10 | Note that the API in this package is highly experimental and 11 | subject to change at any time.
12 | 13 | 14 | -------------------------------------------------------------------------------- /src/com/sun/j3d/internal/J3dUtilsI18N.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.internal; 41 | 42 | import java.util.MissingResourceException; 43 | import java.util.ResourceBundle; 44 | 45 | 46 | public class J3dUtilsI18N { 47 | static public String getString(String key) { 48 | String s; 49 | try { 50 | s = ResourceBundle.getBundle("com.sun.j3d.ExceptionStrings").getString(key); 51 | } 52 | catch (MissingResourceException e) { 53 | System.err.println("J3dUtilsI18N: Error looking up: " + key); 54 | s = key; 55 | } 56 | return s; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/IncorrectFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.loaders; 41 | 42 | 43 | /** 44 | * Exception used to indicate that a file of the incorrect 45 | * type was passed to a loader. 46 | */ 47 | public class IncorrectFormatException extends RuntimeException { 48 | 49 | public IncorrectFormatException() { 50 | super(); 51 | } 52 | 53 | public IncorrectFormatException(String s) { 54 | super(s); 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/ParsingErrorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.loaders; 41 | 42 | 43 | /** 44 | * Exception used to indicate that the loader encountered 45 | * a problem parsing the specified file. 46 | */ 47 | public class ParsingErrorException extends RuntimeException { 48 | 49 | public ParsingErrorException() { 50 | super(); 51 | } 52 | 53 | public ParsingErrorException(String s) { 54 | super(s); 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/lw3d/DebugOutput.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.loaders.lw3d; 41 | 42 | 43 | /** 44 | * This class has utility functions for printing out debugging information. 45 | */ 46 | 47 | class DebugOutput { 48 | 49 | int validOutput = 0; 50 | final static int TRACE = 1, VALUES = 2, MISC = 4, LINE_TRACE = 8; 51 | final static int NONE = 0, EXCEPTION = 16, TIME = 32, WARNING = 64; 52 | 53 | DebugOutput(int outputTypes) { 54 | validOutput = outputTypes; 55 | } 56 | 57 | void setValidOutput(int outputTypes) { 58 | validOutput = outputTypes; 59 | } 60 | 61 | int getValidOutput() { 62 | return validOutput; 63 | } 64 | 65 | void print(int outputType, String theOutput) { 66 | if ((outputType & validOutput) > 0) { 67 | System.out.print(theOutput); 68 | } 69 | } 70 | 71 | void println(int outputType, String theOutput) { 72 | if ((outputType & validOutput) > 0) 73 | System.out.println(theOutput); 74 | } 75 | 76 | } 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/lw3d/LwsPrimitive.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.loaders.lw3d; 41 | 42 | 43 | 44 | import java.util.Vector; 45 | 46 | import javax.media.j3d.TransformGroup; 47 | 48 | /** 49 | * This is an interface which is implemented by LwsObject, 50 | * LwsFog, LwsBackground, LwsLight, etc. It provides a generic method 51 | * for objects to access some of the common data in these classes. 52 | */ 53 | 54 | interface LwsPrimitive { 55 | 56 | // interface from which other Lws types (Object, Camera, etc.) 57 | // inherit methods 58 | 59 | public Vector getObjectBehaviors(); 60 | 61 | public TransformGroup getObjectNode(); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/lw3d/ParserObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.loaders.lw3d; 41 | 42 | /** 43 | * This class is a superclass of the binary parsing classes. It provides 44 | * some basic debugging utilities. 45 | */ 46 | 47 | class ParserObject { 48 | 49 | 50 | final static int TRACE = DebugOutput.TRACE, VALUES = DebugOutput.VALUES; 51 | final static int MISC = DebugOutput.MISC, LINE_TRACE = DebugOutput.LINE_TRACE; 52 | final static int NONE = DebugOutput.NONE, EXCEPTION = DebugOutput.EXCEPTION; 53 | final static int TIME = DebugOutput.TIME, WARNING = DebugOutput.WARNING; 54 | 55 | protected DebugOutput debugPrinter; 56 | 57 | 58 | ParserObject() { 59 | debugPrinter = new DebugOutput(EXCEPTION); 60 | } 61 | 62 | ParserObject(int debugVals) { 63 | this(); 64 | debugPrinter.setValidOutput(debugVals); 65 | } 66 | 67 | 68 | protected void debugOutputLn(int outputType, String theOutput) { 69 | if (theOutput.equals("")) 70 | debugPrinter.println(outputType, theOutput); 71 | else 72 | debugPrinter.println(outputType, 73 | getClass().getName() + "::" + theOutput); 74 | } 75 | 76 | protected void debugOutput(int outputType, String theOutput) { 77 | debugPrinter.print(outputType, theOutput); 78 | } 79 | 80 | 81 | 82 | } 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/lw3d/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |Provides a Java 3D loader for Lightwave 3D scene files.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/objectfile/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |Provides a Java 3D loader for Wavefront .obj files.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |Provides interfaces and abstract classes for writing Java 3D loaders.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/applet/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |Provides utility classes for running applets as stand-alone 10 | applications.
11 | 12 | 13 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/audio/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |Provides audio utility classes.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/interpolators/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |Provides spline-based interpolation behaviors.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/keyboard/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |Provides keyboard navigation utility classes.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/mouse/MouseBehaviorCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.behaviors.mouse; 41 | 42 | import javax.media.j3d.Transform3D; 43 | 44 | /** 45 | * The MouseBehaviorCallback interface allows a class to be notified 46 | * when the transform is changed by one of the MouseBehaviors. The 47 | * class that is interested in transform changes implements this 48 | * interface, and the object created with that class is registered 49 | * with the desired subclass of MouseBehavior using the 50 | *setupCallback
method. When the transform changes, the
51 | * registered object's transformChanged
method is
52 | * invoked.
53 | */
54 |
55 | public interface MouseBehaviorCallback {
56 |
57 | public final static int ROTATE=0;
58 | public final static int TRANSLATE=1;
59 | public final static int ZOOM=2;
60 |
61 | /**
62 | * Classes implementing this interface that are registered with
63 | * one of the MouseBehaviors will be called every time the
64 | * behavior updates the Transform
65 | * @param type will be one of ROTATE, TRANSLATE or ZOOM
66 | */
67 | public void transformChanged( int type, Transform3D transform );
68 | }
69 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/behaviors/mouse/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 | Provides mouse navigation utility classes.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/picking/PickingCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.behaviors.picking; 41 | 42 | import javax.media.j3d.TransformGroup; 43 | 44 | /** 45 | * @deprecated As of Java 3D version 1.2, replaced by 46 | *com.sun.j3d.utils.picking.behaviors.PickingCallback
47 | *
48 | * @see com.sun.j3d.utils.picking.behaviors.PickingCallback
49 | */
50 |
51 | public interface PickingCallback {
52 |
53 | public final static int ROTATE=0;
54 | public final static int TRANSLATE=1;
55 | public final static int ZOOM=2;
56 |
57 | /**
58 | * The user made a selection but nothing was
59 | * actually picked
60 | */
61 | public final static int NO_PICK=3;
62 |
63 | /**
64 | * Called by the Pick Behavior with which this callback
65 | * is registered each time the Picked object is moved
66 | */
67 | public void transformChanged( int type, TransformGroup tg );
68 | }
69 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/behaviors/picking/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 | Deprecated: Use com.sun.j3d.utils.pickfast.behaviors
11 | instead.
SensorEventAgent
instance.
45 | *
46 | * The events passed to this listener's methods are ephemeral; they
47 | * are only valid until the listener has returned. If a listener needs to
48 | * retain the event it must be copied using the
49 | * SensorEvent(SensorEvent)
constructor.
50 | *
51 | * @see SensorEvent
52 | * @see SensorEventAgent
53 | * @see SensorButtonListener
54 | * @since Java 3D 1.3
55 | */
56 | public interface SensorReadListener {
57 | /**
58 | * This method is called each time the dispatchEvents
59 | * method of SensorEventAgent
is called and none of a
60 | * sensor's buttons have been handled by a button listener. The
61 | * sensor read value has not necessarily changed since the last read
62 | * event.
63 | *
64 | * @param e the sensor event
65 | */
66 | public void read(SensorEvent e) ;
67 | }
68 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/behaviors/sensor/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Provides 6DOF sensor behavior classes.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/vp/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |Provides ViewPlatform navigation utility classes.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/compression/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |Deprecated: Use com.sun.j3d.utils.geometry.compression
11 | instead.
Provides compressed geometry utility classes. 10 | This package supersedes the javax.media.j3d.CompressedGeometry class and 11 | the com.sun.j3d.utils.compression package.
12 | 13 | 14 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/geometry/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |Provides geometry construction, triangulation, and optimization 10 | utility classes.
11 | 12 | 13 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/image/ImageException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.image; 41 | 42 | 43 | /** 44 | * Exception used to indicate that the texture loader encountered 45 | * a problem loading the specified image file. 46 | */ 47 | public class ImageException extends RuntimeException { 48 | 49 | public ImageException() { 50 | super(); 51 | } 52 | 53 | public ImageException(String s) { 54 | super(s); 55 | } 56 | 57 | public ImageException(Throwable t) { 58 | super(t); 59 | } 60 | } 61 | 62 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/image/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |Provides texture image utility classes.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/pickfast/behaviors/PickingCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.pickfast.behaviors; 41 | 42 | import javax.media.j3d.TransformGroup; 43 | 44 | /** 45 | * The PickingCallback interface allows a class to be notified when a 46 | * picked object is moved. The class that is interested in object 47 | * movement implements this interface, and the object created with 48 | * that class is registered with the desired subclass of 49 | * PickMouseBehavior using thesetupCallback
method.
50 | * When the picked object moves, the registered object's
51 | * transformChanged
method is invoked.
52 | */
53 |
54 | public interface PickingCallback {
55 |
56 | public final static int ROTATE=0;
57 | public final static int TRANSLATE=1;
58 | public final static int ZOOM=2;
59 |
60 | /**
61 | * The user made a selection but nothing was
62 | * actually picked
63 | */
64 | public final static int NO_PICK=3;
65 |
66 | /**
67 | * Called by the Pick Behavior with which this callback
68 | * is registered each time the Picked object is moved
69 | */
70 | public void transformChanged( int type, TransformGroup tg );
71 | }
72 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/pickfast/behaviors/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 | Provides picking behaviors for the new core picking methods.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/pickfast/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |Provides picking utility classes for the new core picking methods.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/picking/behaviors/PickingCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.picking.behaviors; 41 | 42 | import javax.media.j3d.TransformGroup; 43 | 44 | /** 45 | * The PickingCallback interface allows a class to be notified when a 46 | * picked object is moved. The class that is interested in object 47 | * movement implements this interface, and the object created with 48 | * that class is registered with the desired subclass of 49 | * PickMouseBehavior using thesetupCallback
method.
50 | * When the picked object moves, the registered object's
51 | * transformChanged
method is invoked.
52 | */
53 |
54 | public interface PickingCallback {
55 |
56 | public final static int ROTATE=0;
57 | public final static int TRANSLATE=1;
58 | public final static int ZOOM=2;
59 |
60 | /**
61 | * The user made a selection but nothing was
62 | * actually picked
63 | */
64 | public final static int NO_PICK=3;
65 |
66 | /**
67 | * Called by the Pick Behavior with which this callback
68 | * is registered each time the Picked object is moved
69 | */
70 | public void transformChanged( int type, TransformGroup tg );
71 | }
72 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/picking/behaviors/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 | OBSOLETE: provides picking behaviors for the old picking 10 | methods.
11 | 12 | 13 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/picking/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |OBSOLETE: provides picking utility classes for the old 10 | picking methods.
11 | 12 | 13 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/NamedObjectException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io; 41 | 42 | /** 43 | * An error has occurred while processing a named object 44 | */ 45 | public class NamedObjectException extends java.lang.Exception { 46 | 47 | /** 48 | * Creates newNoSuchNameException
without detail message.
49 | */
50 | public NamedObjectException() {
51 | }
52 |
53 |
54 | /**
55 | * Constructs an NoSuchNameException
with the specified detail message.
56 | * @param msg the detail message.
57 | */
58 | public NamedObjectException(String msg) {
59 | super(msg);
60 | }
61 | }
62 |
63 |
64 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/ObjectNotLoadedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io;
41 |
42 | /**
43 | * The named object has not been loaded so it's instance can not be returned
44 | */
45 | public class ObjectNotLoadedException extends java.lang.Exception {
46 |
47 | /**
48 | * Creates new ObjectNotLoadedException
without detail message.
49 | */
50 | public ObjectNotLoadedException() {
51 | }
52 |
53 |
54 | /**
55 | * Constructs an ObjectNotLoadedException
with the specified detail message.
56 | * @param msg the detail message.
57 | */
58 | public ObjectNotLoadedException(String msg) {
59 | super(msg);
60 | }
61 | }
62 |
63 |
64 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/SceneGraphObjectReferenceControl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io;
41 |
42 | /**
43 | * Provides and resolves references to SceneGraphObjects to enable
44 | * persistant references in user defined SceneGraphObjects implementing
45 | * the SceneGraphIO interface.
46 | */
47 | public interface SceneGraphObjectReferenceControl {
48 |
49 | /**
50 | * Add a reference to the scenegraph object specified and return
51 | * the nodeID for the object
52 | *
53 | * Use only during the save cycle
54 | */
55 | public int addReference( javax.media.j3d.SceneGraphObject object );
56 |
57 | /**
58 | * Given a nodeID return the corresponding scene graph object.
59 | *
60 | * Use only during the load cycle
61 | */
62 | public javax.media.j3d.SceneGraphObject resolveReference( int nodeID );
63 | }
64 |
65 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/SceneGraphStateProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io;
41 |
42 | import com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.SceneGraphObjectState;
43 |
44 | /**
45 | * This interface allows developers to provide their own custom IO control for
46 | * subclasses of SceneGraphObjects. As the Scene Graph is being saved any
47 | * SceneGraphObject in the graph that implements this interface must provide
48 | * it's state class which is responsible for saving the entire state of
49 | * that object.
50 | */
51 | public interface SceneGraphStateProvider {
52 |
53 | /**
54 | * Returns the State class
55 | *
56 | * @return Class that will perform the IO for the SceneGraphObject
57 | */
58 | public Class extends SceneGraphObjectState> getStateClass();
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/UnresolvedBehavior.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io;
41 |
42 | /**
43 | * This Behavior is used in place of any behaviors which can not
44 | * be instantiated when a scene graph is read. This behavior is
45 | * always disabled when it initalizes. It just provides an indicator
46 | * in the scene graph that a Behavior is missing.
47 | *
48 | * This normally means the Behavior is not present in the classpath.
49 | */
50 | public class UnresolvedBehavior extends javax.media.j3d.Behavior {
51 |
52 | @Override
53 | public void initialize() {
54 | setEnable(false);
55 | }
56 |
57 | @Override
58 | public void processStimulus(java.util.Enumeration enumeration) {
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/UnsupportedUniverseException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io;
41 |
42 | /**
43 | * Thrown if the VirtualUniverse subclass is not supported
44 | * by the writeUniverse calls.
45 | *
46 | * Currently only com.sun.j3d.utils.universe.SimpleUniverse is supported
47 | */
48 | public class UnsupportedUniverseException extends java.lang.Exception {
49 |
50 | /**
51 | * Creates new UnsupportedUniverseException
without detail message.
52 | */
53 | public UnsupportedUniverseException() {
54 | }
55 |
56 |
57 | /**
58 | * Constructs an UnsupportedUniverseException
with the specified detail message.
59 | * @param msg the detail message.
60 | */
61 | public UnsupportedUniverseException(String msg) {
62 | super(msg);
63 | }
64 | }
65 |
66 |
67 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/retained/PositionOutputStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.retained;
41 |
42 | import java.io.IOException;
43 |
44 | class PositionOutputStream extends java.io.OutputStream {
45 |
46 | private long pos = 0;
47 | private java.io.OutputStream stream;
48 |
49 | public PositionOutputStream( java.io.OutputStream stream ) {
50 | this.stream = stream;
51 | }
52 |
53 | @Override
54 | public void write(int p1) throws IOException {
55 | pos++;
56 | stream.write(p1);
57 | }
58 |
59 | @Override
60 | public void write( byte[] b ) throws IOException {
61 | pos+= b.length;
62 | stream.write( b );
63 | }
64 |
65 | @Override
66 | public void write( byte[] b, int off, int len ) throws IOException {
67 | pos+= len;
68 | stream.write( b, off, len );
69 | }
70 |
71 | /**
72 | * Move the file pointer to the specified position.
73 | * The position MUST be greater or equal to the current position
74 | */
75 | public void seekForward( long position ) throws IOException {
76 | if (pos>position)
77 | throw new SGIORuntimeException( "Seeking Backward "+pos +" "+position );
78 | else
79 | for(int i=0; i< (int)(position-pos); i++)
80 | stream.write(0);
81 |
82 | pos = position;
83 | }
84 |
85 | public long getFilePointer() {
86 | return pos;
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/retained/SGIORuntimeException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.retained;
41 |
42 | /**
43 | * This RuntimeException encapsulates a number of RuntimeErrors in the
44 | * IO system.
45 | *
46 | * This exception is always wrapped and thrown to the user as an IOException. In
47 | * the future this exception will be removed and the code will throw IOExceptions
48 | * internally instead.
49 | */
50 | public class SGIORuntimeException extends java.lang.RuntimeException {
51 |
52 | /**
53 | * Constructs a new instance of SGIORuntimeException
54 | * without a detail message.
55 | */
56 | public SGIORuntimeException() {
57 | }
58 |
59 |
60 | /**
61 | * Constructs an instance of SGIORuntimeException
62 | * with the specified detail message.
63 | *
64 | * @param msg the detail message.
65 | */
66 | public SGIORuntimeException(String msg) {
67 | super(msg);
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/com/sun/j3d/utils/behaviors/mouse/MouseBehaviorState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.com.sun.j3d.utils.behaviors.mouse;
41 |
42 | import java.io.DataInput;
43 | import java.io.DataOutput;
44 | import java.io.IOException;
45 |
46 | import javax.media.j3d.TransformGroup;
47 |
48 | import com.sun.j3d.utils.behaviors.mouse.MouseBehavior;
49 | import com.sun.j3d.utils.scenegraph.io.retained.Controller;
50 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
51 | import com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.BehaviorState;
52 |
53 | public class MouseBehaviorState extends BehaviorState {
54 |
55 | private int target=0;
56 |
57 | public MouseBehaviorState(SymbolTableData symbol,Controller control) {
58 | super( symbol, control );
59 | }
60 |
61 | @Override
62 | public void writeObject( DataOutput out ) throws IOException {
63 | super.writeObject( out );
64 |
65 | out.writeInt( control.getSymbolTable().addReference( ((MouseBehavior)node).getTransformGroup() ) );
66 | }
67 |
68 | @Override
69 | public void readObject( DataInput in ) throws IOException {
70 | super.readObject( in );
71 |
72 | target = in.readInt();
73 | }
74 |
75 | @Override
76 | public void buildGraph() {
77 | ((MouseBehavior)node).setTransformGroup(
78 | (TransformGroup)control.getSymbolTable().getJ3dNode( target ) );
79 |
80 | super.buildGraph(); // This must be the last call in the method
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/com/sun/j3d/utils/geometry/PrimitiveState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.com.sun.j3d.utils.geometry;
41 |
42 | import java.io.DataInput;
43 | import java.io.DataOutput;
44 | import java.io.IOException;
45 |
46 | import com.sun.j3d.utils.geometry.Primitive;
47 | import com.sun.j3d.utils.scenegraph.io.retained.Controller;
48 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
49 | import com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.GroupState;
50 |
51 | public class PrimitiveState extends GroupState {
52 |
53 | protected int primflags;
54 |
55 | public PrimitiveState( SymbolTableData symbol, Controller control ) {
56 | super( symbol, control );
57 |
58 | }
59 |
60 | @Override
61 | public void writeConstructorParams( DataOutput out ) throws IOException {
62 | super.writeConstructorParams( out );
63 |
64 | out.writeInt( ((Primitive)node).getPrimitiveFlags() );
65 | }
66 |
67 | @Override
68 | public void readConstructorParams( DataInput in ) throws IOException {
69 | super.readConstructorParams(in);
70 |
71 | primflags = in.readInt();
72 | }
73 |
74 | @Override
75 | public void buildGraph() {
76 | super.buildGraph(); // This must be the last call in the method
77 | }
78 |
79 | /**
80 | * Returns true if the groups children should be saved.
81 | *
82 | * This is overridden by 'black box' groups such a geometry primitives
83 | */
84 | @Override
85 | protected boolean processChildren() {
86 | return false;
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/com/sun/j3d/utils/image/ImageComponent2DURLIOListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.com.sun.j3d.utils.image;
41 |
42 | /**
43 | * The listener interface which is called when a ImageComponent2DURL is
44 | * loaded from the scenegraph file
45 | */
46 | public interface ImageComponent2DURLIOListener {
47 |
48 | /**
49 | * The listener method which is called when a ImageComponent2DURL is
50 | * loaded from the scenegraph file.
51 | *
52 | * This method must return a valid ImageComponent2DURL, the returned object
53 | * will be placed in the scene graph.
54 | *
55 | * @param format The image format from ImageComponent
56 | * @param width The image width from ImageComponent
57 | * @param height The image height from ImageComponent
58 | * @param byReference The byReference flag from ImageComponent
59 | * @param yUp The yUp flag from ImageComponent
60 | * @param url The URL for the image component
61 | */
62 | public ImageComponent2DURL createImageComponent(
63 | int format, int width, int height, boolean byReference, boolean yUp,
64 | java.net.URL url );
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/com/sun/j3d/utils/universe/PlatformGeometryState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.com.sun.j3d.utils.universe;
41 |
42 | import com.sun.j3d.utils.scenegraph.io.retained.Controller;
43 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
44 | import com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.BranchGroupState;
45 | import com.sun.j3d.utils.universe.PlatformGeometry;
46 |
47 | public class PlatformGeometryState extends BranchGroupState {
48 |
49 | public PlatformGeometryState(SymbolTableData symbol,Controller control) {
50 | super(symbol, control);
51 | }
52 |
53 |
54 | @Override
55 | protected javax.media.j3d.SceneGraphObject createNode() {
56 | return new PlatformGeometry();
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/com/sun/j3d/utils/universe/ViewerAvatarState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.com.sun.j3d.utils.universe;
41 |
42 | import com.sun.j3d.utils.scenegraph.io.retained.Controller;
43 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
44 | import com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.BranchGroupState;
45 | import com.sun.j3d.utils.universe.ViewerAvatar;
46 |
47 | public class ViewerAvatarState extends BranchGroupState {
48 |
49 | public ViewerAvatarState(SymbolTableData symbol,Controller control) {
50 | super(symbol, control);
51 | }
52 |
53 | @Override
54 | protected javax.media.j3d.SceneGraphObject createNode() {
55 | return new ViewerAvatar();
56 | }
57 |
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/AmbientLightState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d;
41 |
42 | import javax.media.j3d.AmbientLight;
43 |
44 | import com.sun.j3d.utils.scenegraph.io.retained.Controller;
45 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
46 |
47 | public class AmbientLightState extends LightState {
48 |
49 | public AmbientLightState( SymbolTableData symbol, Controller control ) {
50 | super( symbol, control );
51 | }
52 | @Override
53 | protected javax.media.j3d.SceneGraphObject createNode() {
54 | return new AmbientLight();
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/BackgroundSoundState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d;
41 |
42 | import java.io.DataInput;
43 | import java.io.DataOutput;
44 | import java.io.IOException;
45 |
46 | import javax.media.j3d.BackgroundSound;
47 | import javax.media.j3d.SceneGraphObject;
48 |
49 | import com.sun.j3d.utils.scenegraph.io.retained.Controller;
50 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
51 |
52 | public class BackgroundSoundState extends SoundState {
53 |
54 | public BackgroundSoundState(SymbolTableData symbol,Controller control) {
55 | super( symbol, control );
56 |
57 | }
58 |
59 | @Override
60 | public void writeObject( DataOutput out ) throws IOException {
61 | super.writeObject( out );
62 | }
63 |
64 | @Override
65 | public void readObject( DataInput in ) throws IOException {
66 | super.readObject( in );
67 | }
68 |
69 | @Override
70 | protected SceneGraphObject createNode() {
71 | return new BackgroundSound();
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/BoundingLeafState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d;
41 |
42 | import java.io.DataInput;
43 | import java.io.DataOutput;
44 | import java.io.IOException;
45 |
46 | import javax.media.j3d.BoundingLeaf;
47 | import javax.media.j3d.SceneGraphObject;
48 |
49 | import com.sun.j3d.utils.scenegraph.io.retained.Controller;
50 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
51 |
52 | public abstract class BoundingLeafState extends SceneGraphObjectState {
53 |
54 | public BoundingLeafState(SymbolTableData symbol,Controller control) {
55 | super(symbol, control);
56 | }
57 |
58 | @Override
59 | public void writeObject( DataOutput out ) throws
60 | IOException {
61 |
62 | super.writeObject( out );
63 |
64 | control.writeBounds( out, ((BoundingLeaf)node).getRegion() );
65 | }
66 |
67 | @Override
68 | public void readObject( DataInput in ) throws
69 | IOException {
70 | super.readObject(in);
71 |
72 | ((BoundingLeaf)node).setRegion( control.readBounds(in) );
73 | }
74 |
75 | @Override
76 | protected SceneGraphObject createNode() {
77 | return new BoundingLeaf();
78 | }
79 |
80 | }
81 |
82 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/BranchGroupState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d;
41 |
42 | import javax.media.j3d.BranchGroup;
43 | import javax.media.j3d.SceneGraphObject;
44 |
45 | import com.sun.j3d.utils.scenegraph.io.retained.Controller;
46 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
47 |
48 | public class BranchGroupState extends GroupState {
49 |
50 | /** Creates new BranchGroupState */
51 | public BranchGroupState( SymbolTableData symbol, Controller control ) {
52 | super( symbol, control );
53 | }
54 |
55 | @Override
56 | protected SceneGraphObject createNode() {
57 | return new BranchGroup();
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/ColoringAttributesState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d;
41 |
42 | import java.io.DataInput;
43 | import java.io.DataOutput;
44 | import java.io.IOException;
45 |
46 | import javax.media.j3d.ColoringAttributes;
47 | import javax.media.j3d.SceneGraphObject;
48 | import javax.vecmath.Color3f;
49 |
50 | import com.sun.j3d.utils.scenegraph.io.retained.Controller;
51 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
52 |
53 | public class ColoringAttributesState extends NodeComponentState {
54 |
55 | public ColoringAttributesState( SymbolTableData symbol, Controller control ) {
56 | super(symbol, control);
57 | }
58 |
59 | @Override
60 | public void writeObject( DataOutput out ) throws IOException {
61 | super.writeObject( out );
62 | ColoringAttributes attr = (ColoringAttributes)node;
63 | Color3f clr = new Color3f();
64 | attr.getColor( clr );
65 | control.writeColor3f( out, clr );
66 | out.writeInt( attr.getShadeModel() );
67 | }
68 |
69 | @Override
70 | public void readObject( DataInput in ) throws IOException {
71 | super.readObject( in );
72 | ColoringAttributes attr = (ColoringAttributes)node;
73 | attr.setColor( control.readColor3f(in) );
74 | attr.setShadeModel( in.readInt() );
75 | }
76 |
77 | @Override
78 | protected SceneGraphObject createNode() {
79 | return new ColoringAttributes();
80 | }
81 |
82 |
83 | }
84 |
85 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/DecalGroupState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d;
41 |
42 | import javax.media.j3d.DecalGroup;
43 | import javax.media.j3d.SceneGraphObject;
44 |
45 | import com.sun.j3d.utils.scenegraph.io.retained.Controller;
46 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
47 |
48 | public class DecalGroupState extends GroupState {
49 |
50 | /** Creates new BranchGroupState */
51 | public DecalGroupState(SymbolTableData symbol,Controller control) {
52 | super( symbol, control );
53 | }
54 |
55 | @Override
56 | protected SceneGraphObject createNode() {
57 | return new DecalGroup();
58 | }
59 |
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/DirectionalLightState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d;
41 |
42 | import java.io.DataInput;
43 | import java.io.DataOutput;
44 | import java.io.IOException;
45 |
46 | import javax.media.j3d.DirectionalLight;
47 | import javax.vecmath.Vector3f;
48 |
49 | import com.sun.j3d.utils.scenegraph.io.retained.Controller;
50 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
51 |
52 | public class DirectionalLightState extends LightState {
53 |
54 | public DirectionalLightState( SymbolTableData symbol, Controller control ) {
55 | super( symbol, control );
56 |
57 | }
58 |
59 | @Override
60 | public void writeObject( DataOutput out ) throws IOException {
61 | super.writeObject( out );
62 | Vector3f dir = new Vector3f();
63 | ((DirectionalLight)node).getDirection( dir );
64 |
65 | control.writeVector3f( out, dir );
66 | }
67 |
68 | @Override
69 | public void readObject( DataInput in ) throws IOException {
70 | super.readObject( in );
71 | ((DirectionalLight)node).setDirection( control.readVector3f(in) );
72 | }
73 |
74 | @Override
75 | protected javax.media.j3d.SceneGraphObject createNode() {
76 | return new DirectionalLight();
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/ExponentialFogState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d;
41 |
42 | import java.io.DataInput;
43 | import java.io.DataOutput;
44 | import java.io.IOException;
45 |
46 | import javax.media.j3d.ExponentialFog;
47 |
48 | import com.sun.j3d.utils.scenegraph.io.retained.Controller;
49 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
50 |
51 | public class ExponentialFogState extends FogState {
52 |
53 | public ExponentialFogState(SymbolTableData symbol,Controller control) {
54 | super( symbol, control );
55 | }
56 |
57 | @Override
58 | public void writeObject( DataOutput out ) throws IOException {
59 | super.writeObject( out );
60 |
61 | out.writeFloat( ((ExponentialFog)node).getDensity() );
62 | }
63 |
64 | @Override
65 | public void readObject( DataInput in ) throws IOException {
66 | super.readObject( in );
67 |
68 | ((ExponentialFog)node).setDensity( in.readFloat() );
69 | }
70 |
71 | @Override
72 | protected javax.media.j3d.SceneGraphObject createNode() {
73 | return new ExponentialFog();
74 | }
75 |
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/GeometryState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d;
41 |
42 | import com.sun.j3d.utils.scenegraph.io.retained.Controller;
43 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
44 |
45 | public abstract class GeometryState extends NodeComponentState {
46 |
47 | public GeometryState( SymbolTableData symbol, Controller control ) {
48 | super(symbol, control);
49 | }
50 |
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/GeometryStripArrayState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * - Redistribution of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * - Redistribution in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * Neither the name of Sun Microsystems, Inc. or the names of
17 | * contributors may be used to endorse or promote products derived
18 | * from this software without specific prior written permission.
19 | *
20 | * This software is provided "AS IS," without a warranty of any
21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGES.
33 | *
34 | * You acknowledge that this software is not designed, licensed or
35 | * intended for use in the design, construction, operation or
36 | * maintenance of any nuclear facility.
37 | *
38 | */
39 |
40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d;
41 |
42 | import java.io.DataInput;
43 | import java.io.DataOutput;
44 | import java.io.IOException;
45 |
46 | import javax.media.j3d.GeometryStripArray;
47 |
48 | import com.sun.j3d.utils.scenegraph.io.retained.Controller;
49 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
50 |
51 | public abstract class GeometryStripArrayState extends GeometryArrayState {
52 |
53 | protected int[] stripVertexCounts;
54 |
55 | public GeometryStripArrayState( SymbolTableData symbol, Controller control ) {
56 | super( symbol, control );
57 | }
58 |
59 | @Override
60 | protected void writeConstructorParams( DataOutput out ) throws
61 | IOException {
62 | super.writeConstructorParams( out );
63 |
64 | stripVertexCounts = new int[((GeometryStripArray)node).getNumStrips()];
65 | ((GeometryStripArray)node).getStripVertexCounts( stripVertexCounts );
66 |
67 | out.writeInt(stripVertexCounts.length);
68 | for(int i=0; iProvides transparency sorting utility classes.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/shader/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |Provides shader utility classes.
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/ConfigDevice.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.universe ; 41 | import javax.media.j3d.InputDevice; 42 | 43 | /** 44 | * Mostly empty now; ConfigObject provides all required methods. 45 | */ 46 | class ConfigDevice extends ConfigObject { 47 | /** 48 | * The corresponding Java 3D core InputDevice instance. 49 | */ 50 | InputDevice j3dInputDevice ; 51 | 52 | /** 53 | * Instantiate an InputDevice of the given class name. 54 | * 55 | * @return the InputDevice, or null if error 56 | */ 57 | InputDevice createInputDevice() { 58 | j3dInputDevice = (InputDevice)createTargetObject() ; 59 | return j3dInputDevice ; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/LocaleFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.universe; 41 | 42 | import javax.media.j3d.HiResCoord; 43 | import javax.media.j3d.Locale; 44 | import javax.media.j3d.VirtualUniverse; 45 | 46 | /** 47 | * This interface defines a factory for creating Locale objects in a 48 | * SimpleUniverse. Implementations of the createLocale methods in 49 | * this interface should construct a new Locale object from the 50 | * specified parameters. This class is used by the SimpleUniverse 51 | * class to construct the default Locale used to hold the view and 52 | * content branch graphs. 53 | * 54 | * @see Locale 55 | * @see ConfiguredUniverse 56 | * @see SimpleUniverse 57 | * 58 | * @since Java 3D 1.3 59 | */ 60 | public interface LocaleFactory { 61 | /** 62 | * Creates a new Locale object at the specified high resolution 63 | * coordinate in the specified universe. 64 | * 65 | * @param universe the VirtualUniverse in which to create the Locale 66 | * @param hiRes the high resolution coordinate that defines the origin 67 | * of the Locale 68 | */ 69 | public Locale createLocale(VirtualUniverse universe, HiResCoord hiRes); 70 | 71 | /** 72 | * Creates a new Locale object at (0, 0, 0) in the specified universe. 73 | * 74 | * @param universe the VirtualUniverse in which to create the Locale 75 | */ 76 | public Locale createLocale(VirtualUniverse universe); 77 | } 78 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/PlatformGeometry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.universe; 41 | 42 | import javax.media.j3d.BranchGroup; 43 | 44 | /** 45 | * This class holds any geometry that should be associated with the 46 | * ViewingPlatform object. To create a scene with a dashboard, for 47 | * instance, a programmer would place the dashboard geometry under 48 | * the PlatformGeometry node. 49 | * 50 | * @see ViewingPlatform 51 | */ 52 | public class PlatformGeometry extends BranchGroup { 53 | 54 | /** 55 | * Constructs an instance of the PlatformGeometry node. 56 | */ 57 | public PlatformGeometry() { 58 | setCapability(ALLOW_DETACH); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/ViewerAvatar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.universe; 41 | 42 | import javax.media.j3d.BranchGroup; 43 | 44 | /** 45 | * This class holds geomtry that should be associated with the View's 46 | * avatar. An avatar is how the user's "virtual self" appears in the 47 | * virtual world. 48 | * 49 | * @see Viewer 50 | */ 51 | public class ViewerAvatar extends BranchGroup { 52 | 53 | /** 54 | * Constructs an instance of the ViewerAvatar node. 55 | */ 56 | public ViewerAvatar() { 57 | setCapability(ALLOW_DETACH); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/doc-files/j3d1x1-stereo.html: -------------------------------------------------------------------------------- 1 | 46 | 47 | 48 | 49 |54 | /* 55 | ************************************************************************ 56 | * 57 | * Java 3D configuration file for single fullscreen stereo desktop 58 | * configuration with no head tracking. 59 | * 60 | ************************************************************************ 61 | */ 62 | 63 | (NewScreen center 0) 64 | (ScreenProperty center WindowSize NoBorderFullScreen) 65 | 66 | // Define the physical body. 67 | // 68 | // The head origin is halfway between the eyes, with X extending to the right, 69 | // Y up, and positive Z extending into the skull. 70 | // 71 | (NewPhysicalBody SiteUser) 72 | 73 | // Set the interpupilary distance. This sets the LeftEyePosition and 74 | // RightEyePosition to offsets of half this distance along both directions of 75 | // the X axis. 76 | // 77 | (PhysicalBodyProperty SiteUser StereoEyeSeparation 0.066) 78 | 79 | // Create a view using the defined screen and physical body. 80 | // 81 | (NewView view0) 82 | (ViewProperty view0 Screen center) 83 | (ViewProperty view0 PhysicalBody SiteUser) 84 | 85 | // Enable stereo viewing. 86 | // 87 | (ViewProperty view0 StereoEnable true) 88 |89 | 90 | 91 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/doc-files/j3d1x1-window.html: -------------------------------------------------------------------------------- 1 | 46 | 47 | 48 | 49 |
54 | /* 55 | ************************************************************************ 56 | * 57 | * Java 3D configuration file for a conventional single screen, windowed 58 | * desktop configuration. 59 | * 60 | ************************************************************************ 61 | */ 62 | 63 | (NewWindow window1 0) 64 | (WindowProperty window1 WindowSize (700.0 700.0)) 65 | 66 | (NewView view1) 67 | (ViewProperty view1 Window window1) 68 |69 | 70 | 71 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/doc-files/j3d1x1.html: -------------------------------------------------------------------------------- 1 | 46 | 47 | 48 | 49 |
54 | /* 55 | ************************************************************************ 56 | * 57 | * Java 3D configuration file for a single fullscreen desktop configuration. 58 | * 59 | ************************************************************************ 60 | */ 61 | 62 | (NewWindow big 0) 63 | (WindowProperty big WindowSize NoBorderFullScreen) 64 | 65 | (NewView view0) 66 | (ViewProperty view0 Window big) 67 |68 | 69 | 70 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |
Provides utility classes for setting up the Java 3D universe, 10 | including the viewing configuration.
11 | 12 | 13 | --------------------------------------------------------------------------------