Class Style

java.lang.Object
com.myscript.iink.graphics.Style

public class Style extends Object
Style information for the rendering of strokes and text.
  • Constructor Details

    • Style

      public Style()
      Default constructor. Builds a Style with default values
    • Style

      public Style(@NotNull @NotNull Style other)
      Copy constructor.
      Parameters:
      other - copied object.
  • Method Details

    • clear

      public void clear()
      Resets all style attributes to their default values and clear the change flags.
    • setStrokeColor

      public void setStrokeColor(@NotNull @NotNull Color strokeColor)
      Sets the stroke color.
      Parameters:
      strokeColor - the stroke color.
    • getStrokeColor

      @NotNull public @NotNull Color getStrokeColor()
      Retrieves the stroke color.
      Returns:
      the stroke color.
    • setStrokeWidth

      public void setStrokeWidth(float strokeWidth)
      Sets the stroke width.
      Parameters:
      strokeWidth - the stroke width.
    • getStrokeWidth

      public float getStrokeWidth()
      Retrieves the stroke width.
      Returns:
      the stroke width.
    • setStrokeLineCap

      public void setStrokeLineCap(@NotNull @NotNull LineCap strokeLineCap)
      Sets the stroke line cap.
      Parameters:
      strokeLineCap - the stroke line cap.
    • getStrokeLineCap

      @NotNull public @NotNull LineCap getStrokeLineCap()
      Retrieves the stroke line cap.
      Returns:
      the stroke line cap.
    • setStrokeLineJoin

      public void setStrokeLineJoin(@NotNull @NotNull LineJoin strokeLineJoin)
      Sets the stroke line join.
      Parameters:
      strokeLineJoin - the stroke line join.
    • getStrokeLineJoin

      @NotNull public @NotNull LineJoin getStrokeLineJoin()
      Retrieves the stroke line join.
      Returns:
      the stroke line join.
    • setStrokeMiterLimit

      public void setStrokeMiterLimit(float strokeMiterLimit)
      Sets the stroke miter limit.
      Parameters:
      strokeMiterLimit - the stroke miter limit.
    • getStrokeMiterLimit

      public float getStrokeMiterLimit()
      Retrieves the stroke miter limit.
      Returns:
      the stroke miter limit.
    • setStrokeDashArray

      public void setStrokeDashArray(@Nullable @org.jetbrains.annotations.Nullable float[] strokeDashArray)
      Sets the pattern of dashes and gaps used to stroke paths.
      Parameters:
      strokeDashArray - the vector describing the dashes pattern.
    • getStrokeDashArray

      @Nullable public @org.jetbrains.annotations.Nullable float[] getStrokeDashArray()
      Retrieves the stroke dash pattern.
      Returns:
      the stroke dash pattern.
    • setStrokeDashOffset

      public void setStrokeDashOffset(float strokeDashOffset)
      Sets the distance into the dash pattern to start the dash.
      Parameters:
      strokeDashOffset - the dash offset.
    • getStrokeDashOffset

      public float getStrokeDashOffset()
      Retrieves the stroke dash offset.
      Returns:
      the stroke dash offset.
    • setFillColor

      public void setFillColor(@NotNull @NotNull Color fillColor)
      Sets the fill color.
      Parameters:
      fillColor - the fill color.
    • getFillColor

      @NotNull public @NotNull Color getFillColor()
      Retrieves the stroke fill color.
      Returns:
      the stroke fill color.
    • setFillRule

      public void setFillRule(@NotNull @NotNull FillRule fillRule)
      Sets the fill rule.
      Parameters:
      fillRule - the fill rule.
    • getFillRule

      @NotNull public @NotNull FillRule getFillRule()
      Retrieves the stroke fill rule.
      Returns:
      the stroke fill rule.
    • setFontFamily

      public void setFontFamily(@NotNull @NotNull String fontFamily)
      Sets the font family.
      Parameters:
      fontFamily - the font family.
    • getFontFamily

      @NotNull public @NotNull String getFontFamily()
      Retrieves the font family.
      Returns:
      the font family.
    • setFontLineHeight

      public void setFontLineHeight(float fontLineHeight)
      Sets the font line height.
      Parameters:
      fontLineHeight - the font line height.
    • getFontLineHeight

      public float getFontLineHeight()
      Retrieves the font line height.
      Returns:
      the font line height.
    • setFontSize

      public void setFontSize(float fontSize)
      Sets the font size.
      Parameters:
      fontSize - the font size.
    • getFontSize

      public float getFontSize()
      Retrieves the font size.
      Returns:
      the font size.
    • setFontStyle

      public void setFontStyle(@NotNull @NotNull String fontStyle)
      Sets the font style.
      Parameters:
      fontStyle - the font style.
    • getFontStyle

      @NotNull public @NotNull String getFontStyle()
      Retrieves the font style.
      Returns:
      the font style.
    • setFontVariant

      public void setFontVariant(@NotNull @NotNull String fontVariant)
      Sets the font variant.
      Parameters:
      fontVariant - the font variant.
    • getFontVariant

      @NotNull public @NotNull String getFontVariant()
      Retrieves the font variant.
      Returns:
      the font variant.
    • setFontWeight

      public void setFontWeight(int fontWeight)
      Sets the font weight.
      Parameters:
      fontWeight - the font weight.
    • getFontWeight

      public int getFontWeight()
      Retrieves the font weight.
      Returns:
      the font weight.
    • setDropShadowXOffset

      public void setDropShadowXOffset(float dropShadowXOffset)
      Sets the drop shadow horizontal offset.
      Parameters:
      dropShadowXOffset - the drop shadow horizontal offset.
    • getDropShadowXOffset

      public float getDropShadowXOffset()
      Retrieves the drop shadow horizontal offset.
      Returns:
      the drop shadow horizontal offset.
    • setDropShadowYOffset

      public void setDropShadowYOffset(float dropShadowYOffset)
      Sets the drop shadow vertical offset.
      Parameters:
      dropShadowYOffset - the drop shadow vertical offset.
    • getDropShadowYOffset

      public float getDropShadowYOffset()
      Retrieves the drop shadow vertical offset.
      Returns:
      the drop shadow vertical offset.
    • setDropShadowRadius

      public void setDropShadowRadius(float dropShadowRadius)
      Sets the drop shadow blur radius.
      Parameters:
      dropShadowRadius - the drop shadow blur radius.
    • getDropShadowRadius

      public float getDropShadowRadius()
      Retrieves the drop shadow blur radius.
      Returns:
      the drop shadow blur radius.
    • setDropShadowColor

      public void setDropShadowColor(@NotNull @NotNull Color dropShadowColor)
      Sets the drop shadow color.
      Parameters:
      dropShadowColor - the drop shadow color.
    • getDropShadowColor

      @NotNull public @NotNull Color getDropShadowColor()
      Retrieves the drop shadow color.
      Returns:
      the drop shadow color.
    • getChangeFlags

      @NotNull public @NotNull EnumSet<StyleFlag> getChangeFlags()
      Returns the set of style attributes changed since construction or last call to clearChangeFlags().
      Returns:
      the set of style flags.
    • clearChangeFlags

      public void clearChangeFlags()
      Clears the change flags.
    • applyTo

      public void applyTo(@NotNull @NotNull ICanvas canvas)
      Apply changed style attributes to the specified target canvas.
      Parameters:
      canvas - the target canvas.
      See Also:
    • equals

      public boolean equals(@Nullable @Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @NotNull public @NotNull String toString()
      Overrides:
      toString in class Object