Class Transform

  • All Implemented Interfaces:
    AlphaTransform

    public class Transform
    extends java.lang.Object
    implements AlphaTransform
    Transformation that can be applied to a graphic when displaying it. The transform consists of the following aspects:
    • Rotation (in degrees)
    • Scale (as a percentage, 100% being the original size)
    • Alpha (as a percentage, 100% is opaque, 0% is fully transparent)
    • Constructor Detail

      • Transform

        public Transform()
    • Method Detail

      • reset

        public void reset()
      • isDefaultTransform

        public boolean isDefaultTransform()
        Returns true if all of this transform's properties are set to their original/default values.
      • setRotation

        public void setRotation​(int rotation)
      • getRotation

        public int getRotation()
      • getRotationInRadians

        public float getRotationInRadians()
      • isRotated

        public boolean isRotated()
      • setScale

        public void setScale​(int scale)
      • setScale

        public void setScale​(int scaleX,
                             int scaleY)
      • setScaleX

        public void setScaleX​(int scaleX)
      • getScaleX

        public int getScaleX()
      • setScaleY

        public void setScaleY​(int scaleY)
      • getScaleY

        public int getScaleY()
      • isScaled

        public boolean isScaled()
      • setAlpha

        public void setAlpha​(int alpha)
      • setMask

        public void setMask​(ColorRGB mask)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • withRotation

        public static Transform withRotation​(int rotation)
        Convenience method that creates a new transform with the specified rotation, but all other properties set to their default values.
      • withScale

        public static Transform withScale​(int scaleX,
                                          int scaleY)
        Convenience method that creates a new transform with the specified scale, but all other properties set to their default values.
      • withAlpha

        public static Transform withAlpha​(int alpha)
        Convenience method that creates a new transform with the specified alpha value, but all other properties set to their default values.
      • withMask

        public static Transform withMask​(ColorRGB mask)
        Convenience method that creates a new transform with the specified color mask, but all other properties set to their default values.