Package org.jbox2d.serialization

Examples of org.jbox2d.serialization.SerializationResult


    } // end of run loop
  }


  private void _save() {
    SerializationResult result;
    try {
      result = currTest.getSerializer().serialize(currTest.getWorld());
    } catch (UnsupportedObjectException e1) {
      log.error("Error serializing world", e1);
      if (errorHandler != null)
        errorHandler.serializationError(e1, "Error serializing the object: " + e1.toString());
      return;
    }

    try {
      FileOutputStream fos = new FileOutputStream(currTest.getFilename());
      result.writeTo(fos);
      fos.flush();
      fos.close();
    } catch (FileNotFoundException e) {
      log.error("File not found exception while saving", e);
      if (errorHandler != null)
View Full Code Here


    } // end of run loop
  }


  private void _save() {
    SerializationResult result;
    try {
      result = currTest.getSerializer().serialize(currTest.getWorld());
    } catch (UnsupportedObjectException e1) {
      log.error("Error serializing world", e1);
      if (errorHandler != null)
        errorHandler.serializationError(e1, "Error serializing the object: " + e1.toString());
      return;
    }

    try {
      FileOutputStream fos = new FileOutputStream(currTest.getFilename());
      result.writeTo(fos);
      fos.flush();
      fos.close();
    } catch (FileNotFoundException e) {
      log.error("File not found exception while saving", e);
      if (errorHandler != null)
View Full Code Here

  }

  @Override
  public SerializationResult serialize(World argWorld) {
    final PbWorld world = serializeWorld(argWorld).build();
    return new SerializationResult() {
      @Override
      public void writeTo(OutputStream argOutputStream) throws IOException {
        world.writeTo(argOutputStream);
      }
View Full Code Here

    PbBody.Builder builder = serializeBody(argBody);
    if (builder == null) {
      return null;
    }
    final PbBody body = builder.build();
    return new SerializationResult() {
      @Override
      public void writeTo(OutputStream argOutputStream) throws IOException {
        body.writeTo(argOutputStream);
      }
View Full Code Here

  }

  @Override
  public SerializationResult serialize(Fixture argFixture) {
    final PbFixture fixture = serializeFixture(argFixture).build();
    return new SerializationResult() {
      @Override
      public void writeTo(OutputStream argOutputStream) throws IOException {
        fixture.writeTo(argOutputStream);
      }
View Full Code Here

    if (builder == null) {
      return null;
    }
    // should we do lazy building?
    final PbShape shape = builder.build();
    return new SerializationResult() {
      @Override
      public void writeTo(OutputStream argOutputStream) throws IOException {
        shape.writeTo(argOutputStream);
      }
View Full Code Here

    PbJoint.Builder builder = serializeJoint(argJoint, argBodyIndexMap, argJointIndexMap);
    if (builder == null) {
      return null;
    }
    final PbJoint joint = builder.build();
    return new SerializationResult() {
      @Override
      public void writeTo(OutputStream argOutputStream) throws IOException {
        joint.writeTo(argOutputStream);
      }
View Full Code Here

TOP

Related Classes of org.jbox2d.serialization.SerializationResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.