Class starDateDockable
java.lang.Object
name.moore.kevin.ze.swing.dockables.starDateDockable
- All Implemented Interfaces:
iDockable
Provides the handler to represent the starDate as a two-width tile.
- Author:
- Kevin Moore
<dev@kevin.moore.name>
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatestarDateDockable(com.google.common.eventbus.AsyncEventBus gb)Listen on the gamebus for events affecting the stardate. -
Method Summary
Modifier and TypeMethodDescriptionvoidImplemented so when the stardate updates here, listeners can update the UI.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.Return the dock location - one of the cardinals eg "north".getText()The current and changeable displayed text.intThis XML should have the content of the dockable in a panel.static starDateDockablemake(com.google.common.eventbus.AsyncEventBus gb)Use a static so we keep a consistent pattern with other components.voidMethods 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
getTileHeight
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
text
public so stardate.xml can access. -
jlabel
-
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
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. -
getTileWidth
public int getTileWidth()- Specified by:
getTileWidthin interfaceiDockable- Returns:
- width in terms of grid slots to use, default is 1
-
getPreferredDock
Description copied from interface:iDockableReturn the dock location - one of the cardinals eg "north". Default to "center" matching the default 1x1 tile size.- Specified by:
getPreferredDockin interfaceiDockable- Returns:
-
addPropertyChangeListener
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:
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-
-