简体   繁体   English

在线Java Web Start小程序不允许在Mac OS X上使用mouseDragged(),但可以在Windows上使用。 我想念什么吗?

[英]online java webstart applet will not allow mouseDragged() on mac osx but works on windows. Am I missing something?

* note I have been reading and it may or may not be that the java plugin for Apple Inc doesn't allow this, but I feel like its something I am doing. * 请注意,我一直在阅读,可能是(也可能不是)Apple Inc.的java插件不允许这样做,但是我感觉它在做我的事情。 that being said....* 话虽如此....*

I wrote a java applet using Processing 1.5.1 ... After uploading to my website it works perfectly on windows using IE, FF, Safari, and Chrome. 我使用Processing 1.5.1编写了一个Java applet ...上传到我的网站后,它在使用IE,FF,Safari和Chrome的Windows上可以完美运行。

However, NONE of the browsers allow it to work correctly on mac osx. 但是,没有浏览器允许它在mac osx上正常工作。 It will load and display fine but you can not interact with it at all. 它会加载并正常显示,但您根本无法与它进行交互。

all the app does is load an .obj and let you rotate it when the mouse is dragged. 该应用程序所做的全部工作就是加载.obj,并在拖动鼠标时旋转它。

Very simple program. 很简单的程序。 but the mouse dragged functionality doesnt work on mac for some reason. 但由于某些原因,鼠标拖动功能在Mac上不起作用。 Its like the applet never grabs focus from the browser or OS. 就像小程序一样,它永远不会吸引浏览器或OS的关注。

know anything that I could do? 知道我能做些什么? I'm using java webstart. 我正在使用java webstart。

*Processing generates the .jar and java script when it exports the applet. *处理在导出小程序时会生成.jar和Java脚本。 Do I need to add something to my sketch to make it work for macs? 我需要在我的草图中添加一些内容以使其适用于Mac吗? This is my processing sketch: 这是我的处理草图:

//this sketch was created as an example for the IMA 
//by Joseph Aaron Campbell
//josephaaroncampbell.com
//it uses OBJLoader and the SAITO example as a base

import processing.opengl.*;
import processing.opengl.PGraphicsOpenGL;//put this in because I got a random error looking for 
                                         //it.probably dont need it
import saito.objloader.*;

OBJModel model ;

float rotX, rotY;

void setup()
{
    size(640, 450, P3D);
    frameRate(30);
    ///keep your poly count 32000 and below for obj files
    //'or youre going to have a bad time'
    //
    //create and load instance of model
    model = new OBJModel(this, "vase_18.obj", "absolute", TRIANGLES);
    model.enableDebug();
    //scale of model. not sure the relationship to original size
    model.scale(10);
    model.translateToCenter();
    stroke(255);
    noStroke();
}



void draw()
{
   //what color is your background? 0=black, 255=white
    background(15);
     //add some info about model and origins
    String s = "Original Vase found at: Http://www.imamuseum.org/art/collections/artwork/abstract-vessel-black  Artist: Odundo, Magdalene";
    fill(200, 200, 200);
    textSize(12);
    textMode(SCREEN);
    textSize(12);
    text(s, 15, 20, 450, 50);

    //retrieve mouse cordinates for later use
    //adds directional light to position of mouse
    float dirY = (mouseY / float(height) - 0.5) * 2;
    float dirX = (mouseX / float(width) - 0.5) * 2;

    //Lights
    directionalLight(100,100, 100, -300, 150, -1);
    lightSpecular(255, 255, 255); 
    shininess(15.0);
    directionalLight(145,145,145, 300, 200, 1);
    directionalLight(100,100,100, -400,400,-1);



   //pushMatrix and popMatrix create little bubble for model to be in
    pushMatrix();//begin changes to model
    translate(width/2, height/2, 0);
    rotateX(rotY*0.4);
    rotateY(rotX*0.4);
    model.draw();
    popMatrix();//end changes to model


}

void mouseDragged()
{

   rotX += (mouseX - pmouseX) * 0.01;
   rotY -= (mouseY - pmouseY) * 0.01;

}//mousevoid

how I am loading the sketch via html generated by Processing: 我如何通过Processing生成的html加载草图:

  ...

  <div id="vase_container">
<applet code="org.jdesktop.applet.util.JNLPAppletLauncher"
    width="640"
    height="450"
    archive="http://absolute path to/vase.jar,
             http://absolute path to/opengl.jar,
             http://absolute path to/OBJLoader.jar,
          http://absolute path to/core.jar,
          http://jogamp.org/deployment/jogamp-current/jar/applet-launcher.jar,
          http://jogamp.org/deployment/jogamp-current/jar/jogl.all.jar,
          http://jogamp.org/deployment/jogamp-current/jar/gluegen-rt.jar">
  <!--http://jogamp.org/deployment/webstart/jogl-demos/jogl-demos.jar-->
  <param name="codebase_lookup" value="false" />
  <param name="subapplet.classname" value="vase" />
  <!--<param name="subapplet.displayname" value="Pretty Name Here">-->
  <param name="noddraw.check" value="true" />
  <param name="progressbar" value="true" />
  <param name="jnlpNumExtensions" value="1" />
  <param name="jnlpExtension1"
     value="http://jogamp.org/deployment/jogamp-current/jogl-all-awt.jnlp" />
  <param name="java_arguments" value="-Dsun.java2d.noddraw=true" />
  <!--<param name="jnlp_href" value="applet-gears.jnlp">-->

        ....

Processing interfaces with OpenGL through JOGL . 通过JOGL ProcessingOpenGL接口。 You probably need to build a Mac OS version, which will require installing the Mac Developer Tools to get the OpenGL headers. 您可能需要构建Mac OS版本,这将需要安装Mac Developer Tools来获取OpenGL标头。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么Java小程序可以在Windows上运行而不能在Mac 10.6.8上运行? - Why Java applet works on windows but not on Mac 10.6.8? 编译Java小程序(Mac OSX) - Compiling a Java applet (Mac OSX) MouseDragged和MouseMoved在Java Applet中不起作用 - MouseDragged & MouseMoved not working in Java Applet Java:如何将参数传递给 Webstart 小程序? - Java: How do I pass parameters to a Webstart Applet? 什么是Mac和Windows的“有效系统进程”。 (java的ProcessBuilder) - what is a “Valid System process” for mac and windows. (java ProcessBuilder) 使WebStart Java桌面应用程序在Windows和Mac上的系统启动时启动 - Make WebStart Java desktop application to start on system startup on Windows and Mac 为什么在使用Files.copy()在linux中复制文件时出现NoSuchFileException。 但是在Windows中可以正常工作。 - Why am I Getting NoSuchFileException while copying a file in linux using Files.copy(). But works fine in windows. 将Java Applet迁移到Java WebStart(JNLP) - Migrating Java Applet to Java WebStart (JNLP) 我想在Mac OS / Windows上的System Startup上运行我的Java程序。我怎样才能做到这一点? - I would like to run my Java program on System Startup on Mac OS/Windows. How can I do this? Mac OSX上的Java 7(更新7和9) - Applet打印小字体 - Java 7 (Update 7 and 9) on Mac OSX - Applet printing tiny fonts
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM