Class GGradient.Swatch

java.lang.Object
com.iizix.prop.GGradient.Swatch
Enclosing class:
GGradient

public static class GGradient.Swatch extends Object
Inner class for a Swatch in a gradient.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    The RGB color 0-0xFFFFFF.
    final int
    The stop position (0-100) as percent value in the gradient direction.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Swatch(int color, int stop)
    Constructs a swatch.
    Constructs a swatch from a Transaction.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Appends a swatch to a transaction.
    boolean
    Checks if two swatch objects are equal.
    Gets the color as a String in the form described below.
    protected String
    Returns the parameter string representing the state of this event.
    Returns a string representation of this class instance and its values.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • color

      public final int color
      The RGB color 0-0xFFFFFF.
    • stop

      public final int stop
      The stop position (0-100) as percent value in the gradient direction.
  • Constructor Details

    • Swatch

      public Swatch(int color, int stop)
      Constructs a swatch.
      Parameters:
      color - The RGB color 0-0xFFFFFF.
      stop - The stop position (0-100) as percent value in the gradient direction.
      Throws:
      IllegalArgumentException - for range errors.
    • Swatch

      public Swatch(ReadTransaction trans)
      Constructs a swatch from a Transaction.
  • Method Details

    • append

      public void append(SendTransaction trans)
      Appends a swatch to a transaction.
    • equals

      public boolean equals(Object o)
      Checks if two swatch objects are equal.
      Overrides:
      equals in class Object
      Parameters:
      o - another swatch object. If null, the swatches are not equal.
      Returns:
      true if equal, false otherwise.
    • getString

      public String getString()
      Gets the color as a String in the form described below.
      Returns:
      the String as described above.
    • paramString

      protected String paramString()
      Returns the parameter string representing the state of this event. This string is useful for debugging. Subclasses adds extra information to the string by preceding it with a comma followed by the extra information.
      Returns:
      the parameter string of this event.
    • toString

      public String toString()
      Returns a string representation of this class instance and its values.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this class instance.