Java Code Examples for processing.core.PApplet#println()

The following examples show how to use processing.core.PApplet#println() . 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: Tileset.java    From Project-16x16 with GNU General Public License v3.0 6 votes vote down vote up
public static ArrayList<PImage> getAnimation(String name){
	for(int i = 0; i < JSONanimations.size(); i++)
	{
		JSONObject animation = JSONanimations.getJSONObject(i);
		if (animation.getString("name").contentEquals(name))
		{
			ArrayList<PImage> tiles = new ArrayList<PImage>();
			JSONArray tileRefs = animation.getJSONArray("tileRef");
			
			for(int k = 0; k < tileRefs.size(); k++)
			{
				JSONObject tileRef = tileRefs.getJSONObject(k);
				tiles.add(getTile(tileRef.getString("name")));
			}

			return tiles;
		}
	}
	PApplet.println("<Tileset> Error while loading, null string reference to animation ( " + name + " ) >");
	return null;
}
 
Example 2
Source File: SurfaceMapper.java    From sketch-mapper with MIT License 6 votes vote down vote up
/**
 * Delete the selected surfaces
 */
public void removeSelectedSurfaces() {
    for (SuperSurface ss : selectedSurfaces) {
        for (int i = surfaces.size() - 1; i >= 0; i--) {
            if (ss.getId() == surfaces.get(i).getId()) {
                if (ss.isLocked())
                    return;
                if (this.getDebug())
                    PApplet.println("SurfaceMapper --> DELETED SURFACE with ID: #" + ss.getId());
                surfaces.remove(i);
            }
        }
    }
    this.setGrouping(false);
    selectedSurfaces.clear();
    if (surfaces.size() == 0)
        numAddedSurfaces = 0;
}
 
Example 3
Source File: Tileset.java    From Project-16x16 with GNU General Public License v3.0 5 votes vote down vote up
public static PImage getTile(int Id) {
	if (tiles[Id] != null) {
		return tiles[Id].getPImage();
	} else {
		PApplet.println("<Tileset> Error while loading, null index reference to tile ( " + Id + " ) >");
		return null; // TODO return placeholder?
	}
}
 
Example 4
Source File: Tileset.java    From Project-16x16 with GNU General Public License v3.0 5 votes vote down vote up
public static Tile getTileObject(int Id) {
	if (tiles[Id] != null) {
		return tiles[Id];
	} else {
		PApplet.println("<Tileset> Error while loading, null index reference to tile ( " + Id + " ) >");
		return null; // TODO return placeholder?
	}
}
 
Example 5
Source File: Tileset.java    From Project-16x16 with GNU General Public License v3.0 5 votes vote down vote up
public static String getTileName(int Id)
{
	if (tiles[Id] != null)
		return tiles[Id].getName();
	
	PApplet.println("<Tileset> Error while loading, null ID reference to tile ( " + Id + " ) >");
	return "";
}
 
Example 6
Source File: Tileset.java    From Project-16x16 with GNU General Public License v3.0 5 votes vote down vote up
public static int getTileId(String name){
	if (tileRefs.containsKey(name))
		return tileRefs.get(name);
	
	PApplet.println("<Tileset> Error while loading, null string reference to tile ( " + name + " ) >");
	return 0;
}
 
Example 7
Source File: Tileset.java    From Project-16x16 with GNU General Public License v3.0 5 votes vote down vote up
public static TileType getTileType(int Id) {
	if (tiles[Id] != null)
		return tiles[Id].getTileType();
	
	PApplet.println("<Tileset> Error while loading, null ID reference to tile ( " + Id + " ) >");
	return null;
}
 
Example 8
Source File: Camera.java    From PapARt with GNU Lesser General Public License v3.0 5 votes vote down vote up
static public void convertARParams(PApplet parent, String calibrationFile,
            String calibrationARtoolkit, int width, int height) {
        try {
            // ARToolkit Plus 2.1.1
//            fr.inria.papart.procam.Utils.convertARParam(parent, calibrationYAML, calibrationData, width, height);
            // ARToolkit Plus 2.3.0
            fr.inria.papart.utils.ARToolkitPlusUtils.convertARParam2(parent, calibrationFile, calibrationARtoolkit);
        } catch (Exception e) {
            PApplet.println("Conversion error. " + e);
        }
    }
 
Example 9
Source File: Camera.java    From PapARt with GNU Lesser General Public License v3.0 5 votes vote down vote up
static public void convertARParams(PApplet parent, ProjectiveDeviceP projectiveDevice,
        String calibrationARtoolkit) {
    try {
        fr.inria.papart.utils.ARToolkitPlusUtils.convertARParamFromDevice(parent, projectiveDevice, calibrationARtoolkit);
    } catch (Exception e) {
        PApplet.println("Conversion error. " + e);
    }
}
 
Example 10
Source File: SurfaceMapper.java    From sketch-mapper with MIT License 5 votes vote down vote up
/**
 * Save all projection mapping data to file
 *
 * @param file
 */
public void save(File file) {
    if (this.MODE == SurfaceMapper.MODE_CALIBRATE) {
        XML root = new XML("root");
        this.save(root);
        try {
            root.save(file);
        } catch (Exception e) {
            PApplet.println(e.getStackTrace());
        }
    }
}
 
Example 11
Source File: MarchingCubes.java    From haxademic with MIT License 5 votes vote down vote up
public void addMetaBox(PVector aabbMin, PVector aabbMax, float metaValue){
	for(int i=0; i<voxels.length; i++){
		for(int j=0; j<voxels[i].length; j++){
			for(int k=0; k<voxels[i][j].length; k++){
				if(voxels[i][j][k].x > aabbMin.x && voxels[i][j][k].y > aabbMin.y &&
						voxels[i][j][k].z > aabbMin.z && voxels[i][j][k].x < aabbMax.x &&
						voxels[i][j][k].y < aabbMax.y && voxels[i][j][k].z < aabbMax.z){
					PApplet.println("added");
					voxelValues[i][j][k] += metaValue;
				}
			}
		}
	}
}
 
Example 12
Source File: Engine.java    From processing-sound with GNU Lesser General Public License v2.1 4 votes vote down vote up
protected static void printMessage(String message) {
	PApplet.println("Sound library: " + message);
}
 
Example 13
Source File: Engine.java    From processing-sound with GNU Lesser General Public License v2.1 4 votes vote down vote up
protected static void printWarning(String message) {
	PApplet.println("Sound library warning: " + message);
}
 
Example 14
Source File: Engine.java    From processing-sound with GNU Lesser General Public License v2.1 4 votes vote down vote up
protected static void printError(String message) {
	PApplet.println("Sound library error: " + message);
}
 
Example 15
Source File: SurfaceMapper.java    From sketch-mapper with MIT License 4 votes vote down vote up
/**
 * Load projection map from file
 *
 * @param file
 */
public void load(File file) {
    if (this.MODE == SurfaceMapper.MODE_CALIBRATE) {
        if (file.exists()) {
            this.setGrouping(false);
            selectedSurfaces.clear();
            surfaces.clear();
            try {
                XML root = new XML(file);
                for (int i = 0; i < root.getChildCount(); i++) {
                    if (root.getChild(i).getName().equals("surface")) {
                        SuperSurface loaded = null;
                        if (SuperSurface.BEZIER == root.getChild(i).getInt("type")) {
                            loaded = new BezierSurface(parent, this, root.getChild(i), root.getChild(i).getInt("id"), root.getChild(i).getString("name"));
                        } else {
                            loaded = new QuadSurface(parent, this, root.getChild(i), root.getChild(i).getInt("id"), root.getChild(i).getString("name"));
                        }
                        if (ccolor.length > 0)
                            loaded.setColor(ccolor[numAddedSurfaces % ccolor.length]);
                        loaded.setModeCalibrate();
                        final String sketch = root.getChild(i).getString("sketch");
                        if (null != sketch && sketch.trim().length() > 0) {
                            loadSketch(loaded, sketch);
                        }
                        surfaces.add(loaded);
                        numAddedSurfaces++;
                    }
                }
                if (this.getDebug())
                    PApplet.println("Projection layout loaded from " + file.getName() + ". " + surfaces.size()
                                    + " surfaces were loaded!");
            } catch (Exception e) {
                PApplet.println("Error loading configuration!!!");
                e.printStackTrace();
            }
        } else {
            if (this.getDebug())
                PApplet.println("ERROR loading XML! No projection layout exists!");
        }
    }

}
 
Example 16
Source File: PClass.java    From Project-16x16 with GNU General Public License v3.0 2 votes vote down vote up
/**
 * prints a line to the applet. most likely for debugging purposes.
 * @param msg The line to be written.
 */
public void println(String msg) {
	PApplet.println(msg);
}