processing.app.Sketch Java Examples

The following examples show how to use processing.app.Sketch. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PdeSketch.java    From Processing.R with GNU General Public License v3.0 6 votes vote down vote up
public PdeSketch(final Sketch sketch, final File sketchPath, final DisplayType displayType,
    final Point location, final LocationType locationType) {

  this.displayType = displayType;
  this.location = location;
  this.locationType = locationType;

  this.mainFile = sketchPath.getAbsoluteFile();
  this.mainCode = sketch.getMainProgram();
  this.sketchHome = sketch.getFolder().getAbsoluteFile();
  this.realSketchPath = sketchPath;

  final String[] codeFileNames = new String[sketch.getCodeCount()];
  for (int i = 0; i < codeFileNames.length; i++) {
    codeFileNames[i] = sketch.getCode(i).getFile().getName();
  }
  this.codeFileNames = codeFileNames;

  final List<File> libraryDirs = new ArrayList<>();
  libraryDirs.add(Platform.getContentFile("modes/java/libraries"));
  libraryDirs.add(Base.getSketchbookLibrariesFolder());
  libraryDirs.add(sketchPath);
  this.libraryDirs = libraryDirs;
}