Package net.sf.freecol.client.gui.panel
Interface DropTarget
-
- All Known Implementing Classes:
CargoPanel
,ColonyPanel.BuildingsPanel.ASingleBuildingPanel
,ColonyPanel.ColonyCargoPanel
,ColonyPanel.OutsideColonyPanel
,ColonyPanel.TilesPanel.ASingleTilePanel
,ColonyPanel.WarehousePanel
,EuropePanel.DestinationPanel
,EuropePanel.EuropeanDocksPanel
,EuropePanel.MarketPanel
,GoodsTypePanel
,TradeRouteInputPanel.AllGoodsTypesPanel
,TradeRouteInputPanel.StopGoodsTypesPanel
public 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
- TheGoods
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
- TheGoodsType
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
- TheUnit
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
- TheGoodsType
proposed to add.- Returns:
- A good amount of goods to add.
-
-