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

How to use
parseFloat
method
in
processing.core.PApplet

Best Java code snippets using processing.core.PApplet.parseFloat (Showing top 20 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

void setStrokeOpacity(String opacityText) {
 strokeOpacity = PApplet.parseFloat(opacityText);
 strokeColor = ((int) (strokeOpacity * 255)) << 24 | strokeColor & 0xFFFFFF;
}
origin: org.processing/core

void setFillOpacity(String opacityText) {
 fillOpacity = PApplet.parseFloat(opacityText);
 fillColor = ((int) (fillOpacity * 255)) << 24 | fillColor & 0xFFFFFF;
}
origin: org.processing/core

void setStrokeOpacity(String opacityText) {
 strokeOpacity = PApplet.parseFloat(opacityText);
 strokeColor = ((int) (strokeOpacity * 255)) << 24 | strokeColor & 0xFFFFFF;
}
origin: ajavamind/Processing-Cardboard

void setOpacity(String opacityText) {
 opacity = PApplet.parseFloat(opacityText);
 strokeColor = ((int) (opacity * 255)) << 24 | strokeColor & 0xFFFFFF;
 fillColor = ((int) (opacity * 255)) << 24 | fillColor & 0xFFFFFF;
}
origin: org.processing/core

void setOpacity(String opacityText) {
 opacity = PApplet.parseFloat(opacityText);
 strokeColor = ((int) (opacity * 255)) << 24 | strokeColor & 0xFFFFFF;
 fillColor = ((int) (opacity * 255)) << 24 | fillColor & 0xFFFFFF;
}
origin: ajavamind/Processing-Cardboard

void setFillOpacity(String opacityText) {
 fillOpacity = PApplet.parseFloat(opacityText);
 fillColor = ((int) (fillOpacity * 255)) << 24 | fillColor & 0xFFFFFF;
}
origin: org.processing/core

static final public float[] parseFloat(String what[]) {
 return parseFloat(what, Float.NaN);
}
origin: ajavamind/Processing-Cardboard

static final public float parseFloat(String what) {
  return parseFloat(what, Float.NaN);
}
origin: org.processing/core

static final public float parseFloat(String what) {
 return parseFloat(what, Float.NaN);
}
origin: ajavamind/Processing-Cardboard

static final public float[] parseFloat(String what[]) {
  return parseFloat(what, Float.NaN);
}
origin: ajavamind/Processing-Cardboard

/**
 * @param defaultValue the default value of the attribute
 */
public float getFloatContent(float defaultValue) {
 return PApplet.parseFloat(node.getTextContent(), defaultValue);
}
origin: org.processing/core

/**
 * @param defaultValue the default value of the attribute
 */
public float getFloatContent(float defaultValue) {
 return PApplet.parseFloat(node.getTextContent(), defaultValue);
}
origin: org.processing/core

/**
 * Construct an FloatList from a random pile of objects.
 * Un-parseable or null values will be set to NaN.
 */
public FloatList(Object... items) {
 // nuts, no good way to pass missingValue to this fn (varargs must be last)
 final float missingValue = Float.NaN;
 count = items.length;
 data = new float[count];
 int index = 0;
 for (Object o : items) {
  float value = missingValue;
  if (o != null) {
   if (o instanceof Number) {
    value = ((Number) o).floatValue();
   } else {
    value = PApplet.parseFloat(o.toString().trim(), missingValue);
   }
  }
  data[index++] = value;
 }
}
origin: mirador/mirador

public float getSize(String clazz, String property, float dflt) {
 Properties props = properties.get(clazz);    
 if (props == null) return dflt;
 String value = props.get(property);  
 if (value == null) return dflt;
 value = value.replaceAll("px", "").replaceAll("pt", "");
 return Display.scalef(PApplet.parseFloat(value, dflt));
}   

origin: mirador/mirador

public float getPosition(String clazz, String property, float dflt) {
 Properties props = properties.get(clazz);    
 if (props == null) return dflt;
 String value = props.get(property);
 if (value == null) return dflt;
 value = value.replaceAll("px", "").replaceAll("pt", "");
 return Display.scalef(PApplet.parseFloat(value, dflt));
}  

origin: org.processing/core

/**
 * Read a set of entries from a Reader that has each key/value pair on
 * a single line, separated by a tab.
 *
 * @nowebref
 */
public FloatDict(BufferedReader reader) {
 String[] lines = PApplet.loadStrings(reader);
 keys = new String[lines.length];
 values = new float[lines.length];
 for (int i = 0; i < lines.length; i++) {
  String[] pieces = PApplet.split(lines[i], '\t');
  if (pieces.length == 2) {
   keys[count] = pieces[0];
   values[count] = PApplet.parseFloat(pieces[1]);
   indices.put(pieces[0], count);
   count++;
  }
 }
}
origin: ajavamind/Processing-Cardboard

 /**
  * Read a set of entries from a Reader that has each key/value pair on
  * a single line, separated by a tab.
  *
  * @nowebref
  */
 public FloatDict(BufferedReader reader) {
//  public FloatHash(PApplet parent, String filename) {
  String[] lines = PApplet.loadStrings(reader);
  keys = new String[lines.length];
  values = new float[lines.length];

//    boolean csv = (lines[0].indexOf('\t') == -1);
  for (int i = 0; i < lines.length; i++) {
//      String[] pieces = csv ? Table.splitLineCSV(lines[i]) : PApplet.split(lines[i], '\t');
   String[] pieces = PApplet.split(lines[i], '\t');
   if (pieces.length == 2) {
    keys[count] = pieces[0];
    values[count] = PApplet.parseFloat(pieces[1]);
    count++;
   }
  }
 }

origin: org.processing/core

/**
 * Get a float value from the specified row and column. If the value is null
 * or not parseable as a float, the "missing" value is returned. By default,
 * this is Float.NaN, but can be controlled with setMissingFloat().
 *
 * @webref table:method
 * @brief Get a float value from the specified row and column
 * @param row ID number of the row to reference
 * @param column ID number of the column to reference
 * @see Table#getInt(int, int)
 * @see Table#getString(int, int)
 * @see Table#getStringColumn(String)
 * @see Table#setInt(int, int, int)
 * @see Table#setFloat(int, int, float)
 * @see Table#setString(int, int, String)
 */
public float getFloat(int row, int column) {
 checkBounds(row, column);
 if (columnTypes[column] == FLOAT) {
  float[] floatData = (float[]) columns[column];
  return floatData[row];
 }
 String str = getString(row, column);
 if (str == null || str.equals(missingString)) {
  return missingFloat;
 }
 return PApplet.parseFloat(str, missingFloat);
}
origin: ajavamind/Processing-Cardboard

/**
 * Get a float value from the specified row and column. If the value is null
 * or not parseable as a float, the "missing" value is returned. By default,
 * this is Float.NaN, but can be controlled with setMissingFloat().
 *
 * @webref table:method
 * @brief Get a float value from the specified row and column
 * @param row ID number of the row to reference
 * @param column ID number of the column to reference
 * @see Table#getInt(int, int)
 * @see Table#getString(int, int)
 * @see Table#getStringColumn(String)
 * @see Table#setInt(int, int, int)
 * @see Table#setFloat(int, int, float)
 * @see Table#setString(int, int, String)
 */
public float getFloat(int row, int column) {
 checkBounds(row, column);
 if (columnTypes[column] == FLOAT) {
  float[] floatData = (float[]) columns[column];
  return floatData[row];
 }
 String str = getString(row, column);
 if (str == null || str.equals(missingString)) {
  return missingFloat;
 }
 return PApplet.parseFloat(str, missingFloat);
}
origin: org.processing/core

/**
 * Construct an FloatList from an iterable pile of objects.
 * For instance, a float array, an array of strings, who knows).
 * Un-parseable or null values will be set to NaN.
 * @nowebref
 */
public FloatList(Iterable<Object> iter) {
 this(10);
 for (Object o : iter) {
  if (o == null) {
   append(Float.NaN);
  } else if (o instanceof Number) {
   append(((Number) o).floatValue());
  } else {
   append(PApplet.parseFloat(o.toString().trim()));
  }
 }
 crop();
}
processing.corePAppletparseFloat

Javadoc

Convert an int to a float value. Also handles bytes because of Java's rules for upgrading values.

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