Class starDateDockable

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

public class starDateDockable extends Object implements iDockable
Provides the handler to represent the starDate as a two-width 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
    • mPcs

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

    • starDateDockable

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

    • make

      public static starDateDockable 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:
    • getTileWidth

      public int getTileWidth()
      Specified by:
      getTileWidth in interface iDockable
      Returns:
      width in terms of grid slots to use, default is 1
    • getPreferredDock

      public String getPreferredDock()
      Description copied from interface: iDockable
      Return the dock location - one of the cardinals eg "north". Default to "center" matching the default 1x1 tile size.
      Specified by:
      getPreferredDock in interface iDockable
      Returns:
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener pcl)
      Implemented so when the stardate updates here, listeners can update the UI. Allow others to listen to changes to this object and its fields. Default to a NOP so we don't have to implement.
      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 -