Class DropReceiverComponent<T>

Type Parameters:
T - payload type

public class DropReceiverComponent<T> extends ContainerComponent
Drop target used with DragSourceComponent.
  • Constructor Details

    • DropReceiverComponent

      public DropReceiverComponent()
  • Method Details

    • accepts

      public DropReceiverComponent<T> accepts(Predicate<T> accepts)
      Sets the payload acceptance predicate.
      Parameters:
      accepts - acceptance predicate
      Returns:
      this component
    • onDrop

      Sets the drop callback invoked when a compatible payload is released over this receiver.
      Parameters:
      onDrop - drop callback
      Returns:
      this component
    • acceptChild

      public DropReceiverComponent<T> acceptChild(Function<T, GuiComponent<?>> childFactory)
      Sets a helper that mounts a component generated from the dropped payload.
      Parameters:
      childFactory - component factory
      Returns:
      this component
    • dragHoverBackgroundColor

      public DropReceiverComponent<T> dragHoverBackgroundColor(RenderColor dragHoverBackgroundColor)
      Sets the hover background color used while a compatible payload is over the receiver.
      Parameters:
      dragHoverBackgroundColor - hover background color
      Returns:
      this component
    • dragHoverBorderColor

      public DropReceiverComponent<T> dragHoverBorderColor(RenderColor dragHoverBorderColor)
      Sets the hover border color used while a compatible payload is over the receiver.
      Parameters:
      dragHoverBorderColor - hover border color
      Returns:
      this component
    • renderSelf

      protected void renderSelf(com.render.api.gui.GuiRenderContext context)
      Overrides:
      renderSelf in class ContainerComponent