All Known Implementing Classes:
Label, OutlinePane, PatternPane, StaticPane

public interface Rotatable
An interface for panes that are rotatable
Since:
0.3.0
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the rotation specified to this pane.
    static void
    load(@NotNull Rotatable rotatable, @NotNull Element element)
    Loads all elements regarding a Rotatable Pane for the specified pane.
    void
    setRotation(int rotation)
    Sets the rotation of this pane.
  • Method Details

    • setRotation

      void setRotation(int rotation)
      Sets the rotation of this pane. The rotation is in degrees and can only be in increments of 90. Anything higher than 360, will be lowered to a value in between [0, 360) while maintaining the same rotational value. E.g. 450 degrees becomes 90 degrees, 1080 degrees becomes 0, etc. This method fails for any pane that has a length and height which are unequal.
      Parameters:
      rotation - the rotation of this pane, must be divisible by 90.
      Throws:
      UnsupportedOperationException - when the length and height of the pane are not the same
      IllegalArgumentException - when the rotation isn't a multiple of 90
      Since:
      0.3.0
    • getRotation

      @Contract(pure=true) int getRotation()
      Gets the rotation specified to this pane. If no rotation has been set, or if this pane is not capable of having a rotation, 0 is returned.
      Returns:
      the rotation for this pane
      Since:
      0.3.0
    • load

      static void load(@NotNull @NotNull Rotatable rotatable, @NotNull @NotNull Element element)
      Loads all elements regarding a Rotatable Pane for the specified pane. The mutable pane contains the changes made.
      Parameters:
      rotatable - the rotatable pane's elements to be applied
      element - the XML element for this pane
      Since:
      0.3.0