Package plotter

Examples of plotter.CountingGraphics


  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(5, line.getPointCount());
    line.removeAllPoints();
    assertEquals(0, line.getPointCount());
    assertEquals(0, line.getXData().getLength());
    assertEquals(0, line.getYData().getLength());
    CountingGraphics g = paint();
    assertEquals(0, g.getPointCount());

    add(.1, .1);
    add(.2, .2);
    CountingGraphics g2 = paint(new Rectangle(24, 176, 10, 10));

    LineChecker c = new LineChecker();
    c.require(19, 180, 39, 160);
    c.allow(39, 160, 59, 140);
    c.allow(59, 140, 79, 120);
    c.check(g2.getLines());
    assertEquals(g2.getLines().size() + 1, g2.getPointCount());
  }
View Full Code Here

    add(.1, .1);
    add(.2, .2);
    add(.3, .3);
    add(.4, .4);
    add(.5, .5);
    CountingGraphics g = paint(new Rectangle(24, 176, 10, 10));

    LineChecker c = new LineChecker();
    c.require(19, 180, 39, 160);
    c.allow(39, 160, 59, 140);
    c.allow(59, 140, 79, 120);
    c.check(g.getLines());
    assertEquals(g.getLines().size() + 1, g.getPointCount());
  }
View Full Code Here

    add(.1, .1);
    add(.2, .2);
    add(.3, .3);
    add(.4, .4);
    add(.5, .5);
    CountingGraphics g = paint(new Rectangle(44, 136, 10, 10));

    LineChecker c = new LineChecker();
    c.allow(19, 180, 39, 160);
    c.require(39, 160, 59, 140);
    c.allow(59, 140, 79, 120);
    c.check(g.getLines());
    assertEquals(g.getLines().size() + 1, g.getPointCount());
  }
View Full Code Here

    add(.1, .1);
    add(.2, .2);
    add(.3, .3);
    add(.4, .4);
    add(.5, .5);
    CountingGraphics g = paint(new Rectangle(64, 116, 10, 10));

    LineChecker c = new LineChecker();
    c.allow(19, 180, 39, 160);
    c.allow(39, 160, 59, 140);
    c.require(59, 140, 79, 120);
    c.check(g.getLines());
    assertEquals(g.getLines().size() + 1, g.getPointCount());
  }
View Full Code Here

    add(.1, .1);
    add(.2, .2);
    add(.3, .3);
    add(.4, .4);
    add(.5, .5);
    CountingGraphics g = paint(new Rectangle(84, 96, 10, 10));

    LineChecker c = new LineChecker();
    c.require(79, 120, 99, 100);
    c.check(g.getLines());
    assertEquals(g.getLines().size() + 1, g.getPointCount());
  }
View Full Code Here

    add(.9, .1);
    add(.8, .2);
    add(.7, .3);
    add(.6, .4);
    add(.5, .5);
    CountingGraphics g = paint(new Rectangle(24, 176, 10, 10));

    LineChecker c = new LineChecker();
    c.require(19, 180, 39, 160);
    c.allow(39, 160, 59, 140);
    c.allow(59, 140, 79, 120);
    c.check(g.getLines());
    assertEquals(g.getLines().size() + 1, g.getPointCount());
  }
View Full Code Here

    prepend(.1, .1);
    prepend(.2, .2);
    prepend(.3, .3);
    prepend(.4, .4);
    prepend(.5, .5);
    CountingGraphics g = paint(new Rectangle(24, 176, 10, 10));

    LineChecker c = new LineChecker();
    c.require(19, 180, 39, 160);
    c.allow(39, 160, 59, 140);
    c.check(g.getLines());
    assertEquals(g.getLines().size() + 1, g.getPointCount());
  }
View Full Code Here

    prepend(.1, .1);
    prepend(.2, .2);
    prepend(.3, .3);
    prepend(.4, .4);
    prepend(.5, .5);
    CountingGraphics g = paint(new Rectangle(44, 156, 10, 10));

    LineChecker c = new LineChecker();
    c.allow(19, 180, 39, 160);
    c.require(39, 160, 59, 140);
    c.check(g.getLines());
    assertEquals(g.getLines().size() + 1, g.getPointCount());
  }
View Full Code Here

    prepend(.2, .2);
    prepend(.3, .3);
    prepend(.4, .4);
    prepend(.5, .5);
    prepend(.6, .6);
    CountingGraphics g = paint(new Rectangle(24, 176, 10, 10));

    LineChecker c = new LineChecker();
    c.require(19, 180, 39, 160);
    c.allow(39, 160, 59, 140);
    c.check(g.getLines());
    assertEquals(g.getLines().size() + 1, g.getPointCount());
  }
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.