Package plotter

Examples of plotter.CountingGraphics


  public void testPointOutline() throws InterruptedException, InvocationTargetException {
    line.setPointOutline(createSquare());
    add(.1, .1);
    add(.9, .9);
    CountingGraphics g = paint();
    assertEquals(12, g.getPointCount());
    assertEquals(2, g.getShapeCount());

    LineChecker c = new LineChecker();
    c.require(19, 180, 179, 20);

    // Point 1
    c.require(14, 175, 14, 185);
    c.require(14, 185, 24, 185);
    c.require(24, 185, 24, 175);
    c.require(24, 175, 14, 175);

    // Point 2
    c.require(174, 15, 174, 25);
    c.require(174, 25, 184, 25);
    c.require(184, 25, 184, 15);
    c.require(184, 15, 174, 15);

    c.check(g.getLines());
  }
View Full Code Here


  public void testPointOutlineNaN() throws InterruptedException, InvocationTargetException {
    line.setPointOutline(createSquare());
    add(.1, .1);
    add(.5, Double.NaN);
    add(.9, .9);
    CountingGraphics g = paint();
    assertEquals(10, g.getPointCount());
    assertEquals(2, g.getShapeCount());

    LineChecker c = new LineChecker();

    // Point 1
    c.require(14, 175, 14, 185);
    c.require(14, 185, 24, 185);
    c.require(24, 185, 24, 175);
    c.require(24, 175, 14, 175);

    // Point 3
    c.require(174, 15, 174, 25);
    c.require(174, 25, 184, 25);
    c.require(184, 25, 184, 15);
    c.require(184, 15, 174, 15);

    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


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

    LineChecker c = new LineChecker();
    c.require(19, 180, 179, 20);
    c.check(g.getLines());
    assertEquals(2, g.getPointCount());
  }
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();

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

  public void testPaintLeadingNaN() throws InterruptedException, InvocationTargetException {
    add(.05, Double.NaN);
    add(.1, .1);
    add(.9, .9);
    CountingGraphics g = paint();

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

  public void testPaintTrailingNaN() throws InterruptedException, InvocationTargetException {
    add(.1, .1);
    add(.9, .9);
    add(.95, Double.NaN);
    CountingGraphics g = paint();

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

    add(.1, .1);
    add(.2, .2);
    add(.5, Double.NaN);
    add(.8, .8);
    add(.9, .9);
    CountingGraphics g = paint();

    LineChecker c = new LineChecker();
    c.require(19, 180, 39, 160);
    c.require(159, 40, 179, 20);
    c.check(g.getLines());
    assertEquals(4, g.getPointCount());
  }
View Full Code Here

    add(.1, .1);
    add(.9, .9);
    add(.95, Double.NaN);
    add(.96, Double.NaN);
    add(.97, Double.NaN);
    CountingGraphics g = paint();

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

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

    LineChecker c = new LineChecker();
    c.allow(39, 160, 59, 140);
    c.allow(59, 140, 79, 120);
    c.require(79, 120, 99, 100);
    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.