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

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


  }


  @Test public void testShape2() {
    assertTrue(group.getShapeAt(2) instanceof IPolyline);
    final IPolyline line = (IPolyline) group.getShapeAt(2);
    assertEquals(2, line.getNbPoints());
    assertEquals(336.5569380759364, line.getPtAt(0).getX(), 0.0001);
    assertEquals(212.8049502670051, line.getPtAt(0).getY(), 0.0001);
    assertEquals(424.08868741702884, line.getPtAt(1).getX(), 0.0001);
    assertEquals(164.45008642386978, line.getPtAt(1).getY(), 0.0001);
    assertEquals(0., line.getRotationAngle(),0.0001);
    assertEquals(6., line.getThickness(),0.0001);
    assertEquals(CSSColors.INSTANCE.getRGBColour("#909090"), line.getLineColour()); //$NON-NLS-1$
    assertFalse(line.isFilled());
    assertEquals(FillingStyle.NONE, line.getFillingStyle());
    assertFalse(line.hasShadow());
    assertEquals(ArrowStyle.NONE, line.getArrowStyle(0));
    assertEquals(ArrowStyle.RIGHT_ARROW, line.getArrowStyle(1));
    assertEquals(0., line.getArrowAt(1).getArrowInset(), 0.00001);
    assertEquals(2.64583, line.getArrowAt(1).getArrowSizeDim(), 0.00001);
    assertEquals(2.0, line.getArrowAt(1).getArrowSizeNum(), 0.00001);
    assertEquals(1.4, line.getArrowAt(1).getArrowLength(), 0.00001);
  }
View Full Code Here


  }


  @Test public void testArrow() {
    assertTrue(group.getShapeAt(0) instanceof IPolyline);
    final IPolyline pol = (IPolyline) group.getShapeAt(0);
    assertEquals(IArrow.ArrowStyle.RIGHT_ARROW, pol.getArrowAt(1).getArrowStyle());
  }
View Full Code Here

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


  @Test public void testFilling() {
    final IPolyline line = getLine();
    assertTrue(line.isFilled());
    assertEquals(new Color(183, 44, 44), line.getFillingCol());
    assertEquals(FillingStyle.PLAIN, line.getFillingStyle());
  }
View Full Code Here

    assertEquals(new Color(183, 44, 44), line.getFillingCol());
    assertEquals(FillingStyle.PLAIN, line.getFillingStyle());
  }

  @Test public void testPoints() {
    final IPolyline line = getLine();
    assertEquals(6, line.getNbPoints());
    assertEquals(260.0, line.getPtAt(0).getX(), 0.001);
    assertEquals(440.0, line.getPtAt(0).getY(), 0.001);
    assertEquals(260.0, line.getPtAt(1).getX(), 0.001);
    assertEquals(220.0, line.getPtAt(1).getY(), 0.001);
    assertEquals(520.0, line.getPtAt(2).getX(), 0.001);
    assertEquals(220.0, line.getPtAt(2).getY(), 0.001);
    assertEquals(640.0, line.getPtAt(3).getX(), 0.001);
    assertEquals(300.0, line.getPtAt(3).getY(), 0.001);
    assertEquals(760.0, line.getPtAt(4).getX(), 0.001);
    assertEquals(220.0, line.getPtAt(4).getY(), 0.001);
    assertEquals(760.0, line.getPtAt(5).getX(), 0.001);
    assertEquals(120.0, line.getPtAt(5).getY(), 0.001);
  }
View Full Code Here

    assertEquals(120.0, line.getPtAt(5).getY(), 0.001);
  }


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

    assertEquals(new Color(22, 131, 175), line.getLineColour());
    assertEquals(LineStyle.DASHED, line.getLineStyle());
  }

  @Test public void testShadow() {
    final IPolyline line = getLine();
    assertTrue(line.hasShadow());
    assertEquals(new Color(101, 224, 41), line.getShadowCol());
    assertEquals(80.0, Math.toDegrees(line.getShadowAngle()), 0.00001);
    assertEquals(20.0, line.getShadowSize(), 0.0001);
  }
View Full Code Here

    assertEquals(80.0, Math.toDegrees(line.getShadowAngle()), 0.00001);
    assertEquals(20.0, line.getShadowSize(), 0.0001);
  }

  @Test public void testArrows() {
    final IPolyline line = getLine();
    assertEquals(IArrow.ArrowStyle.LEFT_SQUARE_BRACKET, line.getArrowStyle(0));
    assertEquals(IArrow.ArrowStyle.CIRCLE_END, line.getArrowStyle(-1));
    assertEquals(2.2, line.getDotSizeNum(), 0.0001);
    assertEquals(5.0, line.getDotSizeDim(), 0.0001);
    assertEquals(0.25, line.getBracketNum(), 0.0001);
    assertEquals(4.0, line.getTBarSizeDim(), 0.0001);
    assertEquals(10.0, line.getTBarSizeNum(), 0.0001);
  }
View Full Code Here

    assertTrue(PSTParser.errorLogs().isEmpty());
  }

  @Test
  public void test1Coordinates() throws ParseException {
    IPolyline line =  (IPolyline)parser.parsePSTCode("\\"+getCommandName()+"(5,10)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(2, line.getNbPoints());
    assertEquals(0., line.getPtAt(0).getX(), 0.0001);
    assertEquals(0., line.getPtAt(0).getY(), 0.0001);
    assertEquals(5.*IShape.PPC, line.getPtAt(1).getX(), 0.0001);
    assertEquals(-10.*IShape.PPC, line.getPtAt(1).getY(), 0.0001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here



  @Test
  public void testCoordinatesPt() throws ParseException {
    IPolyline line =  (IPolyline)parser.parsePSTCode("\\"+getCommandName()+"(35pt,20pt)(10pt,5pt)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(2, line.getNbPoints());
    assertEquals(35.*IShape.PPC/PSTricksConstants.CM_VAL_PT, line.getPtAt(0).getX(), 0.0001);
    assertEquals(-20.*IShape.PPC/PSTricksConstants.CM_VAL_PT, line.getPtAt(0).getY(), 0.0001);
    assertEquals(10.*IShape.PPC/PSTricksConstants.CM_VAL_PT, line.getPtAt(1).getX(), 0.0001);
    assertEquals(-5.*IShape.PPC/PSTricksConstants.CM_VAL_PT, line.getPtAt(1).getY(), 0.0001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void testCoordinatesMm() throws ParseException {
    IPolyline line =  (IPolyline)parser.parsePSTCode("\\"+getCommandName()+"(350mm,200mm)(10mm, 30.3mm)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(2, line.getNbPoints());
    assertEquals(35.*IShape.PPC, line.getPtAt(0).getX(), 0.0001);
    assertEquals(-20.*IShape.PPC, line.getPtAt(0).getY(), 0.0001);
    assertEquals(1.*IShape.PPC, line.getPtAt(1).getX(), 0.0001);
    assertEquals(-3.03*IShape.PPC, line.getPtAt(1).getY(), 0.0001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
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.