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)
    • Color mask
    • Constructor Summary

      Constructors 
      Constructor Description
      Transform()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int getAlpha()  
      ColorRGB getMask()  
      int getRotation()  
      float getRotationInRadians()  
      int getScaleX()  
      int getScaleY()  
      int hashCode()  
      boolean isDefaultTransform()
      Returns true if all of this transform's properties are set to their original/default values.
      boolean isRotated()  
      boolean isScaled()  
      void reset()  
      void setAlpha​(int alpha)  
      void setMask​(ColorRGB mask)  
      void setRotation​(int rotation)  
      void setScale​(int scale)  
      void setScale​(int scaleX, int scaleY)  
      void setScaleX​(int scaleX)  
      void setScaleY​(int scaleY)  
      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.
      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.
      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.
      static Transform withScale​(int scale)
      Convenience method that creates a new transform with the specified scale, but all other properties set to their default values.
      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.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • 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.
      • withScale

        public static Transform withScale​(int scale)
        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.