Class FeatureEnabledItemPanel

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
games.stendhal.client.gui.FeatureEnabledItemPanel
All Implemented Interfaces:
DropTarget, Inspectable, FeatureChangeListener, ImageObserver, MenuContainer, Serializable

public class FeatureEnabledItemPanel extends JComponent implements FeatureChangeListener
An ItemPanel that is enabled/disabled with a feature change event.
See Also:
Serialized Form
  • Method Details

    • featureDisabled

      public void featureDisabled(String name)
      Description copied from interface: FeatureChangeListener
      A feature was disabled.
      Specified by:
      featureDisabled in interface FeatureChangeListener
      Parameters:
      name - The name of the feature.
    • featureEnabled

      public void featureEnabled(String name, String value)
      Description copied from interface: FeatureChangeListener
      A feature was enabled.
      Specified by:
      featureEnabled in interface FeatureChangeListener
      Parameters:
      name - The name of the feature.
      value - Optional feature specific data.
    • setVisible

      public void setVisible(boolean visible)
      Overrides:
      setVisible in class JComponent
    • setInspector

      public void setInspector(Inspector inspector)
      Set the inspector the contained entity should use.
      Specified by:
      setInspector in interface Inspectable
      Parameters:
      inspector - used inspector
    • setEntity

      protected void setEntity(IEntity entity)
      Set the slot entity.
      Parameters:
      entity - The new entity, or null.
    • setParent

      protected void setParent(IEntity parent)
      Set the containing entity.
      Parameters:
      parent - entity owning the slot to which this panel belongs to
    • paintComponent

      public void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • dropEntity

      public void dropEntity(IEntity entity, int amount, Point point)
      Description copied from interface: DropTarget
      Drop an entity at a given location. Called when dragging ends.
      Specified by:
      dropEntity in interface DropTarget
      Parameters:
      entity - dropped entity
      amount - number of dropped entities. -1 in case everything in the stack should be dropped
      point - location within the DropTarget
    • canAccept

      public boolean canAccept(IEntity entity)
      Description copied from interface: DropTarget
      Check if the DropTarget can accept a certain entity.
      Specified by:
      canAccept in interface DropTarget
      Parameters:
      entity - entity to be checked
      Returns:
      true, if the DropTarget can process the entity in question, false otherwise