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

How to use
saveStrings
method
in
processing.core.PApplet

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

origin: org.processing/core

/**
 * @nowebref
 */
static public void saveStrings(File file, String data[]) {
 saveStrings(createOutput(file), data);
}
origin: ajavamind/Processing-Cardboard

static public void saveStrings(File file, String strings[]) {
  try {
    String location = file.getAbsolutePath();
    createPath(location);
    OutputStream output = new FileOutputStream(location);
    if (file.getName().toLowerCase().endsWith(".gz")) {
      output = new GZIPOutputStream(output);
    }
    saveStrings(output, strings);
    output.close();
  } catch (IOException e) {
    e.printStackTrace();
  }
}
origin: ajavamind/Processing-Cardboard

public void saveStrings(String filename, String strings[]) {
  saveStrings(saveFile(filename), strings);
}
origin: Calsign/APDE

static public void saveFile(String str, File file) throws IOException {
  File temp = File.createTempFile(file.getName(), null, file.getParentFile());
  try {
    // fix from cjwant to prevent symlinks from being destroyed.
    File canon = file.getCanonicalFile();
    file = canon;
  } catch(IOException e) {
    throw new IOException("Could not resolve canonical representation of " +
        file.getAbsolutePath());
  }
  PApplet.saveStrings(temp, new String[] { str });
  if(file.exists()) {
    boolean result = file.delete();
    if (!result) {
      throw new IOException("Could not remove old version of " +
          file.getAbsolutePath());
    }
  }
  boolean result = temp.renameTo(file);
  if(!result)
    throw new IOException("Could not replace " + file.getAbsolutePath());
}

origin: poqudrof/PapARt

void calibrateColors() {
  // Save the color calibration 
  colorMode(RGB, 255);
  for (int colorId = 0; colorId < nbColors; colorId++) {
    ColorReferenceThresholds c = new ColorReferenceThresholds(colorId);
    
    int[] colorData = new int[nbScreenPoints * 2];
    for (int i = 0; i < nbScreenPoints * 2; i++) {
      colorData[i] = this.savedColors[i][colorId];
    }
    
    String[] list = c.createReference(colorData);
    String saveFile = Papart.colorThresholds + colorId + ".txt";
    parent.saveStrings(saveFile, list);
    if (colorId == 0) {
      parent.saveStrings(Papart.redThresholds, list);
    }
    if (colorId == 1) {
      parent.saveStrings(Papart.blueThresholds, list);
    }
  }
}
origin: poqudrof/PapARt

public void saveToYAML(PApplet parent, String fileName) {
  assert (isValid());
  StringBuilder builder = new StringBuilder("%YAML:1.0\n");
  this.addTo(builder);
  
  parent.saveStrings(fileName, new String[] {builder.toString()});
}
origin: poqudrof/PapARt

/**
 * Save a PMatrix3D to a file. Really simple file format, using saveStrings.
 *
 * @param pa
 * @param mat
 * @param filename
 */
public static void savePMatrix3D(PApplet pa, PMatrix3D mat, String filename) {
  String[] lines = new String[16];
  lines[0] = Float.toString(mat.m00);
  lines[1] = Float.toString(mat.m01);
  lines[2] = Float.toString(mat.m02);
  lines[3] = Float.toString(mat.m03);
  lines[4] = Float.toString(mat.m10);
  lines[5] = Float.toString(mat.m11);
  lines[6] = Float.toString(mat.m12);
  lines[7] = Float.toString(mat.m13);
  lines[8] = Float.toString(mat.m20);
  lines[9] = Float.toString(mat.m21);
  lines[10] = Float.toString(mat.m22);
  lines[11] = Float.toString(mat.m23);
  lines[12] = Float.toString(mat.m30);
  lines[13] = Float.toString(mat.m31);
  lines[14] = Float.toString(mat.m32);
  lines[15] = Float.toString(mat.m33);
  pa.saveStrings(filename, lines);
}
origin: org.processing/core

/**
 * ( begin auto-generated from saveStrings.xml )
 *
 * Writes an array of strings to a file, one line per string. This file is
 * saved to the sketch's folder, which is opened by selecting "Show sketch
 * folder" from the "Sketch" menu.<br />
 * <br />
 * It is not possible to use saveXxxxx() functions inside a web browser
 * unless the sketch is <a
 * href="http://wiki.processing.org/w/Sign_an_Applet">signed applet</A>. To
 * save a file back to a server, see the <a
 * href="http://wiki.processing.org/w/Saving_files_to_a_web-server">save to
 * web</A> code snippet on the Processing Wiki.<br/>
 * <br/ >
 * Starting with Processing 1.0, all files loaded and saved by the
 * Processing API use UTF-8 encoding. In previous releases, the default
 * encoding for your platform was used, which causes problems when files
 * are moved to other platforms.
 *
 * ( end auto-generated )
 * @webref output:files
 * @param filename filename for output
 * @param data string array to be written
 * @see PApplet#loadStrings(String)
 * @see PApplet#loadBytes(String)
 * @see PApplet#saveBytes(String, byte[])
 */
public void saveStrings(String filename, String data[]) {
 saveStrings(saveFile(filename), data);
}
origin: mirador/mirador

PApplet.saveStrings(cfgFile, new String[] {miraFolder.getAbsolutePath()});
origin: mirador/mirador

PApplet.saveStrings(varFile, varLines);
PApplet.saveStrings(pvalFile, pvalLines);
PApplet.saveStrings(rangeFile, rangeLines);
PApplet.saveStrings(aliasFile, aliasLines);
PApplet.saveStrings(unitsFile, unitLines);
PApplet.saveStrings(outFile, outLines);    
processing.corePAppletsaveStrings

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
  • 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
  • random
    ( begin auto-generated from random.xml ) Generates random numbers. Each time the random() function
  • parseInt,
  • random,
  • round,
  • split,
  • sqrt,
  • unhex,
  • arrayCopy,
  • ceil,
  • checkExtension

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • startActivity (Activity)
  • getSystemService (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Runner (org.openjdk.jmh.runner)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Sublime Text plugins
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