Tabnine Logo
JSONAnnotation.fromJSON
Code IndexAdd Tabnine to your IDE (free)

How to use
fromJSON
method
in
com.oculusinfo.annotation.impl.JSONAnnotation

Best Java code snippets using com.oculusinfo.annotation.impl.JSONAnnotation.fromJSON (Showing top 7 results out of 315)

origin: unchartedsoftware/aperture-tiles

  @Override
  protected JSONAnnotation getValue(Object obj) throws JSONException {
    
    return JSONAnnotation.fromJSON( (JSONObject)obj );
  }
}
origin: unchartedsoftware/aperture-tiles

public AnnotationData<?> generateJSONAnnotation() {
  return JSONAnnotation.fromJSON(generateJSON());
}
origin: unchartedsoftware/aperture-tiles

public synchronized AnnotationData<?> clone() {
  JSONObject json = _data.toJSON();
  return JSONAnnotation.fromJSON( json );
}
origin: unchartedsoftware/aperture-tiles

JSONAnnotation annotation = JSONAnnotation.fromJSON( json.getJSONObject("annotation") );
Pair<String, Long> certificate = _service.write( layer, annotation );
jsonResult.put("uuid", certificate.getFirst() );
JSONAnnotation annotation = JSONAnnotation.fromJSON( json.getJSONObject("annotation") );
Pair<String, Long> certificate = _service.modify(layer, annotation);
jsonResult.put("uuid", certificate.getFirst() );
origin: unchartedsoftware/aperture-tiles

  private AnnotationData<?> editAnnotation( AnnotationData<?> annotation ) {
    JSONObject json = annotation.toJSON();
    AnnotationGenerator generator = new AnnotationGenerator( BOUNDS, _groups );
    try {
      int type = (int)(Math.random() * 2);
      switch (type) {
      case 0:
        // change position
        double [] xy = generator.randomPosition();
        json.put("x", xy[0]);
        json.put("y", xy[1]);
        break;
      default:
        // change data
        JSONObject data = new JSONObject();
        data.put("comment", generator.randomComment() );
        json.put("data", data);
        break;
      }
    } catch ( Exception e ) {
      e.printStackTrace();
    }
    return JSONAnnotation.fromJSON(json);
  }
}
origin: unchartedsoftware/aperture-tiles

@Test
public void jsonAnnotationToFromTest () throws Exception {
  AnnotationGenerator generator = new AnnotationGenerator( BOUNDS, GROUPS );
  List<AnnotationData<?>> before = generator.generateJSONAnnotations( NUM_ENTRIES );
  List<AnnotationData<?>> after = new ArrayList<>();
  AnnotationUtil.printData( before );
  
  for ( AnnotationData<?> annotation : before ) {
    JSONObject json = annotation.toJSON();
    after.add( JSONAnnotation.fromJSON(json) );
  }
  
  AnnotationUtil.printData( after );
  
  Assert.assertTrue( AnnotationUtil.compareData( before, after ) );
}
origin: unchartedsoftware/aperture-tiles

@Test
public void jsonAnnotationToFromTest () throws Exception {
  AnnotationGenerator generator = new AnnotationGenerator( BOUNDS, GROUPS );
  List<AnnotationData<?>> before = generator.generateJSONAnnotations( NUM_ENTRIES );
  List<AnnotationData<?>> after = new ArrayList<>();
    
  AnnotationUtil.printData( before );
  
  for ( AnnotationData<?> annotation : before ) {
    JSONObject json = annotation.toJSON();
    after.add( JSONAnnotation.fromJSON(json) );
  }
  
  AnnotationUtil.printData( after );
  Assert.assertTrue( AnnotationUtil.compareData( before, after ) );
}
com.oculusinfo.annotation.implJSONAnnotationfromJSON

Popular methods of JSONAnnotation

  • <init>
  • getX1
  • getY1

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
  • findViewById (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • JCheckBox (javax.swing)
  • CodeWhisperer 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