Class Overlay

java.lang.Object
is.galia.operation.overlay.Overlay
All Implemented Interfaces:
Operation
Direct Known Subclasses:
ImageOverlay, StringOverlay

public abstract class Overlay extends Object implements Operation
  • Constructor Details

    • Overlay

      public Overlay(Position position, int inset)
  • Method Details

    • freeze

      public void freeze()
      Description copied from interface: Operation
      Makes the instance unmodifiable. When frozen, mutation methods should throw an IllegalStateException and getters should return immutable values, if possible. (But they should do that anyway.)
      Specified by:
      freeze in interface Operation
    • getInset

      public int getInset()
    • getPosition

      public Position getPosition()
    • getResultingSize

      public Size getResultingSize(Size fullSize)
    • hasEffect

      public boolean hasEffect()
      Description copied from interface: Operation
      Simpler but less-accurate counterpart of Operation.hasEffect(Size, OperationList).
      Specified by:
      hasEffect in interface Operation
      Returns:
      Whether applying the operation on its own would result in a changed image.
    • hasEffect

      public boolean hasEffect(Size fullSize, OperationList opList)
      Description copied from interface: Operation
      Context-aware counterpart to Operation.hasEffect(). For example, a scale operation specifying a scale to 300×200, when the given operation list contains a crop of 300×200, would return false.
      Specified by:
      hasEffect in interface Operation
      Parameters:
      fullSize - Full size of the source image.
      opList - Operation list of which the operation may or may not be a member.
      Returns:
      Whether applying the operation in the context of the given full size and operation list would result in a changed image.
    • setInset

      public void setInset(int inset)
      Parameters:
      inset - Inset to set.
      Throws:
      IllegalStateException - if the instance is frozen.
    • setPosition

      public void setPosition(Position position)
      Parameters:
      position - Position to set.
      Throws:
      IllegalStateException - if the instance is frozen.