Package com.eclipsesource.tabris.widgets

Examples of com.eclipsesource.tabris.widgets.ClientCanvas


    new ClientCanvasOperator( null );
  }

  @Test
  public void testFiresDrawEvent() {
    ClientCanvas clientCanvas = new ClientCanvas( shell, SWT.NONE );
    ClientDrawListener drawListener = mock( ClientDrawListener.class );
    clientCanvas.addClientDrawListener( drawListener );
    ClientCanvasOperator operator = new ClientCanvasOperator( clientCanvas );
    environment.newRequest();
    JsonObject drawings = new JsonObject();
    drawings.add( ClientCanvasOperator.DRAWINGS_PROPERTY, JsonValue.valueOf( ClientCanvasTestUtil.createDrawings( 1 ) ) );
    environment.dispatchNotify( ClientCanvasOperator.DRAWING_EVENT, drawings );
View Full Code Here


    verify( drawListener ).receivedDrawing();
  }

  @Test
  public void testAddsDrawingToCache() {
    ClientCanvas clientCanvas = new ClientCanvas( shell, SWT.NONE );
    ClientDrawListener drawListener = mock( ClientDrawListener.class );
    clientCanvas.addClientDrawListener( drawListener );
    ClientCanvasOperator operator = new ClientCanvasOperator( clientCanvas );
    environment.newRequest();
    JsonObject drawings = new JsonObject();
    drawings.add( ClientCanvasOperator.DRAWINGS_PROPERTY, JsonValue.valueOf( ClientCanvasTestUtil.createDrawings( 1 ) ) );
    environment.dispatchNotify( ClientCanvasOperator.DRAWING_EVENT, drawings );

    operator.handleNotify( clientCanvas, ClientCanvasOperator.DRAWING_EVENT, drawings );

    DrawingsCache cache = clientCanvas.getAdapter( DrawingsCache.class );
    assertFalse( cache.getCachedDrawings().isEmpty() );
  }
View Full Code Here

    assertFalse( cache.getCachedDrawings().isEmpty() );
  }

  @Test( expected = UnsupportedOperationException.class )
  public void testDispatchesUnknownEventsToControlOperator() {
    ClientCanvas clientCanvas = new ClientCanvas( shell, SWT.NONE );
    ClientCanvasOperator operator = new ClientCanvasOperator( clientCanvas );

    operator.handleNotify( clientCanvas, "foobar", null );
  }
View Full Code Here

  @Before
  public void setUp() {
    Display display = new Display();
    Shell shell = new Shell( display );
    clientCanvas = new ClientCanvas( shell, SWT.NONE );
  }
View Full Code Here

      index, x, y
    } );
  }

  private void createClientCanvas( final Display display, Composite mainComp ) {
    canvas = new ClientCanvas( mainComp, SWT.NONE );
    canvas.setLayoutData( createFill() );
    if( bgPatternImage != null ) {
      canvas.setBackgroundImage( bgPatternImage );
    } else {
      canvas.setBackground( display.getSystemColor( SWT.COLOR_WHITE ) );
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.widgets.ClientCanvas

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.