Class StrokeProperty

    • Constructor Detail

      • StrokeProperty

        public StrokeProperty​(java.lang.String key,
                              java.lang.String defaultValue)
        Create a new stroke property from a string.
        Parameters:
        key - The key to use
        defaultValue - The default stroke as string
      • StrokeProperty

        public StrokeProperty​(java.lang.String key,
                              java.awt.BasicStroke defaultStroke)
        Create a new stroke property from a stroke object.
        Parameters:
        key - The key
        defaultStroke - The default stroke.
    • Method Detail

      • toString

        protected java.lang.String toString​(java.awt.BasicStroke t)
        Description copied from class: AbstractToStringProperty
        Converts the string to an object of the given type.
        Specified by:
        toString in class AbstractToStringProperty<java.awt.BasicStroke>
        Parameters:
        t - The object.
        Returns:
        The string representing the object
      • getFromString

        public static java.awt.BasicStroke getFromString​(java.lang.String code)
        Return s new BasicStroke object with given thickness and style
        Parameters:
        code - = 3.5 → thickness=3.5px; 3.5 10 5 → thickness=3.5px, dashed: 10px filled + 5px empty
        Returns:
        stroke for drawing
      • toDashArray

        private static float[] toDashArray​(java.util.List<java.lang.Double> dashes)