Search in sources :

Example 6 with Arc

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

the class TestViewCircleArc method testClipArrowSameStartEndNotEmptyClip.

@Theory
public void testClipArrowSameStartEndNotEmptyClip(final ArcStyle style) {
    assumeTrue(style.supportArrow());
    model.setArcStyle(style);
    model.setAngleStart(0d);
    model.setAngleEnd(0d);
    model.setArrowLength(0d);
    model.setArrowStyle(ArrowStyle.RIGHT_ARROW, 0);
    model.setArrowStyle(ArrowStyle.RIGHT_DBLE_ARROW, -1);
    WaitForAsyncUtils.waitForFxEvents();
    final Arc clip = (Arc) view.border.getClip();
    assertNotEquals(clip.getLength(), 0d);
}
Also used : ICircleArc(net.sf.latexdraw.models.interfaces.shape.ICircleArc) Arc(javafx.scene.shape.Arc) Theory(org.junit.experimental.theories.Theory)

Example 7 with Arc

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

the class TestViewCircleArc method testClipArrowSameDimensions.

@Theory
public void testClipArrowSameDimensions(final ArcStyle style) {
    assumeTrue(style.supportArrow());
    model.setArcStyle(style);
    model.setArrowStyle(ArrowStyle.RIGHT_ARROW, 0);
    model.setArrowStyle(ArrowStyle.RIGHT_DBLE_ARROW, -1);
    WaitForAsyncUtils.waitForFxEvents();
    final Arc clip = (Arc) view.border.getClip();
    assertEquals(clip.getCenterX(), view.border.getCenterX(), 0.0001);
    assertEquals(clip.getCenterY(), view.border.getCenterY(), 0.0001);
    assertEquals(clip.getRadiusX(), view.border.getRadiusX(), 0.0001);
    assertEquals(clip.getRadiusY(), view.border.getRadiusY(), 0.0001);
}
Also used : ICircleArc(net.sf.latexdraw.models.interfaces.shape.ICircleArc) Arc(javafx.scene.shape.Arc) Theory(org.junit.experimental.theories.Theory)

Example 8 with Arc

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

the class TestViewCircleArc method testSetAngleStartMainBorder.

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

Example 9 with Arc

use of javafx.scene.shape.Arc in project aima-java by aimacode.

the class VacuumEnvironmentViewCtrl method createAgentRep.

protected Node createAgentRep(boolean suck) {
    Arc arc = new Arc();
    arc.setRadiusX(0.3 * envStateView.getWidth() / locations.size());
    arc.setRadiusY(0.3 * envStateView.getWidth() / locations.size());
    arc.setStartAngle(45.0f);
    arc.setLength(suck ? 360.0f : 270.0f);
    arc.setType(ArcType.ROUND);
    arc.setFill(Color.RED);
    return arc;
}
Also used : Arc(javafx.scene.shape.Arc)

Example 10 with Arc

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

the class TestViewCircleArc method testSetAngleStartMainBorderLength.

@Theory
public void testSetAngleStartMainBorderLength(final Function<ViewCircleArc, Arc> fct) {
    final Arc arc = fct.apply(view);
    final double length = arc.getLength();
    final double angle = model.getAngleStart() + Math.PI / 4d;
    model.setAngleStart(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)

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