Class planetDockable

java.lang.Object
name.moore.kevin.ze.swing.dockables.planetDockable
All Implemented Interfaces:
iDockable

public class planetDockable extends Object implements iDockable
Provides the handler to represent a planet as a dockable tile.
Author:
Kevin Moore <dev@kevin.moore.name>
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • text

      public String text
      public so stardate.xml can access.
    • jlabel

      public JLabel jlabel
    • entityId

      private com.simsilica.es.EntityId entityId
    • mPcs

      private final SwingPropertyChangeSupport mPcs
      uses SwingUtilities.invokeLater() to notify listeners on the Swing event thread
  • Constructor Details

    • planetDockable

      private planetDockable(com.google.common.eventbus.AsyncEventBus gb)
      Listen on the gamebus for events affecting the stardate.
      Parameters:
      gb -
  • Method Details

    • make

      public static planetDockable make(com.google.common.eventbus.AsyncEventBus gb)
      Use a static so we keep a consistent pattern with other components.
      Parameters:
      gb -
      Returns:
    • getName

      public String getName()
      Set when constructing the handler, an internal identity.
      Specified by:
      getName in interface iDockable
      Returns:
      unique name of this dockable component.
    • getXMLlayout

      public String getXMLlayout()
      Description copied from interface: iDockable
      This XML should have the content of the dockable in a panel.
      Specified by:
      getXMLlayout in interface iDockable
      Returns:
    • getText

      public String getText()
      Description copied from interface: iDockable
      The current and changeable displayed text.
      Specified by:
      getText in interface iDockable
      Returns:
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener pcl)
      Allow others to listen to changes to this object and its fields. Default to a NOP so we don't have to implement. Implemented so when the stardate updates here, listeners can update the UI.
      Specified by:
      addPropertyChangeListener in interface iDockable
    • addPropertyChangeListener

      public void addPropertyChangeListener(String propertyName, PropertyChangeListener pcl)
      Specified by:
      addPropertyChangeListener in interface iDockable
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener pcl)
      Specified by:
      removePropertyChangeListener in interface iDockable
    • gameEvent

      public void gameEvent(gameEvent event)
      Listen for events relevant to this dockable widget, and use this to change the appearance of the dockable by broadcasting a propertychangeevent to anyone listening.
      Parameters:
      event -
    • setEntityId

      public planetDockable setEntityId(com.simsilica.es.EntityId e)
      Parameters:
      e - Set the reference to the entity in the repository to be displayed. This will be the datasource.