Package plotter

Examples of plotter.CountingGraphics


    prepend(.1, .1);
    prepend(.2, .2);
    prepend(.3, .3);
    prepend(.4, Double.NaN);
    prepend(.5, Double.NaN);
    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


    prependDD(.1, .1);
    prependDD(.2, .2);
    prependDD(.3, .3);
    prependDD(.4, Double.NaN);
    prependDD(.5, Double.NaN);
    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

  private CountingGraphics paint(final XYAxis axis, Shape clip) throws InterruptedException, InvocationTargetException {
    final JFrame frame = new JFrame();
    frame.getContentPane().add(axis);
    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();
    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.getYAxis().setStart(1);
    plot.getYAxis().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

  public void testPaintLeadingNaN() throws InterruptedException, InvocationTargetException {
    add(.05, Double.NaN);
    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 testPaintTrailingNaN() throws InterruptedException, InvocationTargetException {
    add(.1, .1);
    add(.9, .9);
    add(.95, Double.NaN);
    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

    new DefaultXYLayoutGenerator().generateLayout(plot);
  }


  public void testPaintSimple() throws InterruptedException, InvocationTargetException {
    CountingGraphics g = paint();
    LineChecker c = new LineChecker();
    c.require(199, 0, 199, 200);
    c.require(149, 0, 149, 200);
    c.require(99, 0, 99, 200);
    c.require(49, 0, 49, 200);
    c.require(0, 150, 200, 150);
    c.require(0, 100, 200, 100);
    c.require(0, 50, 200, 50);
    c.require(0, 0, 200, 0);
    c.check(g.getLines());
  }
View Full Code Here

    c.check(g.getLines());
  }


  public void testPaintClip() throws InterruptedException, InvocationTargetException {
    CountingGraphics g = paint(new Rectangle(25, 25, 50, 2));
    LineChecker c = new LineChecker();
    c.require(49, 24, 49, 27);
    c.check(g.getLines());
  }
View Full Code Here

  }


  public void testPaintClipCustomStroke() throws InterruptedException, InvocationTargetException {
    grid.setStroke(new BasicStroke(1, 0, 0, 1, new float[] { 5, 5 }, 0));
    CountingGraphics g = paint(new Rectangle(25, 25, 50, 2));
    LineChecker c = new LineChecker();
    c.require(49, 20, 49, 27);
    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.