JEuclid Core Source Code Files

JEuclid Source Code Files are provided the JEuclid GitHub Website.

You can browse JEuclid Source Code files below:

✍: FYIcenter

net/sourceforge/jeuclid/layout/Path2DShapeObject.java

package net.sourceforge.jeuclid.layout;

import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.geom.Path2D;

public class Path2DShapeObject implements GraphicsObject
{

    private final Path2D path2D;
    private final float width;

    private final Color col;

    private final boolean dash;
    private final EdgeStyle edgeStyle;

    public enum EdgeStyle
    {
        Miter, Round
    }

    public Path2DShapeObject(Path2D path2D, float width, Color col, boolean dash,
            EdgeStyle edgeStyle)
    {
        this.path2D = path2D;
        this.width = width;
        this.col = col;
        this.dash = dash;
        this.edgeStyle = edgeStyle;
    }

    @Override
    public void paint(float x, float y, Graphics2D g)
    {
        g.setColor(this.col);
        final Stroke oldStroke = g.getStroke();
        int cap = BasicStroke.CAP_SQUARE;
        int join = BasicStroke.JOIN_MITER;
        switch (edgeStyle)
        {
        case Round:
            cap = BasicStroke.CAP_ROUND;
            join = BasicStroke.JOIN_ROUND;
            break;
        case Miter:
        default:
            break;
        }
        if (this.dash)
        {
            final float dashWidth = 3.0f * this.width;
            g.setStroke(new BasicStroke(this.width, cap, join, this.width,
                    new float[] { dashWidth, dashWidth, }, 0));
        }
        else
        {
            g.setStroke(new BasicStroke(this.width, cap, join));
        }
        AffineTransform transform = g.getTransform();
        g.translate(x, y);
        g.draw(this.path2D);
        g.setTransform(transform);
        g.setStroke(oldStroke);
    }
}

net/sourceforge/jeuclid/layout/Path2DShapeObject.java

 

Or download all of them as a single archive file:

File name: jeuclid-core-3.1.14-fyi.zip
File size: 325716 bytes
Release date: 2019-02-24
Download 

 

Using JEuclid 3.1.9 on macOS

Download and Install jeuclid-core-3.1.14.jar

Download and Install JEuclid

⇑⇑ FAQ for JEuclid for MathML

2025-08-15, ≈28🔥, 0💬