Package ch.blackspirit.graphics

Examples of ch.blackspirit.graphics.GraphicsListener


    });
    context.draw()
  }
  @Test (expected=IllegalArgumentException.class)
  public void drawSubImageNull() throws IOException {
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.drawImage(null, 640, 480, 0, 0, 10, 10);
      }
      public void init(View view, Graphics renderer) {}
View Full Code Here


    });
    context.draw()
  }
  @Test (expected=IllegalArgumentException.class)
  public void drawFlippedSubImageNull() throws IOException {
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.drawImage(null, 640, 480, 0, 0, 10, 10, Flip.BOTH);
      }
      public void init(View view, Graphics renderer) {}
View Full Code Here

  public static void main(String[] args) {
    RealtimeCanvas canvas = new CanvasFactory().createRealtimeCanvasWindow(512, 512);
    canvas.setWindowTitle("bla");
    final Image image = canvas.getImageFactory().createBufferedImage(521, 512, BufferTypes.RGB_3Byte);
   
    canvas.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics renderer) {
        renderer.drawImage(image, 512, 512);
      }
      public void init(View view, Graphics renderer) {
        view.setCamera(256, 256, 0);
View Full Code Here

  public static void main(String[] args) {
    RealtimeCanvas canvas = new CanvasFactory().createRealtimeCanvasWindow(512, 512);
    canvas.setWindowTitle("bla");
    final Image image = canvas.getImageFactory().createBufferedImage(521, 512, BufferTypes.RGBA_4Byte);
   
    canvas.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics renderer) {
        renderer.clear();
        renderer.drawImage(image, 512, 512);
      }
      public void init(View view, Graphics renderer) {
View Full Code Here

import ch.blackspirit.graphics.View;

public class TextTest extends JoglTestBase {
  @Test
  public void drawText() {
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.drawText("This is a test string");
      }
      public void init(View view, Graphics renderer) {}
View Full Code Here

    });
    context.draw()
  }
  @Test
  public void drawTextWithColor() {
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.setColor(new Color4f(1, 0, 0, 1));
        graphics.drawText("This is a test string");
      }
View Full Code Here

    context.draw()
  }
 
  @Test
  public void drawTextTranslated() {
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clearTransformation();
        graphics.translate(100, 50);
        graphics.clear();
        graphics.drawText("This is a test string");
View Full Code Here

    context.draw()
  }

  @Test (expected=IllegalArgumentException.class)
  public void drawTextNull() {
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.drawText(null);
      }
      public void init(View view, Graphics renderer) {}
View Full Code Here

import ch.blackspirit.graphics.shape.Line;

public class LineTest extends JoglTestBase {
  @Test (expected=IllegalArgumentException.class)
  public void drawLineNull() {
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.drawLine(null, true);
      }
      public void init(View view, Graphics renderer) {}
View Full Code Here

    context.draw();
  }

  @Test (expected=IllegalArgumentException.class)
  public void drawLinesNull() {
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.drawLines(null, true);
      }
      public void init(View view, Graphics renderer) {}
View Full Code Here

TOP

Related Classes of ch.blackspirit.graphics.GraphicsListener

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.