Search in sources :

Example 1 with IArrow

use of net.sf.latexdraw.models.interfaces.shape.IArrow in project latexdraw by arnobl.

the class GenericViewArrow method updatePath.

default void updatePath(final boolean isShadow) {
    final IArrow arrow = getArrow();
    final ILine arrowLine = arrow.getArrowLine();
    if (arrow.getArrowStyle() == ArrowStyle.NONE || arrowLine == null || !arrow.hasStyle()) {
        return;
    }
    final IPoint pt1 = arrowLine.getPoint1();
    final IPoint pt2 = arrowLine.getPoint2();
    setTranslation(pt1.getX(), pt1.getY());
    switch(arrow.getArrowStyle()) {
        case BAR_END:
            updatePathBarEnd(isShadow);
            break;
        case BAR_IN:
            updatePathBarIn(pt1, pt2, isShadow);
            break;
        case CIRCLE_END:
        case DISK_END:
            updatePathDiskCircleEnd(isShadow);
            break;
        case CIRCLE_IN:
        case DISK_IN:
            updatePathDiskCircleIn(pt1, pt2, isShadow);
            break;
        case RIGHT_ARROW:
        case LEFT_ARROW:
            updatePathRightLeftArrow(isShadow);
            break;
        case RIGHT_DBLE_ARROW:
        case LEFT_DBLE_ARROW:
            updatePathDoubleLeftRightArrow(isShadow);
            break;
        case RIGHT_ROUND_BRACKET:
        case LEFT_ROUND_BRACKET:
            updatePathRoundLeftRightBracket(isShadow);
            break;
        case LEFT_SQUARE_BRACKET:
        case RIGHT_SQUARE_BRACKET:
            updatePathRightLeftSquaredBracket(isShadow);
            break;
        case SQUARE_END:
            updatePathSquareEnd(pt1, pt2, isShadow);
            break;
        case ROUND_END:
            updatePathRoundEnd(isShadow);
            break;
        case ROUND_IN:
            updatePathRoundIn(pt1, pt2, isShadow);
            break;
        case NONE:
            break;
    }
}
Also used : ILine(net.sf.latexdraw.models.interfaces.shape.ILine) IPoint(net.sf.latexdraw.models.interfaces.shape.IPoint) IArrow(net.sf.latexdraw.models.interfaces.shape.IArrow)

Example 2 with IArrow

use of net.sf.latexdraw.models.interfaces.shape.IArrow in project latexdraw by arnobl.

the class GenericViewArrow method updatePathRoundLeftRightBracket.

default void updatePathRoundLeftRightBracket(final boolean isShadow) {
    final IArrow arrow = getArrow();
    final double width = arrow.getBarShapedArrowWidth();
    final double widtharc = arrow.getRBracketNum() * width * 2d;
    final double xarc = -widtharc / 2d;
    final double angle = -50d;
    createArc(xarc, 0d, widtharc / 2d, width / 2d, angle, 100d, createLineOrShadColBinding(isShadow), arrow.getShape().thicknessProperty());
    if (arrow.isInverted()) {
        setRotation180();
    }
}
Also used : IArrow(net.sf.latexdraw.models.interfaces.shape.IArrow)

Example 3 with IArrow

use of net.sf.latexdraw.models.interfaces.shape.IArrow in project latexdraw by arnobl.

the class GenericViewArrow method updatePathRoundIn.

default void updatePathRoundIn(final IPoint pt1, final IPoint pt2, final boolean isShadow) {
    final IArrow arrow = getArrow();
    final double lineWidth = arrow.getShape().getFullThickness() / 2d;
    createCircle(isArrowInPositiveDirection(pt1, pt2) ? lineWidth : -lineWidth, 0d, lineWidth);
    setStrokeFillDiskCircle(isShadow);
}
Also used : IArrow(net.sf.latexdraw.models.interfaces.shape.IArrow)

Example 4 with IArrow

use of net.sf.latexdraw.models.interfaces.shape.IArrow in project latexdraw by arnobl.

the class GenericViewArrow method updatePathDiskCircleIn.

default void updatePathDiskCircleIn(final IPoint pt1, final IPoint pt2, final boolean isShadow) {
    final IArrow arrow = getArrow();
    final double arrowRadius = arrow.getRoundShapedArrowRadius();
    final double lineWidth = arrow.getShape().getFullThickness();
    createCircle(isArrowInPositiveDirection(pt1, pt2) ? arrowRadius : -arrowRadius, 0d, arrowRadius - lineWidth / 2d);
    setCircleStrokeWidth(lineWidth);
    setStrokeFillDiskCircle(isShadow);
}
Also used : IArrow(net.sf.latexdraw.models.interfaces.shape.IArrow)

Example 5 with IArrow

use of net.sf.latexdraw.models.interfaces.shape.IArrow in project latexdraw by arnobl.

the class GenericViewArrow method updatePathDiskCircleEnd.

default void updatePathDiskCircleEnd(final boolean isShadow) {
    final IArrow arrow = getArrow();
    final double lineWidth = arrow.getShape().getFullThickness();
    final double arrowRadius = arrow.getRoundShapedArrowRadius();
    createCircle(0d, 0d, arrowRadius - lineWidth / 2d);
    setCircleStrokeWidth(lineWidth);
    setStrokeFillDiskCircle(isShadow);
}
Also used : IArrow(net.sf.latexdraw.models.interfaces.shape.IArrow)

Aggregations

IArrow (net.sf.latexdraw.models.interfaces.shape.IArrow)18 IPoint (net.sf.latexdraw.models.interfaces.shape.IPoint)3 SVGElement (net.sf.latexdraw.parsers.svg.SVGElement)2 Arc (javafx.scene.shape.Arc)1 ArrowStyle (net.sf.latexdraw.models.interfaces.shape.ArrowStyle)1 Color (net.sf.latexdraw.models.interfaces.shape.Color)1 ICircleArc (net.sf.latexdraw.models.interfaces.shape.ICircleArc)1 ILine (net.sf.latexdraw.models.interfaces.shape.ILine)1 IPolyline (net.sf.latexdraw.models.interfaces.shape.IPolyline)1 SVGGElement (net.sf.latexdraw.parsers.svg.SVGGElement)1 Test (org.junit.Test)1