Package org.eclipse.rap.json

Examples of org.eclipse.rap.json.JsonArray


    polyline.add( 8 );
    return polyline;
  }

  private static JsonArray createLineWidthParam( int lineWidth ) {
    JsonArray drawingParam2 = new JsonArray();
    drawingParam2.add( Constants.PROPERTY_LINE_WIDTH );
    JsonArray lineWidthArray = new JsonArray();
    lineWidthArray.add( lineWidth );
    drawingParam2.add( lineWidthArray );
    return drawingParam2;
  }
View Full Code Here


    drawingParam2.add( lineWidthArray );
    return drawingParam2;
  }

  private static JsonArray createColorParam() {
    JsonArray drawingParam3 = new JsonArray();
    drawingParam3.add( Constants.PROPERTY_FOREGROUND );
    JsonArray color = new JsonArray();
    color.add( 50 );
    color.add( 100 );
    color.add( 200 );
    color.add( 10 ); // alpha
    drawingParam3.add( color );
    return drawingParam3;
  }
View Full Code Here

  public void setBackground( Color color ) {
    setColor( PROPERTY_BACKGROUND, color );
  }

  private void setColor( String name, Color color ) {
    JsonArray jsonArray = new JsonArray();
    jsonArray.add( color.getRed() );
    jsonArray.add( color.getGreen() );
    jsonArray.add( color.getBlue() );
    remoteObject.set( name, jsonArray );
  }
View Full Code Here

  private void setImage() {
    Image image = createImage( descriptor.getImage() );
    if( image != null ) {
      Rectangle bounds = image.getBounds();
      JsonArray imageData = new JsonArray();
      imageData.add( ImageFactory.getImagePath( image ) );
      imageData.add( bounds.width );
      imageData.add( bounds.height );
      remoteObject.set( PROPERTY_IMAGE, imageData );
    }
  }
View Full Code Here

  private void setImage() {
    Image image = createImage( descriptor.getImage() );
    if( image != null ) {
      Rectangle bounds = image.getBounds();
      JsonArray imageData = new JsonArray();
      imageData.add( ImageFactory.getImagePath( image ) );
      imageData.add( bounds.width );
      imageData.add( bounds.height );
      remoteObject.set( PROPERTY_IMAGE, imageData );
    }
  }
View Full Code Here

  }

  private void addResolution( JsonObject properties, CameraOptions options ) {
    Point resolution = options.getResolution();
    if( resolution != null ) {
      JsonArray jsonArray = new JsonArray();
      jsonArray.add( resolution.x );
      jsonArray.add( resolution.y );
      properties.add( PROPERTY_RESOLUTION, jsonArray );
    }
  }
View Full Code Here

  protected List<EcommerceItem> getItems() {
    return items;
  }

  public String buildJson() {
    JsonArray jsonArray = new JsonArray();
    for( EcommerceItem item : items ) {
      JsonArray itemJsonArray = new JsonArray();
      itemJsonArray.add( item.getSku() != null ? item.getSku() : "" );
      itemJsonArray.add( item.getName() );
      itemJsonArray.add( item.getCategory() != null ? item.getCategory() : "" );
      itemJsonArray.add( toDouble( item.getPrice() != null ? item.getPrice() : new BigDecimal( 0 ) ) );
      itemJsonArray.add( item.getQuantity() );
      jsonArray.add( itemJsonArray );
    }
    return jsonArray.toString();
  }
View Full Code Here

    counter = 1;
  }

  public CustomVariablesBuilder addCustomVariable( String key, String value ) {
    validateArguments( key, value );
    jsonObject.add( String.valueOf( counter++ ), new JsonArray().add( key ).add( value ) );
    return this;
  }
View Full Code Here

    }
    throw new IllegalStateException( "RemotePage with id " + pageRendererId + " does not exist." );
  }

  private void setColor( String name, Color color ) {
    JsonArray jsonArray = new JsonArray();
    jsonArray.add( color.getRed() );
    jsonArray.add( color.getGreen() );
    jsonArray.add( color.getBlue() );
    remoteObject.set( name, jsonArray );
  }
View Full Code Here

  }

  private void addResolution( JsonObject properties, CameraOptions options ) {
    Point resolution = options.getResolution();
    if( resolution != null ) {
      JsonArray jsonArray = new JsonArray();
      jsonArray.add( resolution.x );
      jsonArray.add( resolution.y );
      properties.add( PROPERTY_RESOLUTION, jsonArray );
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.rap.json.JsonArray

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.