Codota Logo
PApplet.dataPath
Code IndexAdd Codota to your IDE (free)

How to use
dataPath
method
in
processing.core.PApplet

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: ajavamind/Processing-Cardboard

/**
 * Return a full path to an item in the data folder as a File object.
 * See the dataPath() method for more information.
 */
public File dataFile(String where) {
  return new File(dataPath(where));
}
origin: org.processing/core

static protected String getBasePath(PApplet parent, String filename) {
 // Obtaining the path
 File file = new File(parent.dataPath(filename));
 if (!file.exists()) {
  file = parent.sketchFile(filename);
 }
 String absolutePath = file.getAbsolutePath();
 return absolutePath.substring(0,
     absolutePath.lastIndexOf(File.separator));
}
origin: org.processing/core

File file = new File(parent.dataPath(texname));
if (file.exists()) {
 currentMtl.kdMap = parent.loadImage(texname);
origin: org.processing/core

File file = new File(sketch.dataPath(filename));
if (!file.exists()) {
  String path = sketch.dataPath(filename);
  stream = new FileInputStream(path);
  if (stream != null) {
origin: org.processing/core

File file = new File(dataPath(filename));
if (!file.exists()) {
  stream = new FileInputStream(dataPath(filename));
  if (stream != null) return stream;
 } catch (IOException e2) { }
processing.corePAppletdataPath

Javadoc

Return a full path to an item in the data folder.

In this method, the data path is defined not as the applet's actual data path, but a folder titled "data" in the sketch's working directory. When running inside the PDE, this will be the sketch's "data" folder. However, when exported (as application or applet), sketch's data folder is exported as part of the applications jar file, and it's not possible to read/write from the jar file in a generic way. If you need to read data from the jar file, you should use createInput().

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

  • Finding current android device location
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • JList (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now