Class BasicStroke

java.lang.Object
armyc2.c5isr.graphics2d.BasicStroke
All Implemented Interfaces:
Stroke

public class BasicStroke extends Object implements Stroke
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Ends unclosed subpaths and dash segments with no added decoration.
    static final int
    Ends unclosed subpaths and dash segments with a round decoration that has a radius equal to half of the width of the pen.
    static final int
    Ends unclosed subpaths and dash segments with a square projection that extends beyond the end of the segment to a distance equal to half of the line width.
    static final int
    Joins path segments by connecting the outer corners of their wide outlines with a straight segment.
    static final int
    Joins path segments by extending their outside edges until they meet.
    static final int
    Joins path segments by rounding off the corner at a radius of half the line width.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new BasicStroke with defaults for all attributes.
    BasicStroke(float width)
    Constructs a solid BasicStroke with the specified line width and with default values for the cap and join styles.
    BasicStroke(float width, int cap, int join)
     
    BasicStroke(float width, int cap, int join, float miterlimit)
     
    BasicStroke(float width, int cap, int join, float miterlimit, float[] dash, float dash_phase)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Returns a Shape whose interior defines the stroked outline of a specified Shape.
    float[]
    Returns the array representing the lengths of the dash segments.
    float
     
    int
    Returns the end cap style.
    GetInteriorPoints(POINT2[] pLinePoints, int vblCounter, int lineType, double dist)
     
    int
     
    float
     
    float
    Returns the limit of miter joins.
    int
    Returns the hashcode for this stroke.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • JOIN_MITER

      public static final int JOIN_MITER
      Joins path segments by extending their outside edges until they meet.
      See Also:
    • JOIN_ROUND

      public static final int JOIN_ROUND
      Joins path segments by rounding off the corner at a radius of half the line width.
      See Also:
    • JOIN_BEVEL

      public static final int JOIN_BEVEL
      Joins path segments by connecting the outer corners of their wide outlines with a straight segment.
      See Also:
    • CAP_BUTT

      public static final int CAP_BUTT
      Ends unclosed subpaths and dash segments with no added decoration.
      See Also:
    • CAP_ROUND

      public static final int CAP_ROUND
      Ends unclosed subpaths and dash segments with a round decoration that has a radius equal to half of the width of the pen.
      See Also:
    • CAP_SQUARE

      public static final int CAP_SQUARE
      Ends unclosed subpaths and dash segments with a square projection that extends beyond the end of the segment to a distance equal to half of the line width.
      See Also:
  • Constructor Details

    • BasicStroke

      public BasicStroke(float width, int cap, int join, float miterlimit, float[] dash, float dash_phase)
    • BasicStroke

      public BasicStroke(float width, int cap, int join, float miterlimit)
    • BasicStroke

      public BasicStroke(float width, int cap, int join)
    • BasicStroke

      public BasicStroke(float width)
      Constructs a solid BasicStroke with the specified line width and with default values for the cap and join styles.
      Parameters:
      width - the width of the BasicStroke
      Throws:
      IllegalArgumentException - if width is negative
    • BasicStroke

      public BasicStroke()
      Constructs a new BasicStroke with defaults for all attributes. The default attributes are a solid line of width 1.0, CAP_SQUARE, JOIN_MITER, a miter limit of 10.0.
  • Method Details

    • createStrokedShape

      Returns a Shape whose interior defines the stroked outline of a specified Shape.
      Specified by:
      createStrokedShape in interface Stroke
      Parameters:
      s - the Shape boundary be stroked
      Returns:
      the Shape of the stroked outline.
    • createStrokedShape

    • getLineWidth

      public float getLineWidth()
    • getEndCap

      public int getEndCap()
      Returns the end cap style.
      Returns:
      the end cap style of this BasicStroke as one of the static int values that define possible end cap styles.
    • getLineJoin

      public int getLineJoin()
    • getMiterLimit

      public float getMiterLimit()
      Returns the limit of miter joins.
      Returns:
      the limit of miter joins of the BasicStroke.
    • getDashArray

      public float[] getDashArray()
      Returns the array representing the lengths of the dash segments. Alternate entries in the array represent the user space lengths of the opaque and transparent segments of the dashes. As the pen moves along the outline of the Shape to be stroked, the user space distance that the pen travels is accumulated. The distance value is used to index into the dash array. The pen is opaque when its current cumulative distance maps to an even element of the dash array and transparent otherwise.
      Returns:
      the dash array.
    • getDashPhase

      public float getDashPhase()
    • hashCode

      public int hashCode()
      Returns the hashcode for this stroke.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code for this stroke.
    • GetInteriorPoints

      public static ArrayList<POINT2> GetInteriorPoints(POINT2[] pLinePoints, int vblCounter, int lineType, double dist)