Package net.sf.latexdraw.glib.models.interfaces.shape

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IPolyline


  }


  @Test public void testShape4() {
    assertTrue(group.getShapeAt(4) instanceof IPolyline);
    IPolyline pol = (IPolyline) group.getShapeAt(4);

    assertEquals(new Color(177, 177, 177), pol.getLineColour());
    assertEquals(2, pol.getNbPoints());
    assertFalse(pol.hasDbleBord());
    assertEquals(4., pol.getThickness(),0.0001);
    assertEquals(294., pol.getPtAt(0).getX(), 0.00001);
    assertEquals(102., pol.getPtAt(0).getY(), 0.00001);
    assertEquals(294.0, pol.getPtAt(1).getX(), 0.00001);
    assertEquals(167.0, pol.getPtAt(1).getY(), 0.00001);
    assertEquals(0., pol.getRotationAngle(),0.0001);
    assertEquals(LineStyle.DASHED, pol.getLineStyle());
    assertFalse(pol.hasShadow());
    assertEquals(FillingStyle.NONE, pol.getFillingStyle());
  }
View Full Code Here


  }


  @Test public void testShape0() {
    assertTrue(group.getShapeAt(0) instanceof IPolyline);
    IPolyline pol = (IPolyline) group.getShapeAt(0);

    assertEquals(Color.BLACK, pol.getLineColour());
    assertEquals(2, pol.getNbPoints());
    assertTrue(pol.hasDbleBord());
    assertEquals(1., pol.getThickness(),0.0001);
    assertEquals(204.37871, pol.getPtAt(0).getX(), 0.00001);
    assertEquals(401.13132, pol.getPtAt(1).getX(), 0.00001);
    assertEquals(193.85937, pol.getPtAt(0).getY(), 0.00001);
    assertEquals(193.0, pol.getPtAt(1).getY(), 0.00001);
    assertEquals(0., pol.getRotationAngle(),0.0001);
    assertEquals(LineStyle.SOLID, pol.getLineStyle());
    assertEquals(6., pol.getDbleBordSep(),0.0001);
    assertEquals(Color.WHITE, pol.getDbleBordCol());
    assertFalse(pol.hasShadow());
    assertEquals(ArrowStyle.NONE, pol.getArrowAt(0).getArrowStyle());
    assertEquals(ArrowStyle.RIGHT_ARROW, pol.getArrowAt(1).getArrowStyle());
    assertEquals(0.4, pol.getArrowAt(1).getArrowInset(), 0.00001);
    assertEquals(2.65, pol.getArrowAt(1).getArrowSizeDim(), 0.01);
    assertEquals(2.0, pol.getArrowAt(1).getArrowSizeNum(), 0.00001);
    assertEquals(1.4, pol.getArrowAt(1).getArrowLength(), 0.00001);
    assertEquals(FillingStyle.NONE, pol.getFillingStyle());
  }
View Full Code Here

  }


  @Test public void testShape0() {
    assertTrue(group.getShapeAt(0) instanceof IPolyline);
    IPolyline pol = (IPolyline) group.getShapeAt(0);
    assertEquals(Color.BLACK, pol.getLineColour());
    assertEquals(2, pol.getNbPoints());
    assertEquals(50., pol.getPtAt(0).getX(),0.0001);
    assertEquals(145., pol.getPtAt(0).getY(),0.0001);
    assertEquals(410., pol.getPtAt(1).getX(),0.0001);
    assertEquals(145., pol.getPtAt(1).getY(),0.0001);
    assertEquals(0., pol.getRotationAngle(),0.0001);
    assertEquals(1., pol.getThickness(),0.0001);
    assertEquals(ArrowStyle.NONE, pol.getArrowStyle(0));
    assertEquals(ArrowStyle.RIGHT_ARROW, pol.getArrowStyle(1));
    assertEquals(0.4, pol.getArrowAt(1).getArrowInset(), 0.00001);
    assertEquals(2.64583, pol.getArrowAt(1).getArrowSizeDim(), 0.00001);
    assertEquals(2.0, pol.getArrowAt(1).getArrowSizeNum(), 0.00001);
    assertEquals(1.4, pol.getArrowAt(1).getArrowLength(), 0.00001);
  }
View Full Code Here

    assertEquals(4.0, line.getTBarSizeDim(), 0.0001);
    assertEquals(10.0, line.getTBarSizeNum(), 0.0001);
  }

  @Test public void testDbleBorder() {
    final IPolyline line = getLine();
    assertTrue(line.hasDbleBord());
    assertEquals(new Color(213, 240, 66), line.getDbleBordCol());
    assertEquals(4, line.getDbleBordSep(), 0.001);
  }
View Full Code Here

  @Test
  public void testConstructor() {
    IPoint pt1   = ShapeFactory.createPoint(1, 1);
    IPoint pt2   = ShapeFactory.createPoint(2, 2);
    IPolyline pol = ShapeFactory.createPolyline(pt1, pt2);

    pol = ShapeFactory.createPolyline(pt1, pt2);
    assertEquals(pt1, pol.getPtAt(0));
    assertEquals(pt2, pol.getPtAt(-1));

    pol = ShapeFactory.createPolyline();
    pol = ShapeFactory.createPolyline();

    try {
View Full Code Here

  public IPolyline getLine() { return (IPolyline)group.getShapeAt(0); }


  @Test public void testPoints() {
    final IPolyline line = getLine();
    assertEquals(2, line.getNbPoints());
    assertEquals(140.0, line.getPtAt(0).getX(), 0.001);
    assertEquals(260.0, line.getPtAt(0).getY(), 0.001);
    assertEquals(320.0, line.getPtAt(1).getX(), 0.001);
    assertEquals(40.0, line.getPtAt(1).getY(), 0.001);
  }
View Full Code Here

    assertEquals(40.0, line.getPtAt(1).getY(), 0.001);
  }


  @Test public void testLine() {
    final IPolyline line = getLine();
    assertEquals(5, line.getThickness(), 0.01);
    assertEquals(new Color(209, 169, 169), line.getLineColour());
    assertEquals(LineStyle.DASHED, line.getLineStyle());
  }
View Full Code Here

    assertEquals(new Color(209, 169, 169), line.getLineColour());
    assertEquals(LineStyle.DASHED, line.getLineStyle());
  }

  @Test public void testShadow() {
    final IPolyline line = getLine();
    assertTrue(line.hasShadow());
    assertEquals(DviPsColors.INSTANCE.convertHTML2rgb("#e9e937"), line.getShadowCol()); //$NON-NLS-1$
    assertEquals(90.0, Math.toDegrees(line.getShadowAngle()), 0.00001);
    assertEquals(10.0, line.getShadowSize(), 0.0001);
  }
View Full Code Here

    assertEquals(90.0, Math.toDegrees(line.getShadowAngle()), 0.00001);
    assertEquals(10.0, line.getShadowSize(), 0.0001);
  }

  @Test public void testArrows() {
    final IPolyline line = getLine();
    assertEquals(IArrow.ArrowStyle.DISK_IN, line.getArrowStyle(0));
    assertEquals(IArrow.ArrowStyle.RIGHT_ARROW, line.getArrowStyle(1));
    assertEquals(4.0, line.getDotSizeNum(), 0.0001);
    assertEquals(4.53, line.getDotSizeDim(), 0.0001);
    assertEquals(2.4, line.getArrowLength(), 0.0001);
    assertEquals(0.1, line.getArrowInset(), 0.0001);
    assertEquals(3.0, line.getArrowSizeNum(), 0.0001);
    assertEquals(2.65, line.getArrowSizeDim(), 0.01);
  }
View Full Code Here

    assertEquals(3.0, line.getArrowSizeNum(), 0.0001);
    assertEquals(2.65, line.getArrowSizeDim(), 0.01);
  }

  @Test public void testDbleBorder() {
    final IPolyline line = getLine();
    assertTrue(line.hasDbleBord());
    assertEquals(new Color(224, 197, 227), line.getDbleBordCol());
    assertEquals(6, line.getDbleBordSep(), 0.001);
  }
View Full Code Here

TOP

Related Classes of net.sf.latexdraw.glib.models.interfaces.shape.IPolyline

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.