Class GeneralPath

  • All Implemented Interfaces:
    IRenderingElement

    public class GeneralPath
    extends Object
    implements IRenderingElement
    A path of rendering elements from the elements.path package.
    Author:
    Arvid
    Source code:
    main
    Belongs to CDK module:
    renderbasic
    • Constructor Detail

      • GeneralPath

        public GeneralPath​(List<PathElement> elements,
                           Color color)
        Make a path from a list of path elements.
        Parameters:
        elements - the elements that make up the path
        color - the color of the path
    • Method Detail

      • recolor

        public GeneralPath recolor​(Color newColor)
        Recolor the path with the specified color.
        Parameters:
        newColor - new path color
        Returns:
        the recolored path
      • outline

        public GeneralPath outline​(double newStroke)
        Outline the general path with the specified stroke size.
        Parameters:
        newStroke - new stroke size
        Returns:
        the outlined path
      • shapeOf

        public static GeneralPath shapeOf​(Shape shape,
                                          Color color)
        Create a filled path of the specified Java 2D Shape and color.
        Parameters:
        shape - Java 2D shape
        color - the color to fill the shape with
        Returns:
        a new general path
      • outlineOf

        public static GeneralPath outlineOf​(Shape shape,
                                            double stroke,
                                            Color color)
        Create an outline path of the specified Java 2D Shape and color.
        Parameters:
        shape - Java 2D shape
        color - the color to draw the outline with
        Returns:
        a new general path