Interface DropTarget

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default boolean accepts​(Goods goods)
      Can the given goods be dropped on this target?
      default boolean accepts​(GoodsType goodsType)
      Can the given type of goods be dropped on this target?
      default boolean accepts​(Unit unit)
      Can the given unit be dropped on this target?
      java.awt.Component add​(java.awt.Component comp, boolean editState)
      Adds a component to this container and makes sure that the unit or goods that the component represents gets modified so that it is on board the currently selected carrier.
      default int suggested​(GoodsType goodsType)
      Get a suggested amount of goods to add, used when partial amounts are selected.
    • Method Detail

      • accepts

        default boolean accepts​(Goods goods)
        Can the given goods be dropped on this target?
        Parameters:
        goods - The Goods to check.
        Returns:
        True if the goods are acceptable.
      • accepts

        default boolean accepts​(GoodsType goodsType)
        Can the given type of goods be dropped on this target?
        Parameters:
        goodsType - The GoodsType to check.
        Returns:
        True if the goods type is acceptable.
      • accepts

        default boolean accepts​(Unit unit)
        Can the given unit be dropped on this target?
        Parameters:
        unit - The Unit to check.
        Returns:
        True if the unit is acceptable.
      • add

        java.awt.Component add​(java.awt.Component comp,
                               boolean editState)
        Adds a component to this container and makes sure that the unit or goods that the component represents gets modified so that it is on board the currently selected carrier.
        Parameters:
        comp - The component to add to this container.
        editState - Must be set to 'true' if the state of the component that is added (which should be a dropped component representing a unit or goods) should be changed so that the underlying unit or goods are on board the currently selected carrier.
        Returns:
        The component argument on success, null on failure.
      • suggested

        default int suggested​(GoodsType goodsType)
        Get a suggested amount of goods to add, used when partial amounts are selected.
        Parameters:
        goodsType - The GoodsType proposed to add.
        Returns:
        A good amount of goods to add.