Enum DashPattern

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DashPattern>

    public enum DashPattern
    extends java.lang.Enum<DashPattern>
    The standard dash patterns available to draw paths and outlines.
    Since:
    3.0
    Author:
    Chris Jennings
    • Method Detail

      • values

        public static DashPattern[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DashPattern c : DashPattern.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DashPattern valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • createDashArray

        public final float[] createDashArray​(float penWidth)
        Returns an array of dash segment lengths suitable for representing this dash pattern at the specified stroke width. The lengths of the dash segments will be padded to account for a line end cap length of half the stroke width (on each end of a stroke).
        Parameters:
        penWidth - the stroke width
        Returns:
        an array of dash segment lengths for the dash pattern
      • createDashArray

        public abstract float[] createDashArray​(float penWidth,
                                                float capSpread)
        Returns an array of dash segment lengths suitable for representing this dash pattern at the specified stroke width.
        Parameters:
        penWidth - the stroke width
        capSpread - the amount to pad dash segment lengths by in order to account for the line's end caps
        Returns:
        an array of dash segment lengths for the dash pattern
      • createSelector

        public static javax.swing.JComboBox<DashPattern> createSelector​(javax.swing.JComboBox<?> comboBox)
        Applies a model and renderer to a combo box so that the combo box can be used to select a dash pattern.
        Returns:
        the modified combo box