Package org.eclipse.rap.json

Examples of org.eclipse.rap.json.JsonArray


   */
  public ShellDecorator setOverlayColor( Color color, int alpha ) {
    whenNull( color ).throwIllegalArgument( "Color must not be null" );
    when( alpha < 0 || alpha > 255 ).throwIllegalArgument( "Alpha must be >= 0 and <= 255 but was " + alpha );
    RGB rgb = color.getRGB();
    JsonArray overlay = new JsonArray().add( rgb.red ).add( rgb.green ).add( rgb.blue ).add( alpha );
    setData( shell, OVERLAY_COLOR, overlay );
    return this;
  }
View Full Code Here


    }
  }

  private JsonObject createMessageObject( Collection<String> servletPaths ) {
    JsonObject jsonObject = new JsonObject();
    JsonArray array = new JsonArray();
    appendPaths( ( List<String> )servletPaths, array );
    jsonObject.add( KEY_ENTRYPOINTS, array );
    return jsonObject;
  }
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


public class JsonUtil {

  public static JsonArray createJsonArray( String... proposalsToSend ) {
    JsonArray result = new JsonArray();
    for( String proposal : proposalsToSend ) {
      result.add( proposal );
    }
    return result;
  }
View Full Code Here

    }
    return result;
  }

  public static JsonArray createJsonArray( int... values ) {
    JsonArray array = new JsonArray();
    for( int i = 0; i < values.length; i++ ) {
      array.add( values[ i ] );
    }
    return array;
  }
View Full Code Here

      serviceObject.call( METHOD_REMOVE, properties );
    }
  }

  private JsonArray createJsonArray( String[] keys ) {
    JsonArray result = new JsonArray();
    for( String key : keys ) {
      result.add( key );
    }
    return result;
  }
View Full Code Here

    restoreLastSettings( lineWidth, foreground, alpha );
  }

  private void dispatchOperations() {
    for( int i = 0; i < drawings.size(); i++ ) {
      JsonArray operation = drawings.get( i ).asArray();
      dispatchOperation( operation );
    }
  }
View Full Code Here

    gc.setAlpha( alpha );
  }

  private void dispatchOperation( JsonArray operation ) {
    String operationType = operation.get( 0 ).asString();
    JsonArray parameters = operation.get( 1 ).asArray();
    if( PROPERTY_LINE_WIDTH.equals( operationType ) ) {
      dispatchLineWidth( parameters );
    } else if( PROPERTY_FOREGROUND.equals( operationType ) ) {
      dispatchSetForeground( parameters );
    } else if( PROPERTY_PATH.equals( operationType ) ) {
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

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.