/* */ package com.sun.j3d.utils.universe;
/* */
/* */ import java.awt.Window;
/* */ import javax.media.j3d.Canvas3D;
/* */ import javax.swing.JFrame;
/* */ import javax.swing.JPanel;
/* */ import javax.vecmath.Matrix4d;
/* */ import javax.vecmath.Point2d;
/* */
/* */ class ConfigScreen extends ConfigObject
/* */ {
/* */ int frameBufferNumber;
/* 63 */ double physicalScreenWidth = 0.0D;
/* */
/* 70 */ double physicalScreenHeight = 0.0D;
/* */
/* 76 */ Matrix4d trackerBaseToImagePlate = null;
/* */
/* 82 */ Matrix4d headTrackerToLeftImagePlate = null;
/* */
/* 88 */ Matrix4d headTrackerToRightImagePlate = null;
/* */
/* 94 */ int monoscopicViewPolicy = 2;
/* */
/* 100 */ boolean fullScreen = false;
/* */
/* 106 */ boolean noBorderFullScreen = false;
/* */
/* 112 */ int windowWidthInPixels = 512;
/* */
/* 118 */ int windowHeightInPixels = 512;
/* */
/* 124 */ int windowX = 0;
/* */
/* 130 */ int windowY = 0;
/* */ JFrame j3dJFrame;
/* */ Window j3dWindow;
/* */ JPanel j3dJPanel;
/* */ Canvas3D j3dCanvas;
/* */
/* */ protected void setProperty(ConfigCommand command)
/* */ {
/* 170 */ String attr = null;
/* 171 */ Object val = null;
/* 172 */ String sval = null;
/* */
/* 174 */ if (command.argc != 4) {
/* 175 */ syntaxError("Incorrect number of arguments to " + command.commandName);
/* */ }
/* */
/* 179 */ if (!isName(command.argv[2])) {
/* 180 */ syntaxError("The second argument to " + command.commandName + " must be a property name");
/* */ }
/* */
/* 184 */ attr = (String)command.argv[2];
/* 185 */ val = command.argv[3];
/* */
/* 187 */ if (attr.equals("PhysicalScreenWidth")) {
/* 188 */ if (!(val instanceof Double)) {
/* 189 */ syntaxError("Value for PhysicalScreenWidth must be a number");
/* */ }
/* */
/* 192 */ this.physicalScreenWidth = ((Double)val).doubleValue();
/* */ }
/* 194 */ else if (attr.equals("PhysicalScreenHeight")) {
/* 195 */ if (!(val instanceof Double)) {
/* 196 */ syntaxError("Value for PhysicalScreenHeight must be a number");
/* */ }
/* */
/* 199 */ this.physicalScreenHeight = ((Double)val).doubleValue();
/* */ }
/* 201 */ else if (attr.equals("TrackerBaseToImagePlate")) {
/* 202 */ if (!(val instanceof Matrix4d)) {
/* 203 */ syntaxError("Value for TrackerBaseToImagePlate must be a 4x3 or 4x4 matrix");
/* */ }
/* */
/* 206 */ this.trackerBaseToImagePlate = ((Matrix4d)val);
/* */ }
/* 208 */ else if (attr.equals("HeadTrackerToLeftImagePlate")) {
/* 209 */ if (!(val instanceof Matrix4d)) {
/* 210 */ syntaxError("Value for HeadTrackerToLeftImagePlate must be a 4x3 or 4x4 matrix");
/* */ }
/* */
/* 213 */ this.headTrackerToLeftImagePlate = ((Matrix4d)val);
/* */ }
/* 215 */ else if (attr.equals("HeadTrackerToRightImagePlate")) {
/* 216 */ if (!(val instanceof Matrix4d)) {
/* 217 */ syntaxError("Value for HeadTrackerToRightImagePlate must be a 4x3 or 4x4 matrix");
/* */ }
/* */
/* 220 */ this.headTrackerToRightImagePlate = ((Matrix4d)val);
/* */ }
/* 222 */ else if (attr.equals("MonoscopicViewPolicy")) {
/* 223 */ if (!(val instanceof String)) {
/* 224 */ syntaxError("Value for MonoscopicViewPolicy must be a name");
/* */ }
/* */
/* 227 */ sval = (String)val;
/* 228 */ if (sval.equals("LEFT_EYE_VIEW"))
/* 229 */ this.monoscopicViewPolicy = 0;
/* 230 */ else if (sval.equals("RIGHT_EYE_VIEW"))
/* 231 */ this.monoscopicViewPolicy = 1;
/* 232 */ else if (sval.equals("CYCLOPEAN_EYE_VIEW"))
/* 233 */ this.monoscopicViewPolicy = 2;
/* */ else {
/* 235 */ syntaxError("Invalid value for MonoscopicViewPolicy \"" + sval + "\"");
/* */ }
/* */ }
/* 238 */ else if (attr.equals("WindowPosition")) {
/* 239 */ if (!(val instanceof Point2d)) {
/* 240 */ syntaxError("WindowPosition must be a Point2d");
/* */ }
/* 242 */ Point2d p2d = (Point2d)val;
/* 243 */ this.windowX = ((int)p2d.x);
/* 244 */ this.windowY = ((int)p2d.y);
/* */ }
/* 246 */ else if (attr.equals("WindowSize")) {
/* 247 */ if ((val instanceof Point2d)) {
/* 248 */ this.fullScreen = false;
/* 249 */ this.noBorderFullScreen = false;
/* */
/* 251 */ Point2d p2d = (Point2d)val;
/* 252 */ this.windowWidthInPixels = ((int)p2d.x);
/* 253 */ this.windowHeightInPixels = ((int)p2d.y);
/* */ }
/* 255 */ else if ((val instanceof String)) {
/* 256 */ String s = (String)val;
/* */
/* 258 */ if (s.equals("FullScreen")) {
/* 259 */ this.fullScreen = true;
/* 260 */ this.noBorderFullScreen = false;
/* 261 */ } else if (s.equals("NoBorderFullScreen")) {
/* 262 */ this.fullScreen = false;
/* 263 */ this.noBorderFullScreen = true;
/* */ } else {
/* 265 */ syntaxError("Value for WindowSize must be one of\n\"FullScreen\" \"NoBorderFullScreen\" or Point2d");
/* */ }
/* */
/* */ }
/* */ else
/* */ {
/* 271 */ syntaxError("Invalid WindowSize value: " + val + "\nValue for WindowSize " + "must be one of\n" + "\"FullScreen\" " + "\"NoBorderFullScreen\" or Point2d");
/* */ }
/* */
/* */ }
/* */ else
/* */ {
/* 278 */ syntaxError("Unknown " + command.commandName + " \"" + attr + "\"");
/* */ }
/* */ }
/* */
/* */ protected void initialize(ConfigCommand command)
/* */ {
/* 290 */ if (command.argc != 3) {
/* 291 */ syntaxError("Incorrect number of arguments to " + command.commandName);
/* */ }
/* */
/* 295 */ if (!(command.argv[2] instanceof Double)) {
/* 296 */ syntaxError("The second argument to " + command.commandName + " must be a GraphicsDevice index");
/* */ }
/* */
/* 300 */ this.frameBufferNumber = ((Double)command.argv[2]).intValue();
/* */ }
/* */ }
/* Location: Z:\System\Library\Java\Extensions\j3dutils.jar
* Qualified Name: com.sun.j3d.utils.universe.ConfigScreen
* JD-Core Version: 0.6.2
*/