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

How to use
loadXML
method
in
processing.core.PApplet

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

origin: ajavamind/Processing-Cardboard

/**
 * @param filename name of a file in the data folder or a URL.
 * @webref input:files
 * @see XML#parse(String)
 * @see PApplet#loadBytes(String)
 * @see PApplet#loadStrings(String)
 * @see PApplet#loadTable(String)
 */
public XML loadXML(String filename) {
  return loadXML(filename, null);
}
origin: org.processing/core

/**
 * @webref input:files
 * @param filename name of a file in the data folder or a URL.
 * @see XML
 * @see PApplet#parseXML(String)
 * @see PApplet#saveXML(XML, String)
 * @see PApplet#loadBytes(String)
 * @see PApplet#loadStrings(String)
 * @see PApplet#loadTable(String)
 */
public XML loadXML(String filename) {
 return loadXML(filename, null);
}
origin: org.processing/core

static protected PShape loadShapeImpl(PGraphics pg,
                   String filename, String extension) {
 if (extension.equals("svg") || extension.equals("svgz")) {
  PShapeSVG svg = new PShapeSVG(pg.parent.loadXML(filename));
  return PShapeOpenGL.createShape((PGraphicsOpenGL) pg, svg);
 }
 return null;
}
origin: ajavamind/Processing-Cardboard

static protected PShape loadShapeImpl(PGraphics pg,
                   String filename, String extension) {
 if (extension.equals("svg") || extension.equals("svgz")) {
  PShapeSVG svg = new PShapeSVG(pg.parent.loadXML(filename));
  return PShapeOpenGL.createShape((PGraphicsOpenGL) pg, svg);
 }
 return null;
}
origin: poqudrof/PapARt

@Override
public void loadFrom(PApplet parent, String fileName) {
  // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  XML root = parent.loadXML(fileName);
  XML cameraNode = root.getChild(CAMERA_XML_NAME);
  loadCameraFrom(cameraNode);
}
origin: poqudrof/PapARt

@Override
public void loadFrom(PApplet parent, String fileName) {
  XML root = parent.loadXML(fileName);
  XML planarTouchCalibNode = root.getChild(PLANAR_TOUCH_CALIBRATION_XML_NAME);
  getFrom(planarTouchCalibNode);
}
origin: poqudrof/PapARt

@Override
public void loadFrom(PApplet parent, String fileName) {
  // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  XML root = parent.loadXML(fileName);
  XML screenNode = root.getChild(SCREEN_XML_NAME);
  loadScreenFrom(screenNode);
}
origin: org.processing/core

@Override
public PShape loadShape(String filename, String options) {
 String extension = PApplet.getExtension(filename);
 if (extension.equals("svg") || extension.equals("svgz")) {
  return new PShapeJava2D(parent.loadXML(filename));
 }
 PGraphics.showWarning("Unsupported format: " + filename);
 return null;
}
origin: org.processing/core

@Override
public PShape loadShape(String filename, String options) {
 String extension = PApplet.getExtension(filename);
 if (extension.equals("svg") || extension.equals("svgz")) {
  return new PShapeSVG(parent.loadXML(filename));
 }
 PGraphics.showWarning("Unsupported format: " + filename);
 return null;
}
origin: poqudrof/PapARt

public void replaceIn(PApplet parent, String fileName) {
  assert (isValid());
  XML root = parent.loadXML(fileName);
  this.replaceIn(root);
  parent.saveXML(root, fileName);
}
origin: ajavamind/Processing-Cardboard

@Override
public PShape loadShape(String filename) {
 String extension = PApplet.getExtension(filename);
 PShapeSVG svg = null;
 if (extension.equals("svg")) {
  svg = new PShapeSVG(parent.loadXML(filename));
 } else if (extension.equals("svgz")) {
  try {
   InputStream input = new GZIPInputStream(parent.createInput(filename));
   XML xml = new XML(input);
   svg = new PShapeSVG(xml);
  } catch (Exception e) {
   e.printStackTrace();
  }
 } else {
  PGraphics.showWarning("Unsupported format");
 }
 return svg;
}
origin: poqudrof/PapARt

  public MarkerBoardSvg(String fileName, float width, float height) {
    super(fileName, width, height);
    // Trackers not used
//        trackers = new ArrayList<>();
    this.type = MarkerType.SVG;

    try {
      // TODO: better than getting the Papart object...
      XML xml = Papart.getPapart().getApplet().loadXML(getFileName());

      markersFromSVG = (new MarkerSVGReader(xml)).getList();
//        markersFromSVG = MarkerSvg.getMarkersFromSVG(xml);
    } catch (Exception e) {
      e.printStackTrace();
    }

  }

origin: poqudrof/PapARt

@Override
public void loadFrom(PApplet parent, String fileName) {
  XML root = parent.loadXML(fileName);
  XML resolutionNode = root.getChild(RESOLUTION_XML_NAME);
  this.width = resolutionNode.getInt(WIDTH_XML_NAME);
  this.height = resolutionNode.getInt(HEIGHT_XML_NAME);
  XML intrinsicsNode = root.getChild(INTRINSICS_XML_NAME);
  getMatFrom(intrinsicsNode, intrinsics);
  XML extrinsicsNode = root.getChild(EXTRINSICS_XML_NAME);
  if (extrinsicsNode == null) {
    this.hasExtrinsics = false;
    return;
  }
  getMatFrom(extrinsicsNode, extrinsics);
  checkExtrinsics();
}
origin: poqudrof/PapARt

@Override
public void loadFrom(PApplet parent, String fileName) {
  XML root = parent.loadXML(fileName);
  XML planeNode = root.getChild(PLANE_XML_NAME);
  XML posNode = planeNode.getChild(PLANE_POS_XML_NAME);
  XML normalNode = planeNode.getChild(PLANE_NORMAL_XML_NAME);
  XML heightNode = planeNode.getChild(PLANE_HEIGHT_XML_NAME);
  Vec3D position = getVectorFrom(posNode);
  Vec3D normal = getVectorFrom(normalNode);
  float h = heightNode.getFloat(PLANE_HEIGHT_XML_NAME);
  this.plane = new Plane();
  plane.set(position);
  plane.normal.set(normal);
  setHeight(h);
}
origin: poqudrof/PapARt

@Override
public void loadFrom(PApplet parent, String fileName) {
  XML root = parent.loadXML(fileName);
  XML homographyNode = root.getChild(HOMOGRAPHY_XML_NAME);
  pmatrix = new PMatrix3D();
  pmatrix.m00 = homographyNode.getFloat("m00");
  pmatrix.m01 = homographyNode.getFloat("m01");
  pmatrix.m02 = homographyNode.getFloat("m02");
  pmatrix.m03 = homographyNode.getFloat("m03");
  pmatrix.m10 = homographyNode.getFloat("m10");
  pmatrix.m11 = homographyNode.getFloat("m11");
  pmatrix.m12 = homographyNode.getFloat("m12");
  pmatrix.m13 = homographyNode.getFloat("m13");
  pmatrix.m20 = homographyNode.getFloat("m20");
  pmatrix.m21 = homographyNode.getFloat("m21");
  pmatrix.m22 = homographyNode.getFloat("m22");
  pmatrix.m23 = homographyNode.getFloat("m23");
  pmatrix.m30 = homographyNode.getFloat("m30");
  pmatrix.m31 = homographyNode.getFloat("m31");
  pmatrix.m32 = homographyNode.getFloat("m32");
  pmatrix.m33 = homographyNode.getFloat("m33");
  initMat();
}
processing.corePAppletloadXML

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

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • startActivity (Activity)
  • getResourceAsStream (ClassLoader)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Github Copilot alternatives
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