Tabnine Logo
PApplet.sketchPath
Code IndexAdd Tabnine to your IDE (free)

How to use
sketchPath
method
in
processing.core.PApplet

Best Java code snippets using processing.core.PApplet.sketchPath (Showing top 10 results out of 315)

origin: org.processing/core

public File sketchFile(String where) {
 return new File(sketchPath(where));
}
origin: ajavamind/Processing-Cardboard

public File sketchFile(String where) {
  return new File(sketchPath(where));
}
origin: org.processing/core

/**
 * Prepend the sketch folder path to the filename (or path) that is
 * passed in. External libraries should use this function to save to
 * the sketch folder.
 * <p/>
 * Note that when running as an applet inside a web browser,
 * the sketchPath will be set to null, because security restrictions
 * prevent applets from accessing that information.
 * <p/>
 * This will also cause an error if the sketch is not inited properly,
 * meaning that init() was never called on the PApplet when hosted
 * my some other main() or by other code. For proper use of init(),
 * see the examples in the main description text for PApplet.
 */
public String sketchPath(String where) {
 if (sketchPath() == null) {
  return where;
 }
 // isAbsolute() could throw an access exception, but so will writing
 // to the local disk using the sketch path, so this is safe here.
 // for 0120, added a try/catch anyways.
 try {
  if (new File(where).isAbsolute()) return where;
 } catch (Exception e) { }
 return sketchPath() + File.separator + where;
}
origin: org.processing/core

/**
 * Returns a path inside the applet folder to save to. Like sketchPath(),
 * but creates any in-between folders so that things save properly.
 * <p/>
 * All saveXxxx() functions use the path to the sketch folder, rather than
 * its data folder. Once exported, the data folder will be found inside the
 * jar file of the exported application or applet. In this case, it's not
 * possible to save data into the jar file, because it will often be running
 * from a server, or marked in-use if running from a local file system.
 * With this in mind, saving to the data path doesn't make sense anyway.
 * If you know you're running locally, and want to save to the data folder,
 * use <TT>saveXxxx("data/blah.dat")</TT>.
 */
public String savePath(String where) {
 if (where == null) return null;
 String filename = sketchPath(where);
 createPath(filename);
 return filename;
}
origin: cansik/processing-postfx

    return sketch.sketchPath();
    return path.substring(n0, n1);
  } else {
    return sketch.sketchPath();
return sketch.sketchPath();
origin: ajavamind/Processing-Cardboard

  /**
   * Returns a path inside the applet folder to save to. Like sketchPath(),
   * but creates any in-between folders so that things save properly.
   * <p/>
   * All saveXxxx() functions use the path to the sketch folder, rather than
   * its data folder. Once exported, the data folder will be found inside the
   * jar file of the exported application or applet. In this case, it's not
   * possible to save data into the jar file, because it will often be running
   * from a server, or marked in-use if running from a local file system.
   * With this in mind, saving to the data path doesn't make sense anyway.
   * If you know you're running locally, and want to save to the data folder,
   * use <TT>saveXxxx("data/blah.dat")</TT>.
   */
  public String savePath(String where) {
    if (where == null) return null;
//    System.out.println("filename before sketchpath is " + where);
    String filename = sketchPath(where);
//    System.out.println("filename after sketchpath is " + filename);
    createPath(filename);
    return filename;
  }

origin: ajavamind/Processing-Cardboard

file = new File(sketchPath(filename));
origin: org.processing/core

String path = sketch.sketchPath(filename);
stream = new FileInputStream(path);
if (stream != null) {
origin: ajavamind/Processing-Cardboard

File sketchFile = new File(sketchPath(filename));
if (sketchFile.exists()) {
  try {
origin: org.processing/core

 stream = new FileInputStream(sketchPath(filename));
 if (stream != null) return stream;
} catch (Exception e) { }  // ignored
processing.corePAppletsketchPath

Javadoc

Path to where sketch can read/write files (read-only). Android: This is the writable area for the Activity, which is correct for purposes of how sketchPath is used in practice from a sketch, even though it's technically different than the desktop version.

Popular methods of PApplet

  • constrain
  • createGraphics
    Create an offscreen graphics surface for drawing, in this case for a renderer that writes to a file
  • loadStrings
    ( begin auto-generated from loadStrings.xml ) Reads the contents of a file or url and creates a Stri
  • saveStrings
    ( begin auto-generated from saveStrings.xml ) Writes an array of strings to a file, one line per str
  • abs
  • createImage
    ( begin auto-generated from createImage.xml ) Creates a new PImage (the datatype for storing images)
  • createShape
  • createWriter
    ( begin auto-generated from createWriter.xml ) Creates a new file in the sketch folder, and a PrintW
  • loadImage
  • main
    main() method for running this class from the command line. Usage: PApplet [options] [s
  • max
  • parseInt
  • max,
  • parseInt,
  • random,
  • round,
  • split,
  • sqrt,
  • unhex,
  • arrayCopy,
  • ceil,
  • checkExtension

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • findViewById (Activity)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • ImageIO (javax.imageio)
  • JPanel (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now