Package plotter

Examples of plotter.CountingGraphics



  public void testPaintClipPartial() throws InterruptedException, InvocationTargetException {
    setupX();
    line.setValue(.5);
    CountingGraphics g = paint(new Rectangle(0, 49, 200, 100));
    LineChecker c = new LineChecker();
    c.require(99, 48, 99, 149);
    c.check(g.getLines());
  }
View Full Code Here



  public void testPaintClipPartialY() throws InterruptedException, InvocationTargetException {
    setupY();
    line.setValue(.5);
    CountingGraphics g = paint(new Rectangle(49, 0, 100, 200));
    LineChecker c = new LineChecker();
    c.require(48, 100, 149, 100);
    c.check(g.getLines());
  }
View Full Code Here

  public void testPaintClipPartialCustomStroke() throws InterruptedException, InvocationTargetException {
    setupX();
    line.setStroke(new BasicStroke(1, 0, 0, 1, new float[] { 5, 5 }, 0));
    line.setValue(.5);
    CountingGraphics g = paint(new Rectangle(0, 49, 200, 100));
    LineChecker c = new LineChecker();
    c.require(99, 40, 99, 149);
    c.check(g.getLines());
  }
View Full Code Here

  public void testPaintClipPartialCustomStrokeY() throws InterruptedException, InvocationTargetException {
    setupY();
    line.setStroke(new BasicStroke(1, 0, 0, 1, new float[] { 5, 5 }, 0));
    line.setValue(.5);
    CountingGraphics g = paint(new Rectangle(49, 0, 100, 200));
    LineChecker c = new LineChecker();
    c.require(40, 100, 149, 100);
    c.check(g.getLines());
  }
View Full Code Here

      public Shape createStrokedShape(Shape p) {
        return s.createStrokedShape(p);
      }
    });
    line.setValue(.5);
    CountingGraphics g = paint(new Rectangle(0, 49, 200, 100));
    LineChecker c = new LineChecker();
    c.require(99, 0, 99, 200);
    c.check(g.getLines());
  }
View Full Code Here

      public Shape createStrokedShape(Shape p) {
        return s.createStrokedShape(p);
      }
    });
    line.setValue(.5);
    CountingGraphics g = paint(new Rectangle(49, 0, 100, 200));
    LineChecker c = new LineChecker();
    c.require(0, 100, 200, 100);
    c.check(g.getLines());
  }
View Full Code Here

  private CountingGraphics paint(Shape clip) throws InterruptedException, InvocationTargetException {
    final JFrame frame = new JFrame();
    frame.getContentPane().add(plot);
    BufferedImage image = new BufferedImage(200, 200, BufferedImage.TYPE_3BYTE_BGR);
    final Graphics2D imageG = image.createGraphics();
    final CountingGraphics g = new CountingGraphics(imageG);
    try {
      if(clip != null) {
        g.setClip(clip);
      }
      SwingUtilities.invokeAndWait(new Runnable() {
        @Override
        public void run() {
          try {
View Full Code Here

    assertEquals(.1, listener.startX, .01);
    assertEquals(.9, listener.startY, .01);
    assertEquals(.3, listener.endX, .01);
    assertEquals(.8, listener.endY, .01);

    CountingGraphics g = new CountingGraphics(new BufferedImage(1000, 1000, BufferedImage.TYPE_3BYTE_BGR)
        .createGraphics());
    slopeLine.paintComponent(g);
    LineChecker lines = new LineChecker();
    lines.require(0, 50, 1000, 550);
    lines.check(g.getLines());

    MouseEvent release = new MouseEvent(contents, MouseEvent.MOUSE_RELEASED, System.currentTimeMillis(), 0, x3, y3,
        xAbs3, yAbs3, 1, false, MouseEvent.BUTTON1);
    slopeLine.mouseReleased(release);
    assertEquals(1, listener.addCount);
View Full Code Here


  public void testPaintSimple() throws InterruptedException, InvocationTargetException {
    add(.1, .1);
    add(.9, .9);
    CountingGraphics g = paint();
    assertEquals(2, g.getPointCount());

    LineChecker c = new LineChecker();
    c.require(19, 180, 179, 20);
    c.check(g.getLines());
  }
View Full Code Here

  public void testPaintInverted() throws InterruptedException, InvocationTargetException {
    plot.getXAxis().setStart(1);
    plot.getXAxis().setEnd(0);
    add(.1, .1);
    add(.9, .9);
    CountingGraphics g = paint();
    assertEquals(2, g.getPointCount());

    LineChecker c = new LineChecker();
    c.require(179, 180, 19, 20);
    c.check(g.getLines());
  }
View Full Code Here

TOP

Related Classes of plotter.CountingGraphics

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.