Search in sources :

Example 11 with Arc

use of javafx.scene.shape.Arc in project latexdraw by arnobl.

the class TestViewCircleArc method testThicknessChangeRadius.

@Test
public void testThicknessChangeRadius() {
    final Arc arc = cloneArc(view.border);
    model.setThickness(model.getThickness() * 2d);
    WaitForAsyncUtils.waitForFxEvents();
    assertNotEquals(arc.getRadiusX(), view.border.getRadiusX(), 0.00001);
    assertNotEquals(arc.getRadiusY(), view.border.getRadiusY(), 0.00001);
}
Also used : ICircleArc(net.sf.latexdraw.models.interfaces.shape.ICircleArc) Arc(javafx.scene.shape.Arc) Test(org.junit.Test)

Example 12 with Arc

use of javafx.scene.shape.Arc in project latexdraw by arnobl.

the class TestViewCircleArc method testSetAngleEndMainBorder.

@Theory
public void testSetAngleEndMainBorder(final Function<ViewCircleArc, Arc> fct) {
    final Arc arc = fct.apply(view);
    final double length = arc.getLength();
    final double angle = model.getAngleEnd() + Math.PI / 4d;
    model.setAngleEnd(angle);
    WaitForAsyncUtils.waitForFxEvents();
    assertNotEquals(arc.getLength(), length);
    assertEquals(Math.toDegrees(model.getAngleEnd() - model.getAngleStart()), arc.getLength(), 0.0001);
}
Also used : ICircleArc(net.sf.latexdraw.models.interfaces.shape.ICircleArc) Arc(javafx.scene.shape.Arc) Theory(org.junit.experimental.theories.Theory)

Example 13 with Arc

use of javafx.scene.shape.Arc in project latexdraw by arnobl.

the class TestViewCircleArc method cloneArc.

private Arc cloneArc(final Arc arc) {
    final Arc clone = new Arc(arc.getCenterX(), arc.getCenterY(), arc.getRadiusX(), arc.getRadiusY(), arc.getStartAngle(), arc.getLength());
    clone.setType(arc.getType());
    return clone;
}
Also used : ICircleArc(net.sf.latexdraw.models.interfaces.shape.ICircleArc) Arc(javafx.scene.shape.Arc)

Example 14 with Arc

use of javafx.scene.shape.Arc in project latexdraw by arnobl.

the class TestViewCircleArc method testTicknessChangeDbleSep.

@Test
public void testTicknessChangeDbleSep() {
    final Arc arc = cloneArc(view.border);
    model.setHasDbleBord(true);
    model.setDbleBordSep(model.getDbleBordSep() * 2d);
    WaitForAsyncUtils.waitForFxEvents();
    assertNotEquals(arc.getRadiusX(), view.border.getRadiusX(), 0.00001);
    assertNotEquals(arc.getRadiusY(), view.border.getRadiusY(), 0.00001);
}
Also used : ICircleArc(net.sf.latexdraw.models.interfaces.shape.ICircleArc) Arc(javafx.scene.shape.Arc) Test(org.junit.Test)

Example 15 with Arc

use of javafx.scene.shape.Arc in project latexdraw by arnobl.

the class TestViewCircleArc method testTicknessChangeHasDblBord.

@Test
public void testTicknessChangeHasDblBord() {
    final Arc arc = cloneArc(view.border);
    model.setHasDbleBord(true);
    WaitForAsyncUtils.waitForFxEvents();
    assertNotEquals(arc.getRadiusX(), view.border.getRadiusX(), 0.00001);
    assertNotEquals(arc.getRadiusY(), view.border.getRadiusY(), 0.00001);
}
Also used : ICircleArc(net.sf.latexdraw.models.interfaces.shape.ICircleArc) Arc(javafx.scene.shape.Arc) Test(org.junit.Test)

Aggregations

Arc (javafx.scene.shape.Arc)24 ICircleArc (net.sf.latexdraw.models.interfaces.shape.ICircleArc)10 Text (javafx.scene.text.Text)8 Pane (javafx.scene.layout.Pane)5 Line (javafx.scene.shape.Line)5 Rectangle (javafx.scene.shape.Rectangle)5 Theory (org.junit.experimental.theories.Theory)5 Circle (javafx.scene.shape.Circle)4 TextFlow (javafx.scene.text.TextFlow)4 Rotate (javafx.scene.transform.Rotate)4 Canvas (javafx.scene.canvas.Canvas)3 DropShadow (javafx.scene.effect.DropShadow)3 Path (javafx.scene.shape.Path)3 Test (org.junit.Test)3 Section (eu.hansolo.tilesfx.Section)2 TimeSection (eu.hansolo.tilesfx.TimeSection)2 CacheHint (javafx.scene.CacheHint)2 Group (javafx.scene.Group)2 Tooltip (javafx.scene.control.Tooltip)2 InnerShadow (javafx.scene.effect.InnerShadow)2