Class planetDockable
java.lang.Object
name.moore.kevin.ze.swing.dockables.planetDockable
- All Implemented Interfaces:
iDockable
Provides the handler to represent a planet as a dockable tile.
- Author:
- Kevin Moore
<dev@kevin.moore.name>
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateplanetDockable(com.google.common.eventbus.AsyncEventBus gb)Listen on the gamebus for events affecting the stardate. -
Method Summary
Modifier and TypeMethodDescriptionvoidAllow others to listen to changes to this object and its fields.voidaddPropertyChangeListener(String propertyName, PropertyChangeListener pcl)voidListen for events relevant to this dockable widget, and use this to change the appearance of the dockable by broadcasting a propertychangeevent to anyone listening.getName()Set when constructing the handler, an internal identity.getText()The current and changeable displayed text.This XML should have the content of the dockable in a panel.static planetDockablemake(com.google.common.eventbus.AsyncEventBus gb)Use a static so we keep a consistent pattern with other components.voidsetEntityId(com.simsilica.es.EntityId e)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface name.moore.kevin.ze.swing.dockables.iDockable
getPreferredDock, getTileHeight, getTileWidth
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
text
public so stardate.xml can access. -
jlabel
-
entityId
private com.simsilica.es.EntityId entityId -
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
Use a static so we keep a consistent pattern with other components.- Parameters:
gb-- Returns:
-
getName
Set when constructing the handler, an internal identity. -
getXMLlayout
Description copied from interface:iDockableThis XML should have the content of the dockable in a panel.- Specified by:
getXMLlayoutin interfaceiDockable- Returns:
-
getText
Description copied from interface:iDockableThe current and changeable displayed text. -
addPropertyChangeListener
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:
addPropertyChangeListenerin interfaceiDockable
-
addPropertyChangeListener
- Specified by:
addPropertyChangeListenerin interfaceiDockable
-
removePropertyChangeListener
- Specified by:
removePropertyChangeListenerin interfaceiDockable
-
gameEvent
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
- Parameters:
e- Set the reference to the entity in the repository to be displayed. This will be the datasource.
-