本文整理匯總了Java中processing.core.PConstants.MACOSX屬性的典型用法代碼示例。如果您正苦於以下問題:Java PConstants.MACOSX屬性的具體用法?Java PConstants.MACOSX怎麽用?Java PConstants.MACOSX使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類processing.core.PConstants
的用法示例。
在下文中一共展示了PConstants.MACOSX屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: SketchRunner
public SketchRunner(final String id, final ModeService modeService) {
this.id = id;
this.modeService = modeService;
if (PApplet.platform == PConstants.MACOSX) {
try {
OSXAdapter.setQuitHandler(this, this.getClass().getMethod("preventUserQuit"));
} catch (final Throwable e) {
System.err.println(e.getMessage());
}
}
// new Thread(new Runnable() {
// @Override
// public void run() {
// Runner.warmup();
// }
// }, "SketchRunner Warmup Thread").start();
}
示例2: addGLNatives
private void addGLNatives(File appFolder, ZipOutputStream zos, int platform) throws P5ExportException
{
switch (platform){
case PConstants.WINDOWS:
addGLNatives(appFolder, zos, GL_NATIVE_LIBS[0]);
break;
case PConstants.MACOSX:
File res = new File(appFolder, JAVA_RES_DIR_OSX);
if (!res.exists()) {
res.mkdirs();
System.err.println("NO OSX RESOURCE DIR: '"+res+"'!");
}
addGLNatives(res, zos, GL_NATIVE_LIBS[1]);
break;
default: // PConstants.LINUX
addGLNatives(appFolder, zos, GL_NATIVE_LIBS[2]);
}
}
示例3: getAppFolderName
private String getAppFolderName(int exportPlatform) throws P5ExportException
{
String exportPlatformStr = "application.";
if (exportPlatform == PConstants.WINDOWS)
exportPlatformStr += "windows";
else if (exportPlatform == PConstants.MACOSX)
exportPlatformStr += "macosx";
else if (exportPlatform == PConstants.LINUX)
exportPlatformStr += "linux";
else
throw new P5ExportException("Unexpected OS type!");
return exportPlatformStr;
}
示例4: addJarList
private StringBuffer addJarList(int exportPlatform, Vector classpathList)
{
String jarList[] = new String[classpathList.size()];
// System.err.println("jarListVector: "+classpathList);
classpathList.copyInto(jarList);
StringBuffer exportClassPath = new StringBuffer();
if (exportPlatform == PConstants.MACOSX)
{
for (int i = 0; i < jarList.length; i++)
{
if (i != 0)
exportClassPath.append(":");
exportClassPath.append(JAVAROOT + jarList[i]);
}
}
else if (exportPlatform == PConstants.WINDOWS)
{
for (int i = 0; i < jarList.length; i++)
{
if (i != 0)
exportClassPath.append(",");
exportClassPath.append(jarList[i]);
}
}
else
{
for (int i = 0; i < jarList.length; i++)
{
if (i != 0)
exportClassPath.append(":");
exportClassPath.append("$APPDIR/lib/" + jarList[i]);
}
}
return exportClassPath;
}
示例5: runBlock
public void runBlock(final String[] arguments) throws RSketchError {
log("runBlock");
PApplet.runSketch(arguments, this);
try {
finishedLatch.await();
log("RunSketch done.");
} catch (final InterruptedException interrupted) {
// Treat an interruption as a request to the applet to terminate.
exit();
try {
finishedLatch.await();
log("RunSketch interrupted.");
} catch (final InterruptedException exception) {
log(exception.toString());
}
} finally {
Thread.setDefaultUncaughtExceptionHandler(null);
if (PApplet.platform == PConstants.MACOSX
&& Arrays.asList(arguments).contains("fullScreen")) {
// Frame should be OS-X fullscreen, and it won't stop being that unless the jvm
// exits or we explicitly tell it to minimize.
// (If it's disposed, it'll leave a gray blank window behind it.)
log("Disabling fullscreen.");
macosxFullScreenToggle(frame);
}
if (surface instanceof PSurfaceFX) {
// Sadly, JavaFX is an abomination, and there's no way to run an FX sketch more than once,
// so we must actually exit.
log("JavaFX requires SketchRunner to terminate. Farewell!");
System.exit(0);
}
final Object nativeWindow = surface.getNative();
if (nativeWindow instanceof com.jogamp.newt.Window) {
((com.jogamp.newt.Window) nativeWindow).destroy();
} else {
surface.setVisible(false);
}
}
// log(terminalException.toString());
if (terminalException != null) {
log("Throw the exception to PDE.");
throw terminalException;
}
}
示例6: nativeMouseEvent
protected void nativeMouseEvent(com.jogamp.newt.event.MouseEvent nativeEvent,
int peAction) {
int modifiers = nativeEvent.getModifiers();
int peModifiers = modifiers &
(InputEvent.SHIFT_MASK |
InputEvent.CTRL_MASK |
InputEvent.META_MASK |
InputEvent.ALT_MASK);
int peButton = 0;
if ((modifiers & InputEvent.BUTTON1_MASK) != 0) {
peButton = PConstants.LEFT;
} else if ((modifiers & InputEvent.BUTTON2_MASK) != 0) {
peButton = PConstants.CENTER;
} else if ((modifiers & InputEvent.BUTTON3_MASK) != 0) {
peButton = PConstants.RIGHT;
}
if (PApplet.platform == PConstants.MACOSX) {
//if (nativeEvent.isPopupTrigger()) {
if ((modifiers & InputEvent.CTRL_MASK) != 0) {
peButton = PConstants.RIGHT;
}
}
int peCount = 0;
if (peAction == MouseEvent.WHEEL) {
peCount = nativeEvent.isShiftDown() ? (int)nativeEvent.getRotation()[0] :
(int)nativeEvent.getRotation()[1];
} else {
peCount = nativeEvent.getClickCount();
}
MouseEvent me = new MouseEvent(nativeEvent, nativeEvent.getWhen(),
peAction, peModifiers,
nativeEvent.getX(), nativeEvent.getY(),
peButton,
peCount);
pg.parent.postEvent(me);
}