當前位置: 首頁>>代碼示例>>Java>>正文


Java PConstants.WINDOWS屬性代碼示例

本文整理匯總了Java中processing.core.PConstants.WINDOWS屬性的典型用法代碼示例。如果您正苦於以下問題:Java PConstants.WINDOWS屬性的具體用法?Java PConstants.WINDOWS怎麽用?Java PConstants.WINDOWS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在processing.core.PConstants的用法示例。


在下文中一共展示了PConstants.WINDOWS屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createMacBundle

private File createMacBundle(String sketchName, File appFolder) throws IOException, FileNotFoundException
{
  File dotAppFolder = new File(appFolder, sketchName + ".app");
  String APP_SKELETON = "skeleton.app";

  File dotAppSkeleton = new File("lib/export/" + APP_SKELETON);
  Base.copyDir(dotAppSkeleton, dotAppFolder);
  String stubName = "Contents/MacOS/JavaApplicationStub";

  // need to set the stub to executable
  // work on osx or *nix, but dies on windows
  if (PApplet.platform == PConstants.WINDOWS)
  {
    File warningFile = new File(appFolder, "readme.txt");
    writeWarningFile(dotAppFolder, stubName, warningFile);
  }
  else
  {
    File stubFile = new File(dotAppFolder, stubName);
    String stubPath = stubFile.getAbsolutePath();
    Runtime.getRuntime().exec(new String[] { "chmod", "+x", stubPath });
  }
  return dotAppFolder;
}
 
開發者ID:ybakos,項目名稱:proclipsing,代碼行數:24,代碼來源:P5ApplicationExport.java

示例2: writeShellScript

private void writeShellScript(P5ExportBuilder builder, String sketchName, File appFolder, boolean separateJar, String cp) throws FileNotFoundException, IOException
{
  File shellScript = new File(appFolder, sketchName);
  PrintStream ps = new PrintStream(new FileOutputStream(shellScript));
  ps.print("#!/bin/sh\n\n");
  ps.print("APPDIR=$(dirname \"$0\")\n");
  if (!separateJar) cp = "lib/" + cp;
  ps.print("java " + builder.vmArgs + " -Djava.library.path="
      + "\"$APPDIR\" -cp \"" + cp + "\" " + mainClass + "\n");
  
  System.out.println("java " + builder.vmArgs + " -Djava.library.path="
      + "\"$APPDIR\" -cp \"" + cp + "\" " + mainClass + "\n");
  
  ps.flush();
  ps.close();

  String shellPath = shellScript.getAbsolutePath();
  // will work on osx or *nix, but dies on windows, thus the readme file...
  if (PApplet.platform != PConstants.WINDOWS)
    Runtime.getRuntime().exec(new String[] { "chmod", "+x", shellPath });
}
 
開發者ID:ybakos,項目名稱:proclipsing,代碼行數:21,代碼來源:P5ApplicationExport.java

示例3: 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]);
  }
}
 
開發者ID:ybakos,項目名稱:proclipsing,代碼行數:18,代碼來源:P5ExportType.java

示例4: 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;
}
 
開發者ID:ybakos,項目名稱:proclipsing,代碼行數:13,代碼來源:P5ApplicationExport.java

示例5: 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;
}
 
開發者ID:ybakos,項目名稱:proclipsing,代碼行數:35,代碼來源:P5ApplicationExport.java

示例6: writeRunScript

public static void writeRunScript(String scriptDestinationPath) {
	boolean isWindows = P.platform == PConstants.WINDOWS;
	if(isWindows) writeRunScriptForWindows(scriptDestinationPath);
	else writeRunScriptForBash(scriptDestinationPath);
}
 
開發者ID:cacheflowe,項目名稱:haxademic,代碼行數:5,代碼來源:AppUtil.java


注:本文中的processing.core.PConstants.WINDOWS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。