com.aspose.pdf.operators

Class SetDash



  • public class SetDash
    extends Operator

    Class representing d operator (set line dash pattern).

    • Constructor Detail

      • SetDash

        public SetDash(int index,
                       com.aspose.pdf.engine.commondata.pagecontent.operators.commands.ICommand command)

        Constructor for operator class.

        Parameters:
        index - Index of operator.
        command - Operator command.
      • SetDash

        public SetDash(int[] pattern,
                       int phase)

        Creates set dash pattern operator.

        Parameters:
        pattern - Array which defines dash pattern.
        phase - Dash phase.
    • Method Detail

      • getPattern

        public int[] getPattern()

        Dash pattern. Array's elements shall be numbers that specify the lengths of alternating dashes and gaps. In case of one element array dash and gap lengths are equal.

        Returns:
        int array
      • setPattern

        public void setPattern(int[] value)

        Dash pattern. Array's elements shall be numbers that specify the lengths of alternating dashes and gaps. In case of one element array dash and gap lengths are equal.

        Parameters:
        value - int array
      • getPhase

        public int getPhase()

        Dash phase. Before beginning to stroke a path, the dash array shall be cycled through, adding up the lengths of dashes and gaps. When the accumulated length equals the value specified by the dash phase, stroking of the path shall begin, and the dash array shall be used cyclically from that point onward.

        Returns:
        int value
      • setPhase

        public void setPhase(int value)

        Dash phase. Before beginning to stroke a path, the dash array shall be cycled through, adding up the lengths of dashes and gaps. When the accumulated length equals the value specified by the dash phase, stroking of the path shall begin, and the dash array shall be used cyclically from that point onward.

        Parameters:
        value - int value
      • accept

        public void accept(IOperatorSelector visitor)

        Accepts visitor object to process operator.

        Specified by:
        accept in class Operator
        Parameters:
        visitor - Visitor object.
      • toString

        public String toString()

        Gets operator string representation.

        Overrides:
        toString in class Operator
        Returns:
        [x1 x2] y d, where x1 - dash length, x2 - gap length, y - phase.
      • fromCommand

        public void fromCommand(com.aspose.pdf.engine.commondata.pagecontent.operators.commands.ICommand command)
        Description copied from class: Operator
        For internal usage only!

        Loads operator from command

        Parameters:
        command - ICommand value
      • toCommand

        public com.aspose.pdf.engine.commondata.pagecontent.operators.commands.ICommand toCommand()
        Description copied from class: Operator
        For internal usage only!

        saves operator to command

        Returns:
        ICommand value ICommand object