List of usage examples for com.badlogic.gdx.utils.async AsyncExecutor AsyncExecutor
public AsyncExecutor(int maxConcurrent)
From source file:es.eucm.gleaner.tracker.storage.LocalStorage.java
License:Apache License
/** * @param tracesFile/* w ww .j a v a 2s . co m*/ * file where to write the traces */ public LocalStorage(FileHandle tracesFile) { this.tracesFile = tracesFile; asyncExecutor = new AsyncExecutor(1); writeTask = new WriteTask(tracesFile); }
From source file:es.eucm.ead.editor.control.background.BackgroundExecutor.java
License:Open Source License
public BackgroundExecutor() { tasks = new Array<Execution>(); this.asyncExecutor = new AsyncExecutor(Math.max(1, Runtime.getRuntime().availableProcessors() - 1)); }
From source file:es.eucm.ead.editor.utils.ShapeEditor.java
License:Open Source License
@Override public void create() { super.create(); executor = new AsyncExecutor(1); // prepare rendering aids shapeRenderer = new ShapeRenderer(); Gdx.input.setInputProcessor(this); }
From source file:es.eucm.ead.editor.utils.TexturedShapeEditor.java
License:Open Source License
@Override public void create() { super.create(); executor = new AsyncExecutor(1); // create a string of generally-overlapping polygons, will draw in // blue//w ww. j a v a 2 s. c o m GeoTester.randomPolys(3, 40, 80, new Vector2(100, 300), blue); float s = 10; Polygon p0 = new Polygon(new float[] { // north-west, low, north-east 0, 3 * s, 0, 2 * s, 2 * s, 0, 3 * s, 0, 4.5f * s, 2 * s, 6 * s, 0, 7 * s, 0, 9 * s, 2 * s, 9 * s, 3 * s, // north-east, high, north-west 8 * s, 3 * s, 6.5f * s, 1 * s, 5 * s, 3 * s, 4 * s, 3 * s, 2.5f * s, s, 1 * s, 3 * s }); blue.add(p0); // merge them into a single polygon, will draw in red for (Polygon bp : blue) { GeometryUtils.merge(geo, bp); } Geometry collapsed = GeometryUtils.collapse(geo); Polygon p = GeometryUtils.jtsCoordsToGdx(collapsed.getCoordinates()); red.add(p); triangles = GeometryUtils.triangulate(collapsed); Gdx.app.error("GeoTester", "ready to display triangles worth " + triangles.length + " vertices"); // use the polygon to clip a randomly-generated texture textureSolid = new Texture(GeoTester.randomPixmap(100, 100, null), false); PolygonRegion polyReg = new PolygonRegion(new TextureRegion(textureSolid), p.getVertices(), triangles); poly = new PolygonSprite(polyReg); poly.setOrigin(p.getVertices()[0], p.getVertices()[1]); polyBatch = new PolygonSpriteBatch(); // prepare rendering aids shapeRenderer = new ShapeRenderer(); Gdx.input.setInputProcessor(this); }