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 booleanaccepts(Goods goods)Can the given goods be dropped on this target?default booleanaccepts(GoodsType goodsType)Can the given type of goods be dropped on this target?default booleanaccepts(Unit unit)Can the given unit be dropped on this target?java.awt.Componentadd(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 intsuggested(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- TheGoodsto 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- TheGoodsTypeto 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- TheUnitto 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- TheGoodsTypeproposed to add.- Returns:
- A good amount of goods to add.
-
-